changeset 112069:17134f58ba8a

merge emacs-23
author Kenichi Handa <handa@m17n.org>
date Wed, 13 Oct 2010 22:40:51 +0900
parents c6fd83f300a8 (current diff) 3c6608402b1e (diff)
children 7cf6b779fb96
files lisp/emacs-lisp/cl-compat.el lisp/emacs-lisp/lmenu.el lisp/obsolete/cl-compat.el lisp/obsolete/lmenu.el
diffstat 229 files changed, 12524 insertions(+), 21371 deletions(-) [+]
line wrap: on
line diff
--- a/BUGS	Sun Aug 29 14:22:52 2010 +0900
+++ b/BUGS	Wed Oct 13 22:40:51 2010 +0900
@@ -1,26 +1,23 @@
-If you think you may have found a bug in GNU Emacs, please
-read the Bugs section of the Emacs manual for advice on
+If you think you may have found a bug in GNU Emacs, please read the
+Bugs section of the Emacs manual for advice on
+
 (1) how to tell when to report a bug, and
-(2) how to write a useful bug report and what information
-it needs to have.
-
-There are three ways to read the Bugs section.
+(2) how to write a useful bug report and what information it needs to have.
 
-(1) In a printed copy of the Emacs manual.
-You can order one from the Free Software Foundation;
-see the file etc/ORDERS.  But if you don't have a copy on
-hand and you think you have found a bug, you shouldn't wait
-to get a printed manual; you should read the section right away
-as described below.
+You can read the read the Bugs section of the manual from inside Emacs.
+Start Emacs, do C-h i to enter Info, then m Emacs RET to get to the
+Emacs manual, then m Bugs RET to get to the section on bugs.
+Or you can use the standalone Info program in a like manner.
+(Standalone Info is part of the Texinfo distribution, not part of the
+Emacs distribution.)
 
-(2) With Info.  Start Emacs, do C-h i to enter Info,
-then m Emacs RET to get to the Emacs manual, then m Bugs RET
-to get to the section on bugs.  Or use standalone Info in
-a like manner.  (Standalone Info is part of the Texinfo distribution,
-not part of the Emacs distribution.)
+Printed copies of the Emacs manual can be purchased from the Free
+Software Foundation's online store at <http://shop.fsf.org/>.
 
-(3) By hand.  Do
+If necessary, you can read the manual without an info program:
+
     cat info/emacs* | more "+/^File: emacs,  Node: Bugs,"
 
+
 Please first check the file etc/PROBLEMS (e.g. with C-h C-p in Emacs) to
 make sure it isn't a known issue.
--- a/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,11 @@
+2010-10-12  Glenn Morris  <rgm@gnu.org>
+
+	* BUGS, INSTALL.BZR, README: Updates.
+
+2010-10-08  Eli Zaretskii  <eliz@gnu.org>
+
+	* make-dist: Don't distribute src/buildobj.h.  (Bug#7167)
+
 2010-06-23  Glenn Morris  <rgm@gnu.org>
 
 	* info/dir: Start descriptions in column 32, per Texinfo convention.
--- a/INSTALL.BZR	Sun Aug 29 14:22:52 2010 +0900
+++ b/INSTALL.BZR	Wed Oct 13 22:40:51 2010 +0900
@@ -31,13 +31,9 @@
 subdirectories of lisp/, e.g. mh-e/ and calendar/) will need to be
 updated to reflect new autoloaded functions.  If you see errors (rather
 than warnings) about undefined lisp functions during compilation, that
-may be the reason.  Another symptom may be an error saying that
-"loaddefs.el" could not be found; this is due to a change in the way
-loaddefs.el was handled in version control, and should only happen
-once, for users that are updating old sources.  Finally, sometimes
-there can be build failures related to *loaddefs.el (e.g. "required
-feature `esh-groups' was not provided").  In that case, follow the
-instructions below.
+may be the reason.  Finally, sometimes there can be build failures
+related to *loaddefs.el (e.g. "required feature `esh-groups' was not
+provided").  In that case, follow the instructions below.
 
 To update loaddefs.el (and similar files), do:
 
@@ -53,10 +49,6 @@
 etc.) before "make bootstrap" or "make"; the rest of the procedure is
 applicable to those systems as well.
 
-Questions, requests, and bug reports about the Bazaar versions of Emacs
-should be sent to bug-gnu-emacs@gnu.org rather than gnu.emacs.help.
-Ideally, use M-x report-emacs-bug RET.
-
 Because the Bazaar version of Emacs is a work in progress, it will
 sometimes fail to build.  Please wait a day or so (and check the bug
 and development mailing list archives) before reporting such problems.
--- a/README	Sun Aug 29 14:22:52 2010 +0900
+++ b/README	Wed Oct 13 22:40:51 2010 +0900
@@ -65,16 +65,15 @@
             which can't be directly produced by your keyboard.
 `lib-src'   holds the source code for some utility programs for use by or
             with Emacs, like movemail and etags.
-`etc'       holds miscellaneous architecture-independent data files
-            Emacs uses, like the tutorial text and the Zippy the Pinhead
-            quote database.  The contents of the `lisp', `leim', `info',
-            `man', `lispref', and `lispintro' subdirectories are
-            architecture-independent too.
+`etc'       holds miscellaneous architecture-independent data files Emacs
+            uses, like the tutorial text and tool bar images.
+            The contents of the `lisp', `leim', `info', and `doc'
+            subdirectories are architecture-independent too.
 `info'      holds the Info documentation tree for Emacs.
 `doc/emacs' holds the source code for the Emacs Manual.  If you modify the
             manual sources, you will need the `makeinfo' program to produce
             an updated manual.  `makeinfo' is part of the GNU Texinfo
-            package; you need version 4.6 or later of Texinfo.
+            package; you need a suitably recent version of Texinfo.
 `doc/lispref'   holds the source code for the Emacs Lisp reference manual.
 `doc/lispintro' holds the source code for the Introduction to Programming
                 in Emacs Lisp manual.
@@ -85,10 +84,9 @@
             to building and running Emacs on Windows 9X/ME/NT/2000/XP.
 `test'      holds tests for various aspects of Emacs's functionality.
 
-   Building Emacs on non-Posix platforms requires to install tools
-that aren't part of the standard distribution of the OS.  The
-platform-specific README files and installation instructions should
-list the required tools.
+   Building Emacs on non-Posix platforms requires tools that aren't part
+of the standard distribution of the OS.  The platform-specific README
+files and installation instructions should list the required tools.
 
 
 This file is part of GNU Emacs.
--- a/admin/unidata/unidata-gen.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/admin/unidata/unidata-gen.el	Wed Oct 13 22:40:51 2010 +0900
@@ -95,7 +95,7 @@
     (with-temp-buffer
       ;; Insert a file of this format:
       ;;   (CHAR NAME CATEGORY ...)
-      ;; where CHAR is a charater code, the following elements are strings
+      ;; where CHAR is a character code, the following elements are strings
       ;; representing character properties.
       (insert-file-contents unidata-text-file)
       (goto-char (point-min))
--- a/configure	Sun Aug 29 14:22:52 2010 +0900
+++ b/configure	Wed Oct 13 22:40:51 2010 +0900
@@ -1,18 +1,22 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for emacs 23.2.
+# Generated by GNU Autoconf 2.67 for emacs 23.2.50.
+#
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -20,22 +24,14 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+fi
+
 
 as_nl='
 '
@@ -44,7 +40,13 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -55,7 +57,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -78,13 +80,6 @@
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -94,15 +89,15 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -114,12 +109,16 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -131,7 +130,248 @@
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -145,8 +385,12 @@
   as_basename=false
 fi
 
-
-# Name of the executable.
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -166,295 +410,19 @@
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-
-  if test $as_have_required = yes &&	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
-else
-  as_candidate_shells=
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  case $as_dir in
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
-	   done;;
-       esac
-done
-IFS=$as_save_IFS
-
-
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
-  break
-fi
-
-fi
-
-      done
-
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-	done
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell bug-autoconf@gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
-}
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
   sed -n '
     p
     /[$]LINENO/=
@@ -471,8 +439,7 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
@@ -482,29 +449,18 @@
   exit
 }
 
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -534,7 +490,7 @@
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -553,10 +509,10 @@
       if test -d "$1"; then
 	test -d "$1/.";
       else
-	case $1 in
+	case $1 in #(
 	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -570,11 +526,11 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -589,14 +545,14 @@
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME='emacs'
 PACKAGE_TARNAME='emacs'
-PACKAGE_VERSION='23.2'
-PACKAGE_STRING='emacs 23.2'
+PACKAGE_VERSION='23.2.50'
+PACKAGE_STRING='emacs 23.2.50'
 PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
 
 ac_unique_file="src/lisp.h"
 # Factoring default headers for most tests.
@@ -638,136 +594,137 @@
 ac_config_libobj_dir=src
 ac_header_list=
 ac_func_list=
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-MAINT
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-LN_S
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-RANLIB
-INSTALL_INFO
-GZIP_PROG
-MAKEINFO
+ac_subst_vars='LTLIBOBJS
+OTHER_FILES
+LIB_SRC_EXTRA_INSTALLABLES
+GNU_OBJC_CFLAGS
+GNUSTEP_SYSTEM_LIBRARIES
+GNUSTEP_SYSTEM_HEADERS
+GNUSTEP_MAKEFILES
+ns_appsrc
+ns_appresdir
+ns_appbindir
+ns_appdir
+opsysfile
+machfile
+X_TOOLKIT_TYPE
+C_SWITCH_X_SITE
+LD_SWITCH_X_SITE_AUX
+LD_SWITCH_X_SITE
+c_switch_machine
+c_switch_system
+gameuser
+gamedir
+bitmapdir
+archlibdir
+etcdir
+x_default_search_path
+lisppath
+locallisppath
+lispdir
+srcdir
+canonical
+configuration
+version
+GETOPTOBJS
+GETOPT_H
+GETLOADAVG_LIBS
+KMEM_GROUP
+NEED_SETGID
+LIBOBJS
+liblockfile
+ALLOCA
+FREETYPE_LIBS
+FREETYPE_CFLAGS
+M17N_FLT_LIBS
+M17N_FLT_CFLAGS
+LIBOTF_LIBS
+LIBOTF_CFLAGS
+XFT_LIBS
+XFT_CFLAGS
+FONTCONFIG_LIBS
+FONTCONFIG_CFLAGS
+GCONF_LIBS
+GCONF_CFLAGS
+DBUS_LIBS
+DBUS_CFLAGS
+GTK_LIBS
+GTK_CFLAGS
+RSVG_LIBS
+RSVG_CFLAGS
+HAVE_XSERVER
+XMKMF
+SET_MAKE
+CFLAGS_SOUND
+ALSA_LIBS
+ALSA_CFLAGS
+PKG_CONFIG
 LIBSOUND
-PKG_CONFIG
-ALSA_CFLAGS
-ALSA_LIBS
-CFLAGS_SOUND
-SET_MAKE
-XMKMF
-HAVE_XSERVER
-RSVG_CFLAGS
-RSVG_LIBS
-GTK_CFLAGS
-GTK_LIBS
-DBUS_CFLAGS
-DBUS_LIBS
-GCONF_CFLAGS
-GCONF_LIBS
-FONTCONFIG_CFLAGS
-FONTCONFIG_LIBS
-XFT_CFLAGS
-XFT_LIBS
-LIBOTF_CFLAGS
-LIBOTF_LIBS
-M17N_FLT_CFLAGS
-M17N_FLT_LIBS
-FREETYPE_CFLAGS
-FREETYPE_LIBS
-ALLOCA
-liblockfile
-LIBOBJS
-NEED_SETGID
-KMEM_GROUP
-GETLOADAVG_LIBS
-GETOPT_H
-GETOPTOBJS
-version
-configuration
-canonical
-srcdir
-lispdir
-locallisppath
-lisppath
-x_default_search_path
-etcdir
-archlibdir
-bitmapdir
-gamedir
-gameuser
-c_switch_system
-c_switch_machine
-LD_SWITCH_X_SITE
-LD_SWITCH_X_SITE_AUX
-C_SWITCH_X_SITE
-X_TOOLKIT_TYPE
-machfile
-opsysfile
-ns_appdir
-ns_appbindir
-ns_appresdir
-ns_appsrc
-GNUSTEP_MAKEFILES
-GNUSTEP_SYSTEM_HEADERS
-GNUSTEP_SYSTEM_LIBRARIES
-GNU_OBJC_CFLAGS
-LIB_SRC_EXTRA_INSTALLABLES
-OTHER_FILES
-LTLIBOBJS'
+MAKEINFO
+GZIP_PROG
+INSTALL_INFO
+RANLIB
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+LN_S
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+MAINT
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -881,8 +838,9 @@
   fi
 
   case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -927,8 +885,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -954,8 +911,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1159,8 +1115,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1176,8 +1131,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1207,17 +1161,17 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
@@ -1234,16 +1188,14 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
-   { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
@@ -1265,8 +1217,7 @@
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1280,8 +1231,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1296,11 +1247,9 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: Working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1339,13 +1288,11 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
-   { (exit 1); exit 1; }; }
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1371,7 +1318,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures emacs 23.2 to adapt to many kinds of systems.
+\`configure' configures emacs 23.2.50 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1385,7 +1332,7 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1445,7 +1392,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of emacs 23.2:";;
+     short | recursive ) echo "Configuration of emacs 23.2.50:";;
    esac
   cat <<\_ACEOF
 
@@ -1518,7 +1465,7 @@
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   XMKMF       Path to xmkmf, Makefile generator for X Window System
@@ -1526,6 +1473,7 @@
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
+Report bugs to the package provider.
 _ACEOF
 ac_status=$?
 fi
@@ -1588,22 +1536,559 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-emacs configure 23.2
-generated by GNU Autoconf 2.62
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+emacs configure 23.2.50
+generated by GNU Autoconf 2.67
+
+Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
   exit
 fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval "test \"\${$3+set}\"" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_header_preproc LINENO HEADER VAR
+# ----------------------------------------------
+# Tests whether HEADER is present, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_preproc ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_preproc
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval "test \"\${$4+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_member
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by emacs $as_me 23.2, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+It was created by emacs $as_me 23.2.50, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
 
@@ -1639,8 +2124,8 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  $as_echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
 IFS=$as_save_IFS
 
 } >&5
@@ -1677,9 +2162,9 @@
       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1695,13 +2180,13 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1713,11 +2198,9 @@
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -1726,13 +2209,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -1751,11 +2234,9 @@
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -1768,11 +2249,9 @@
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -1786,11 +2265,9 @@
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -1804,46 +2281,53 @@
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -1854,19 +2338,23 @@
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
-    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
@@ -1874,14 +2362,16 @@
     esac
   fi
 else
-  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
 $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
-ac_header_list="$ac_header_list sys/time.h"
-ac_header_list="$ac_header_list unistd.h"
-ac_func_list="$ac_func_list alarm"
+as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
+as_fn_append ac_header_list " sys/time.h"
+as_fn_append ac_func_list " alarm"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -1892,11 +2382,11 @@
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
@@ -1906,17 +2396,17 @@
 	ac_old_val_w=`echo x $ac_old_val`
 	ac_new_val_w=`echo x $ac_new_val`
 	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 	  ac_cache_corrupted=:
 	else
-	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
 	  eval $ac_var=\$ac_old_val
 	fi
-	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
@@ -1928,41 +2418,20 @@
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2001,39 +2470,33 @@
 
 
 # Check whether --with-pop was given.
-if test "${with_pop+set}" = set; then
+if test "${with_pop+set}" = set; then :
   withval=$with_pop;
 else
      with_pop=yes
 fi
 
 if test "$with_pop" = yes; then
-   cat >>confdefs.h <<\_ACEOF
-#define MAIL_USE_POP 1
-_ACEOF
-
-fi
-
+   $as_echo "#define MAIL_USE_POP 1" >>confdefs.h
+
+fi
 
 
 # Check whether --with-kerberos was given.
-if test "${with_kerberos+set}" = set; then
+if test "${with_kerberos+set}" = set; then :
   withval=$with_kerberos;
 else
       with_kerberos=no
 fi
 
 if test "$with_kerberos" != no; then
-   cat >>confdefs.h <<\_ACEOF
-#define KERBEROS 1
-_ACEOF
-
-fi
-
+   $as_echo "#define KERBEROS 1" >>confdefs.h
+
+fi
 
 
 # Check whether --with-kerberos5 was given.
-if test "${with_kerberos5+set}" = set; then
+if test "${with_kerberos5+set}" = set; then :
   withval=$with_kerberos5;
 else
       with_kerberos5=no
@@ -2042,21 +2505,17 @@
 if test "${with_kerberos5}" != no; then
   if test "${with_kerberos}" = no; then
     with_kerberos=yes
-    cat >>confdefs.h <<\_ACEOF
-#define KERBEROS 1
-_ACEOF
-
-  fi
-
-cat >>confdefs.h <<\_ACEOF
-#define KERBEROS5 1
-_ACEOF
+    $as_echo "#define KERBEROS 1" >>confdefs.h
+
+  fi
+
+$as_echo "#define KERBEROS5 1" >>confdefs.h
 
 fi
 
 
 # Check whether --with-hesiod was given.
-if test "${with_hesiod+set}" = set; then
+if test "${with_hesiod+set}" = set; then :
   withval=$with_hesiod;
 else
       with_hesiod=no
@@ -2064,15 +2523,13 @@
 
 if test "$with_hesiod" != no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HESIOD 1
-_ACEOF
+$as_echo "#define HESIOD 1" >>confdefs.h
 
 fi
 
 
 # Check whether --with-sound was given.
-if test "${with_sound+set}" = set; then
+if test "${with_sound+set}" = set; then :
   withval=$with_sound;
 else
      with_sound=yes
@@ -2081,7 +2538,7 @@
 
 
 # Check whether --with-sync-input was given.
-if test "${with_sync_input+set}" = set; then
+if test "${with_sync_input+set}" = set; then :
   withval=$with_sync_input;
 else
      with_sync_input=yes
@@ -2089,15 +2546,13 @@
 
 if test "$with_sync_input" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define SYNC_INPUT 1
-_ACEOF
+$as_echo "#define SYNC_INPUT 1" >>confdefs.h
 
 fi
 
 
 # Check whether --with-x-toolkit was given.
-if test "${with_x_toolkit+set}" = set; then
+if test "${with_x_toolkit+set}" = set; then :
   withval=$with_x_toolkit; 	  case "${withval}" in
 	    y | ye | yes )	val=gtk ;;
 	    n | no )		val=no  ;;
@@ -2106,13 +2561,9 @@
 	    m | mo | mot | moti | motif )	val=motif ;;
 	    g | gt | gtk  )	val=gtk ;;
 	    * )
-{ { $as_echo "$as_me:$LINENO: error: \`--with-x-toolkit=$withval' is invalid;
+as_fn_error $? "\`--with-x-toolkit=$withval' is invalid;
 this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
-\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&5
-$as_echo "$as_me: error: \`--with-x-toolkit=$withval' is invalid;
-this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
-\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&2;}
-   { (exit 1); exit 1; }; }
+\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5
 	    ;;
 	  esac
 	  with_x_toolkit=$val
@@ -2122,7 +2573,7 @@
 
 
 # Check whether --with-xpm was given.
-if test "${with_xpm+set}" = set; then
+if test "${with_xpm+set}" = set; then :
   withval=$with_xpm;
 else
      with_xpm=yes
@@ -2130,7 +2581,7 @@
 
 
 # Check whether --with-jpeg was given.
-if test "${with_jpeg+set}" = set; then
+if test "${with_jpeg+set}" = set; then :
   withval=$with_jpeg;
 else
      with_jpeg=yes
@@ -2138,7 +2589,7 @@
 
 
 # Check whether --with-tiff was given.
-if test "${with_tiff+set}" = set; then
+if test "${with_tiff+set}" = set; then :
   withval=$with_tiff;
 else
      with_tiff=yes
@@ -2146,7 +2597,7 @@
 
 
 # Check whether --with-gif was given.
-if test "${with_gif+set}" = set; then
+if test "${with_gif+set}" = set; then :
   withval=$with_gif;
 else
      with_gif=yes
@@ -2154,7 +2605,7 @@
 
 
 # Check whether --with-png was given.
-if test "${with_png+set}" = set; then
+if test "${with_png+set}" = set; then :
   withval=$with_png;
 else
      with_png=yes
@@ -2162,7 +2613,7 @@
 
 
 # Check whether --with-rsvg was given.
-if test "${with_rsvg+set}" = set; then
+if test "${with_rsvg+set}" = set; then :
   withval=$with_rsvg;
 else
      with_rsvg=yes
@@ -2171,7 +2622,7 @@
 
 
 # Check whether --with-xft was given.
-if test "${with_xft+set}" = set; then
+if test "${with_xft+set}" = set; then :
   withval=$with_xft;
 else
      with_xft=yes
@@ -2179,7 +2630,7 @@
 
 
 # Check whether --with-libotf was given.
-if test "${with_libotf+set}" = set; then
+if test "${with_libotf+set}" = set; then :
   withval=$with_libotf;
 else
      with_libotf=yes
@@ -2187,7 +2638,7 @@
 
 
 # Check whether --with-m17n-flt was given.
-if test "${with_m17n_flt+set}" = set; then
+if test "${with_m17n_flt+set}" = set; then :
   withval=$with_m17n_flt;
 else
      with_m17n_flt=yes
@@ -2196,7 +2647,7 @@
 
 
 # Check whether --with-toolkit-scroll-bars was given.
-if test "${with_toolkit_scroll_bars+set}" = set; then
+if test "${with_toolkit_scroll_bars+set}" = set; then :
   withval=$with_toolkit_scroll_bars;
 else
      with_toolkit_scroll_bars=yes
@@ -2204,7 +2655,7 @@
 
 
 # Check whether --with-xaw3d was given.
-if test "${with_xaw3d+set}" = set; then
+if test "${with_xaw3d+set}" = set; then :
   withval=$with_xaw3d;
 else
      with_xaw3d=yes
@@ -2212,7 +2663,7 @@
 
 
 # Check whether --with-xim was given.
-if test "${with_xim+set}" = set; then
+if test "${with_xim+set}" = set; then :
   withval=$with_xim;
 else
      with_xim=yes
@@ -2220,7 +2671,7 @@
 
 
 # Check whether --with-ns was given.
-if test "${with_ns+set}" = set; then
+if test "${with_ns+set}" = set; then :
   withval=$with_ns;
 else
       with_ns=no
@@ -2229,7 +2680,7 @@
 
 
 # Check whether --with-gpm was given.
-if test "${with_gpm+set}" = set; then
+if test "${with_gpm+set}" = set; then :
   withval=$with_gpm;
 else
      with_gpm=yes
@@ -2237,7 +2688,7 @@
 
 
 # Check whether --with-dbus was given.
-if test "${with_dbus+set}" = set; then
+if test "${with_dbus+set}" = set; then :
   withval=$with_dbus;
 else
      with_dbus=yes
@@ -2245,7 +2696,7 @@
 
 
 # Check whether --with-gconf was given.
-if test "${with_gconf+set}" = set; then
+if test "${with_gconf+set}" = set; then :
   withval=$with_gconf;
 else
      with_gconf=yes
@@ -2256,7 +2707,7 @@
 ## a suitable makeinfo, and can live without the manuals.
 
 # Check whether --with-makeinfo was given.
-if test "${with_makeinfo+set}" = set; then
+if test "${with_makeinfo+set}" = set; then :
   withval=$with_makeinfo;
 else
      with_makeinfo=yes
@@ -2265,29 +2716,23 @@
 
 
 # Check whether --with-gtk was given.
-if test "${with_gtk+set}" = set; then
-  withval=$with_gtk; { { $as_echo "$as_me:$LINENO: error: --with-gtk has been removed.  Use --with-x-toolkit to
-specify a toolkit." >&5
-$as_echo "$as_me: error: --with-gtk has been removed.  Use --with-x-toolkit to
-specify a toolkit." >&2;}
-   { (exit 1); exit 1; }; }
+if test "${with_gtk+set}" = set; then :
+  withval=$with_gtk; as_fn_error $? "--with-gtk has been removed.  Use --with-x-toolkit to
+specify a toolkit." "$LINENO" 5
 fi
 
 
 
 # Check whether --with-gcc was given.
-if test "${with_gcc+set}" = set; then
-  withval=$with_gcc; { { $as_echo "$as_me:$LINENO: error: --with-gcc has been removed.  Set the \`CC' environment
-variable to specify a compiler." >&5
-$as_echo "$as_me: error: --with-gcc has been removed.  Set the \`CC' environment
-variable to specify a compiler." >&2;}
-   { (exit 1); exit 1; }; }
+if test "${with_gcc+set}" = set; then :
+  withval=$with_gcc; as_fn_error $? "--with-gcc has been removed.  Set the \`CC' environment
+variable to specify a compiler." "$LINENO" 5
 fi
 
 
 
 # Check whether --with-pkg-config-prog was given.
-if test "${with_pkg_config_prog+set}" = set; then
+if test "${with_pkg_config_prog+set}" = set; then :
   withval=$with_pkg_config_prog;
 fi
 
@@ -2299,7 +2744,7 @@
 
 
 # Check whether --with-gnustep-conf was given.
-if test "${with_gnustep_conf+set}" = set; then
+if test "${with_gnustep_conf+set}" = set; then :
   withval=$with_gnustep_conf;
 fi
 
@@ -2309,7 +2754,7 @@
      GNUSTEP_CONFIG_FILE=/etc/GNUstep/GNUstep.conf
 
 # Check whether --enable-ns-self-contained was given.
-if test "${enable_ns_self_contained+set}" = set; then
+if test "${enable_ns_self_contained+set}" = set; then :
   enableval=$enable_ns_self_contained; EN_NS_SELF_CONTAINED=$enableval
 else
   EN_NS_SELF_CONTAINED=yes
@@ -2317,7 +2762,7 @@
 
 
 # Check whether --enable-asserts was given.
-if test "${enable_asserts+set}" = set; then
+if test "${enable_asserts+set}" = set; then :
   enableval=$enable_asserts; USE_XASSERTS=$enableval
 else
   USE_XASSERTS=no
@@ -2325,7 +2770,7 @@
 
 
 # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
+if test "${enable_maintainer_mode+set}" = set; then :
   enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
 else
   USE_MAINTAINER_MODE=no
@@ -2339,7 +2784,7 @@
 
 
 # Check whether --enable-locallisppath was given.
-if test "${enable_locallisppath+set}" = set; then
+if test "${enable_locallisppath+set}" = set; then :
   enableval=$enable_locallisppath; if test "${enableval}" = "no"; then
   locallisppath=
 elif test "${enableval}" != "yes"; then
@@ -2349,7 +2794,7 @@
 
 
 # Check whether --enable-checking was given.
-if test "${enable_checking+set}" = set; then
+if test "${enable_checking+set}" = set; then :
   enableval=$enable_checking; ac_checking_flags="${enableval}"
 fi
 
@@ -2377,58 +2822,44 @@
 	stringfreelist) ac_gc_check_string_free_list=1 ;;
 	xmallocoverrun)	ac_xmalloc_overrun=1 ;;
 	conslist)	ac_gc_check_cons_list=1 ;;
-	*)	{ { $as_echo "$as_me:$LINENO: error: unknown check category $check" >&5
-$as_echo "$as_me: error: unknown check category $check" >&2;}
-   { (exit 1); exit 1; }; } ;;
+	*)	as_fn_error $? "unknown check category $check" "$LINENO" 5 ;;
 	esac
 done
 IFS="$ac_save_IFS"
 
 if test x$ac_enable_checking != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ENABLE_CHECKING 1
-_ACEOF
+$as_echo "#define ENABLE_CHECKING 1" >>confdefs.h
 
 fi
 if test x$ac_gc_check_stringbytes != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GC_CHECK_STRING_BYTES 1
-_ACEOF
+$as_echo "#define GC_CHECK_STRING_BYTES 1" >>confdefs.h
 
 fi
 if test x$ac_gc_check_stringoverrun != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GC_CHECK_STRING_OVERRUN 1
-_ACEOF
+$as_echo "#define GC_CHECK_STRING_OVERRUN 1" >>confdefs.h
 
 fi
 if test x$ac_gc_check_string_free_list != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GC_CHECK_STRING_FREE_LIST 1
-_ACEOF
+$as_echo "#define GC_CHECK_STRING_FREE_LIST 1" >>confdefs.h
 
 fi
 if test x$ac_xmalloc_overrun != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define XMALLOC_OVERRUN_CHECK 1
-_ACEOF
+$as_echo "#define XMALLOC_OVERRUN_CHECK 1" >>confdefs.h
 
 fi
 if test x$ac_gc_check_cons_list != x ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GC_CHECK_CONS_LIST 1
-_ACEOF
+$as_echo "#define GC_CHECK_CONS_LIST 1" >>confdefs.h
 
 fi
 
 # Check whether --enable-profiling was given.
-if test "${enable_profiling+set}" = set; then
+if test "${enable_profiling+set}" = set; then :
   enableval=$enable_profiling; ac_enable_profiling="${enableval}"
 fi
 
@@ -2441,7 +2872,7 @@
 fi
 
 # Check whether --enable-autodepend was given.
-if test "${enable_autodepend+set}" = set; then
+if test "${enable_autodepend+set}" = set; then :
   enableval=$enable_autodepend; ac_enable_autodepend="${enableval}"
 else
   ac_enable_autodepend=yes
@@ -2475,7 +2906,7 @@
 #### Check if the source directory already has a configured system in it.
 if test `pwd` != `(cd ${srcdir} && pwd)` \
    && test -f "${srcdir}/src/config.h" ; then
-  { $as_echo "$as_me:$LINENO: WARNING: The directory tree \`${srcdir}' is being used
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The directory tree \`${srcdir}' is being used
    as a build directory right now; it has been configured in its own
    right.  To configure in another directory as well, you MUST
    use GNU make.  If you do not have GNU make, then you must
@@ -2511,9 +2942,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -2527,35 +2956,27 @@
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
-   { (exit 1); exit 1; }; }
-
-{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then
+if test "${ac_cv_build+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-$as_echo "$as_me: error: invalid value of canonical build" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -2571,28 +2992,24 @@
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then
+if test "${ac_cv_host+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-$as_echo "$as_me: error: invalid value of canonical host" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -2672,9 +3089,7 @@
     opsys=netbsd
     if test -f /usr/lib/crti.o; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CRTIN /**/
-_ACEOF
+$as_echo "#define HAVE_CRTIN /**/" >>confdefs.h
 
    fi
 
@@ -2940,11 +3355,8 @@
 
 
 if test $unported = yes; then
-  { { $as_echo "$as_me:$LINENO: error: Emacs hasn't been ported to \`${canonical}' systems.
-Check \`etc/MACHINES' for recognized configuration names." >&5
-$as_echo "$as_me: error: Emacs hasn't been ported to \`${canonical}' systems.
-Check \`etc/MACHINES' for recognized configuration names." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "Emacs hasn't been ported to \`${canonical}' systems.
+Check \`etc/MACHINES' for recognized configuration names." "$LINENO" 5
 fi
 
 machfile="m/${machine}.h"
@@ -2965,9 +3377,9 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2978,24 +3390,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3005,9 +3417,9 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3018,24 +3430,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3044,12 +3456,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -3062,9 +3470,9 @@
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3075,24 +3483,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3102,9 +3510,9 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3116,18 +3524,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -3146,10 +3554,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3161,9 +3569,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3174,24 +3582,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3205,9 +3613,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3218,24 +3626,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3248,12 +3656,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -3263,55 +3667,37 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3327,8 +3713,8 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -3344,17 +3730,17 @@
 done
 rm -f $ac_rmfiles
 
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -3371,7 +3757,7 @@
 	# certainly right.
 	break;;
     *.* )
-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -3390,80 +3776,41 @@
 else
   ac_file=''
 fi
-
-{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-if test -z "$ac_file"; then
-  $as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-fi
-
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
-if { (ac_try="$ac_link"
+if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -3478,30 +3825,83 @@
   esac
 done
 else
-  { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3513,17 +3913,17 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
@@ -3536,29 +3936,23 @@
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3572,37 +3966,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
-fi
-
+  ac_compiler_gnu=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GCC=yes
@@ -3611,145 +3984,68 @@
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_c_werror_flag=$ac_save_c_werror_flag
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
 	 CFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
 $as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -3766,18 +4062,14 @@
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
@@ -3834,32 +4126,9 @@
 	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_c89=$ac_arg
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -3870,17 +4139,19 @@
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
 $as_echo "none needed" >&6; } ;;
   xno)
-    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
 $as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
-
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -3898,17 +4169,13 @@
 ## using a Sun compiler, which needs -Xs to prevent whitespace.
 if test x"$GCC" != xyes && test x"$emacs_check_sunpro_c" = xyes && \
  test x"$CPP" = x; then
-  { $as_echo "$as_me:$LINENO: checking whether we are using a Sun C compiler" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using a Sun C compiler" >&5
 $as_echo_n "checking whether we are using a Sun C compiler... " >&6; }
 
-if test "${emacs_cv_sunpro_c+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_sunpro_c+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -3922,41 +4189,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_sunpro_c=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_sunpro_c=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-
-  { $as_echo "$as_me:$LINENO: result: $emacs_cv_sunpro_c" >&5
+  emacs_cv_sunpro_c=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_sunpro_c" >&5
 $as_echo "$emacs_cv_sunpro_c" >&6; }
 
   if test x"$emacs_cv_sunpro_c" = xyes; then
@@ -3996,14 +4238,14 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4018,11 +4260,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -4031,78 +4269,34 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -4114,7 +4308,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -4125,11 +4319,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -4138,85 +4328,40 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -4226,9 +4371,9 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
+if test "${ac_cv_path_GREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4239,7 +4384,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in grep ggrep; do
+    for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
@@ -4259,7 +4404,7 @@
     $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_GREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_GREP="$ac_path_GREP"
@@ -4274,26 +4419,24 @@
       $ac_path_GREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
 $as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
+if test "${ac_cv_path_EGREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4307,7 +4450,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in egrep; do
+    for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
@@ -4327,7 +4470,7 @@
     $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
@@ -4342,12 +4485,10 @@
       $ac_path_EGREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -4355,21 +4496,17 @@
 
    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
 $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4384,48 +4521,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
-fi
-
+  ac_cv_header_stdc=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -4435,18 +4547,14 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -4456,14 +4564,10 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -4490,117 +4594,33 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
 $as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -4611,134 +4631,8 @@
 
 
 
-  if test "${ac_cv_header_minix_config_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
-$as_echo_n "checking for minix/config.h... " >&6; }
-if test "${ac_cv_header_minix_config_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-$as_echo "$ac_cv_header_minix_config_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5
-$as_echo_n "checking minix/config.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <minix/config.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5
-$as_echo_n "checking minix/config.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <minix/config.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5
-$as_echo_n "checking for minix/config.h... " >&6; }
-if test "${ac_cv_header_minix_config_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_minix_config_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-$as_echo "$ac_cv_header_minix_config_h" >&6; }
-
-fi
-if test $ac_cv_header_minix_config_h = yes; then
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = x""yes; then :
   MINIX=yes
 else
   MINIX=
@@ -4747,34 +4641,23 @@
 
   if test "$MINIX" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define _POSIX_SOURCE 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define _POSIX_1_SOURCE 2
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define _MINIX 1
-_ACEOF
-
-  fi
-
-
-
-  { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #	  define __EXTENSIONS__ 1
@@ -4787,166 +4670,85 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_safe_to_define___extensions__=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_safe_to_define___extensions__=no
-fi
-
+  ac_cv_safe_to_define___extensions__=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
   test $ac_cv_safe_to_define___extensions__ = yes &&
-    cat >>confdefs.h <<\_ACEOF
-#define __EXTENSIONS__ 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define _ALL_SOURCE 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define _GNU_SOURCE 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define _POSIX_PTHREAD_SEMANTICS 1
-_ACEOF
-
-  cat >>confdefs.h <<\_ACEOF
-#define _TANDEM_SOURCE 1
-_ACEOF
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
 
 
 
 ### Use -Wno-pointer-sign if the compiler supports it
-{ $as_echo "$as_me:$LINENO: checking whether gcc understands -Wno-pointer-sign" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -Wno-pointer-sign" >&5
 $as_echo_n "checking whether gcc understands -Wno-pointer-sign... " >&6; }
 SAVE_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wno-pointer-sign"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   has_option=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	has_option=no
-fi
-
+  has_option=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 if test $has_option = yes; then
    C_WARNINGS_SWITCH="-Wno-pointer-sign $C_WARNINGS_SWITCH"
 fi
-{ $as_echo "$as_me:$LINENO: result: $has_option" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5
 $as_echo "$has_option" >&6; }
 CFLAGS="$SAVE_CFLAGS"
 unset has_option
 unset SAVE_CFLAGS
 
 ### Use -Wdeclaration-after-statement if the compiler supports it
-{ $as_echo "$as_me:$LINENO: checking whether gcc understands -Wdeclaration-after-statement" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -Wdeclaration-after-statement" >&5
 $as_echo_n "checking whether gcc understands -Wdeclaration-after-statement... " >&6; }
 SAVE_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
   has_option=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	has_option=no
-fi
-
+  has_option=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 if test $has_option = yes; then
    C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
 fi
-{ $as_echo "$as_me:$LINENO: result: $has_option" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5
 $as_echo "$has_option" >&6; }
 CFLAGS="$SAVE_CFLAGS"
 unset has_option
@@ -4954,14 +4756,14 @@
 
 #### Some other nice autoconf tests.
 
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
 $as_echo "no, using $LN_S" >&6; }
 fi
 
@@ -4970,14 +4772,14 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4992,11 +4794,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -5005,78 +4803,34 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -5088,7 +4842,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -5099,11 +4853,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -5112,85 +4862,40 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5213,10 +4918,10 @@
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 # Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
+if test "${ac_cv_path_install+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -5224,11 +4929,11 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -5265,7 +4970,7 @@
     ;;
 esac
 
-done
+  done
 IFS=$as_save_IFS
 
 rm -rf conftest.one conftest.two conftest.dir
@@ -5281,7 +4986,7 @@
     INSTALL=$ac_install_sh
   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
 $as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -5296,9 +5001,9 @@
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -5309,24 +5014,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
 $as_echo "$RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5336,9 +5041,9 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -5349,24 +5054,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
 $as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5375,12 +5080,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -5392,9 +5093,9 @@
 fi
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
+if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5407,14 +5108,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -5422,19 +5123,19 @@
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
 if test -n "$INSTALL_INFO"; then
-  { $as_echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_INFO" >&5
 $as_echo "$INSTALL_INFO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
+if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5447,14 +5148,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -5462,19 +5163,19 @@
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
 if test -n "$INSTALL_INFO"; then
-  { $as_echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_INFO" >&5
 $as_echo "$INSTALL_INFO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
+if test "${ac_cv_path_INSTALL_INFO+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $INSTALL_INFO in
@@ -5487,14 +5188,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_INSTALL_INFO" && ac_cv_path_INSTALL_INFO=":"
@@ -5503,19 +5204,19 @@
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
 if test -n "$INSTALL_INFO"; then
-  { $as_echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL_INFO" >&5
 $as_echo "$INSTALL_INFO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GZIP_PROG+set}" = set; then
+if test "${ac_cv_path_GZIP_PROG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $GZIP_PROG in
@@ -5528,14 +5229,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GZIP_PROG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -5543,10 +5244,10 @@
 fi
 GZIP_PROG=$ac_cv_path_GZIP_PROG
 if test -n "$GZIP_PROG"; then
-  { $as_echo "$as_me:$LINENO: result: $GZIP_PROG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP_PROG" >&5
 $as_echo "$GZIP_PROG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5556,9 +5257,9 @@
 ## Need makeinfo >= 4.6 (?) to build the manuals.
 # Extract the first word of "makeinfo", so it can be a program name with args.
 set dummy makeinfo; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MAKEINFO+set}" = set; then
+if test "${ac_cv_path_MAKEINFO+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAKEINFO in
@@ -5571,14 +5272,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="no"
@@ -5587,10 +5288,10 @@
 fi
 MAKEINFO=$ac_cv_path_MAKEINFO
 if test -n "$MAKEINFO"; then
-  { $as_echo "$as_me:$LINENO: result: $MAKEINFO" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5
 $as_echo "$MAKEINFO" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5613,15 +5314,10 @@
   if test "x${with_makeinfo}" = "xno"; then
     MAKEINFO=off
   elif ! test -e $srcdir/info/emacs; then
-    { { $as_echo "$as_me:$LINENO: error: You do not seem to have makeinfo >= 4.6, and your
+    as_fn_error $? "You do not seem to have makeinfo >= 4.6, and your
 source tree does not seem to have pre-built manuals in the \`info' directory.
 Either install a suitable version of makeinfo, or re-run configure
-with the \`--without-makeinfo' option to build without the manuals. " >&5
-$as_echo "$as_me: error: You do not seem to have makeinfo >= 4.6, and your
-source tree does not seem to have pre-built manuals in the \`info' directory.
-Either install a suitable version of makeinfo, or re-run configure
-with the \`--without-makeinfo' option to build without the manuals. " >&2;}
-   { (exit 1); exit 1; }; }
+with the \`--without-makeinfo' option to build without the manuals. " "$LINENO" 5
   fi
 fi
 
@@ -5644,50 +5340,26 @@
   LDFLAGS="$LDFLAGS -znocombreloc"
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for -znocombreloc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -znocombreloc" >&5
 $as_echo_n "checking for -znocombreloc... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 main(){return 0;}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	LDFLAGS=$late_LDFLAGS
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  LDFLAGS=$late_LDFLAGS
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 #### Extract some information from the operating system and machine files.
 
-{ $as_echo "$as_me:$LINENO: checking the machine- and system-dependent files to find out
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the machine- and system-dependent files to find out
  - which libraries the lib-src programs will want, and
  - whether the GNU malloc routines are usable..." >&5
 $as_echo "$as_me: checking the machine- and system-dependent files to find out
@@ -5835,15 +5507,15 @@
 
 
 # Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then
+if test "${enable_largefile+set}" = set; then :
   enableval=$enable_largefile;
 fi
 
 if test "$enable_largefile" != no; then
 
-  { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_largefile_CC=no
@@ -5852,11 +5524,7 @@
        while :; do
 	 # IRIX 6.2 and later do not support large files by default,
 	 # so use the C compiler's -n32 option if that helps.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -5875,60 +5543,14 @@
   return 0;
 }
 _ACEOF
-	 rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+	 if ac_fn_c_try_compile "$LINENO"; then :
   break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext
 	 CC="$CC -n32"
-	 rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+	 if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_largefile_CC=' -n32'; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext
 	 break
        done
@@ -5936,23 +5558,19 @@
        rm -f conftest.$ac_ext
     fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -5971,38 +5589,11 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_file_offset_bits=no; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
@@ -6022,38 +5613,15 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_file_offset_bits=64; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_cv_sys_file_offset_bits=unknown
   break
 done
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
 case $ac_cv_sys_file_offset_bits in #(
   no | unknown) ;;
@@ -6065,17 +5633,13 @@
 esac
 rm -rf conftest*
   if test $ac_cv_sys_file_offset_bits = unknown; then
-    { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then
+if test "${ac_cv_sys_large_files+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -6094,38 +5658,11 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_large_files=no; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _LARGE_FILES 1
 #include <sys/types.h>
@@ -6145,38 +5682,15 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_sys_large_files=1; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_cv_sys_large_files=unknown
   break
 done
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
 $as_echo "$ac_cv_sys_large_files" >&6; }
 case $ac_cv_sys_large_files in #(
   no | unknown) ;;
@@ -6200,9 +5714,7 @@
   x86_64-*-linux-gnu* | s390x-*-linux-gnu* )
     if test -e /usr/lib64/crtn.o; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIB64_DIR 1
-_ACEOF
+$as_echo "#define HAVE_LIB64_DIR 1" >>confdefs.h
 
 fi
 esac
@@ -6212,145 +5724,11 @@
 
 if test "${with_sound}" != "no"; then
   # Sound support for GNU/Linux and the free BSDs.
-
-
-
-for ac_header in machine/soundcard.h sys/soundcard.h soundcard.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_header in machine/soundcard.h sys/soundcard.h soundcard.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -6360,18 +5738,14 @@
 done
 
   # Emulation library used on NetBSD.
-  { $as_echo "$as_me:$LINENO: checking for _oss_ioctl in -lossaudio" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
 $as_echo_n "checking for _oss_ioctl in -lossaudio... " >&6; }
-if test "${ac_cv_lib_ossaudio__oss_ioctl+set}" = set; then
+if test "${ac_cv_lib_ossaudio__oss_ioctl+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lossaudio  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -6389,43 +5763,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_ossaudio__oss_ioctl=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ossaudio__oss_ioctl=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_ossaudio__oss_ioctl=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
 $as_echo "$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
-if test $ac_cv_lib_ossaudio__oss_ioctl = yes; then
+if test "x$ac_cv_lib_ossaudio__oss_ioctl" = x""yes; then :
   LIBSOUND=-lossaudio
 else
   LIBSOUND=
@@ -6440,9 +5789,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6455,14 +5804,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -6471,10 +5820,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6485,27 +5834,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for $ALSA_MODULES" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ALSA_MODULES" >&5
 $as_echo_n "checking for $ALSA_MODULES... " >&6; }
 
         if $PKG_CONFIG --exists "$ALSA_MODULES" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking ALSA_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking ALSA_CFLAGS" >&5
 $as_echo_n "checking ALSA_CFLAGS... " >&6; }
             ALSA_CFLAGS=`$PKG_CONFIG --cflags "$ALSA_MODULES"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5
 $as_echo "$ALSA_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking ALSA_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking ALSA_LIBS" >&5
 $as_echo_n "checking ALSA_LIBS... " >&6; }
             ALSA_LIBS=`$PKG_CONFIG --libs "$ALSA_MODULES"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
 $as_echo "$ALSA_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             ALSA_CFLAGS=""
             ALSA_LIBS=""
@@ -6534,11 +5883,7 @@
     SAVE_LDFLAGS="$LDFLAGS"
     CFLAGS="$ALSA_CFLAGS $CFLAGS"
     LDFLAGS="$ALSA_LIBS $LDFLAGS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <asoundlib.h>
 int
@@ -6549,39 +5894,14 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_alsa_normal=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_alsa_normal=no
-fi
-
+  emacs_alsa_normal=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     if test "$emacs_alsa_normal" != yes; then
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <alsa/asoundlib.h>
 int
@@ -6592,37 +5912,14 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_alsa_subdir=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_alsa_subdir=no
-fi
-
+  emacs_alsa_subdir=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
       if test "$emacs_alsa_subdir" != yes; then
-        { { $as_echo "$as_me:$LINENO: error: pkg-config found alsa, but it does not compile.  See config.log for error messages." >&5
-$as_echo "$as_me: error: pkg-config found alsa, but it does not compile.  See config.log for error messages." >&2;}
-   { (exit 1); exit 1; }; }
+        as_fn_error $? "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
       fi
       ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
     fi
@@ -6632,180 +5929,21 @@
     LIBSOUND="$LIBSOUND $ALSA_LIBS"
     CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALSA 1
-_ACEOF
-
-  fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+$as_echo "#define HAVE_ALSA 1" >>confdefs.h
+
+  fi
+
+fi
 
 for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
   termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
   sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
   sys/utsname.h pwd.h utmp.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -6815,13 +5953,9 @@
 done
 
 
-{ $as_echo "$as_me:$LINENO: checking if personality LINUX32 can be set" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if personality LINUX32 can be set" >&5
 $as_echo_n "checking if personality LINUX32 can be set... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/personality.h>
 int
@@ -6832,112 +5966,39 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_personality_linux32=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_personality_linux32=no
-fi
-
+  emacs_cv_personality_linux32=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_personality_linux32" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_personality_linux32" >&5
 $as_echo "$emacs_cv_personality_linux32" >&6; }
 
 if test $emacs_cv_personality_linux32 = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PERSONALITY_LINUX32 1
-_ACEOF
-
-fi
-
+$as_echo "#define HAVE_PERSONALITY_LINUX32 1" >>confdefs.h
+
+fi
 
 for ac_header in term.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  eval "$as_ac_Header=no"
-fi
-
-rm -f conftest.err conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_preproc "$LINENO" "term.h" "ac_cv_header_term_h"
+if test "x$ac_cv_header_term_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+#define HAVE_TERM_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -6952,48 +6013,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
-fi
-
+  ac_cv_header_stdc=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -7003,18 +6039,14 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -7024,14 +6056,10 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -7058,64 +6086,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
 $as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_header_time+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/time.h>
@@ -7130,202 +6125,57 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_time=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_time=no
-fi
-
+  ac_cv_header_time=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
 $as_echo "$ac_cv_header_time" >&6; }
 if test $ac_cv_header_time = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
-$as_echo_n "checking whether sys_siglist is declared... " >&6; }
-if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-#ifndef sys_siglist
-  (void) sys_siglist;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_sys_siglist=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_sys_siglist=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
-$as_echo "$ac_cv_have_decl_sys_siglist" >&6; }
-if test $ac_cv_have_decl_sys_siglist = yes; then
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "$ac_includes_default"
+if test "x$ac_cv_have_decl_sys_siglist" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SYS_SIGLIST 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SYS_SIGLIST 0
-_ACEOF
-
-
-fi
-
+#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
+_ACEOF
 
 if test $ac_cv_have_decl_sys_siglist != yes; then
   # For Tru64, at least:
-  { $as_echo "$as_me:$LINENO: checking whether __sys_siglist is declared" >&5
-$as_echo_n "checking whether __sys_siglist is declared... " >&6; }
-if test "${ac_cv_have_decl___sys_siglist+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-#ifndef __sys_siglist
-  (void) __sys_siglist;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl___sys_siglist=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl___sys_siglist=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___sys_siglist" >&5
-$as_echo "$ac_cv_have_decl___sys_siglist" >&6; }
-if test $ac_cv_have_decl___sys_siglist = yes; then
+  ac_fn_c_check_decl "$LINENO" "__sys_siglist" "ac_cv_have_decl___sys_siglist" "$ac_includes_default"
+if test "x$ac_cv_have_decl___sys_siglist" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL___SYS_SIGLIST 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL___SYS_SIGLIST 0
-_ACEOF
-
-
-fi
-
+#define HAVE_DECL___SYS_SIGLIST $ac_have_decl
+_ACEOF
 
   if test $ac_cv_have_decl___sys_siglist = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define sys_siglist __sys_siglist
-_ACEOF
-
-  fi
-fi
-{ $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo "#define sys_siglist __sys_siglist" >>confdefs.h
+
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_header_sys_wait_h+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -7346,55 +6196,28 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_sys_wait_h=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_sys_wait_h=no
-fi
-
+  ac_cv_header_sys_wait_h=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
 $as_echo "$ac_cv_header_sys_wait_h" >&6; }
 if test $ac_cv_header_sys_wait_h = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_WAIT_H 1
-_ACEOF
-
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for struct utimbuf" >&5
+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5
 $as_echo_n "checking for struct utimbuf... " >&6; }
-if test "${emacs_cv_struct_utimbuf+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_struct_utimbuf+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -7417,54 +6240,27 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_struct_utimbuf=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_struct_utimbuf=no
-fi
-
+  emacs_cv_struct_utimbuf=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_struct_utimbuf" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_struct_utimbuf" >&5
 $as_echo "$emacs_cv_struct_utimbuf" >&6; }
 if test $emacs_cv_struct_utimbuf = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_UTIMBUF 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+$as_echo "#define HAVE_STRUCT_UTIMBUF 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
 $as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_type_signal+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <signal.h>
@@ -7477,35 +6273,14 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_type_signal=int
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_signal=void
-fi
-
+  ac_cv_type_signal=void
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
 $as_echo "$ac_cv_type_signal" >&6; }
 
 cat >>confdefs.h <<_ACEOF
@@ -7514,16 +6289,12 @@
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for speed_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for speed_t" >&5
 $as_echo_n "checking for speed_t... " >&6; }
-if test "${emacs_cv_speed_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_speed_t+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <termios.h>
 int
@@ -7534,54 +6305,27 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_speed_t=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_speed_t=no
-fi
-
+  emacs_cv_speed_t=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_speed_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_speed_t" >&5
 $as_echo "$emacs_cv_speed_t" >&6; }
 if test $emacs_cv_speed_t = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SPEED_T 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for struct timeval" >&5
+$as_echo "#define HAVE_SPEED_T 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
 $as_echo_n "checking for struct timeval... " >&6; }
-if test "${emacs_cv_struct_timeval+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_struct_timeval+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -7601,55 +6345,28 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_struct_timeval=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_struct_timeval=no
-fi
-
+  emacs_cv_struct_timeval=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_struct_timeval" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_struct_timeval" >&5
 $as_echo "$emacs_cv_struct_timeval" >&6; }
 HAVE_TIMEVAL=$emacs_cv_struct_timeval
 if test $emacs_cv_struct_timeval = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TIMEVAL 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for struct exception" >&5
+$as_echo "#define HAVE_TIMEVAL 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct exception" >&5
 $as_echo_n "checking for struct exception... " >&6; }
-if test "${emacs_cv_struct_exception+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_struct_exception+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
 int
@@ -7660,265 +6377,57 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_struct_exception=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_struct_exception=no
-fi
-
+  emacs_cv_struct_exception=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_struct_exception" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_struct_exception" >&5
 $as_echo "$emacs_cv_struct_exception" >&6; }
 HAVE_EXCEPTION=$emacs_cv_struct_exception
 if test $emacs_cv_struct_exception != yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define NO_MATHERR 1
-_ACEOF
-
-fi
-
+$as_echo "#define NO_MATHERR 1" >>confdefs.h
+
+fi
 
 for ac_header in sys/socket.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_socket_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
+#define HAVE_SYS_SOCKET_H 1
+_ACEOF
+
+fi
+
+done
 
 for ac_header in net/if.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+do :
+  ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+"
+if test "x$ac_cv_header_net_if_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+#define HAVE_NET_IF_H 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_struct_tm+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <time.h>
@@ -7933,146 +6442,26 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_struct_tm=time.h
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_struct_tm=sys/time.h
-fi
-
+  ac_cv_struct_tm=sys/time.h
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
 $as_echo "$ac_cv_struct_tm" >&6; }
 if test $ac_cv_struct_tm = sys/time.h; then
 
-cat >>confdefs.h <<\_ACEOF
-#define TM_IN_SYS_TIME 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
-$as_echo_n "checking for struct tm.tm_zone... " >&6; }
-if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <sys/types.h>
 #include <$ac_cv_struct_tm>
 
-
-int
-main ()
-{
-static struct tm ac_aggr;
-if (ac_aggr.tm_zone)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_tm_tm_zone=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <$ac_cv_struct_tm>
-
-
-int
-main ()
-{
-static struct tm ac_aggr;
-if (sizeof ac_aggr.tm_zone)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_tm_tm_zone=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_tm_tm_zone=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
-$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; }
-if test $ac_cv_member_struct_tm_tm_zone = yes; then
+"
+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TM_TM_ZONE 1
@@ -8083,91 +6472,27 @@
 
 if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TM_ZONE 1
-_ACEOF
-
-else
-  { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5
-$as_echo_n "checking whether tzname is declared... " >&6; }
-if test "${ac_cv_have_decl_tzname+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <time.h>
-
-int
-main ()
-{
-#ifndef tzname
-  (void) tzname;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_tzname=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_tzname=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
-$as_echo "$ac_cv_have_decl_tzname" >&6; }
-if test $ac_cv_have_decl_tzname = yes; then
+$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h
+
+else
+  ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h>
+"
+if test "x$ac_cv_have_decl_tzname" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TZNAME 1
-_ACEOF
-
-
-else
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TZNAME 0
-_ACEOF
-
-
-fi
-
-
-  { $as_echo "$as_me:$LINENO: checking for tzname" >&5
+#define HAVE_DECL_TZNAME $ac_have_decl
+_ACEOF
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
 $as_echo_n "checking for tzname... " >&6; }
-if test "${ac_cv_var_tzname+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_var_tzname+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
 #if !HAVE_DECL_TZNAME
@@ -8182,733 +6507,104 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_var_tzname=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_var_tzname=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+  ac_cv_var_tzname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5
 $as_echo "$ac_cv_var_tzname" >&6; }
   if test $ac_cv_var_tzname = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TZNAME 1
-_ACEOF
-
-  fi
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5
-$as_echo_n "checking for struct tm.tm_gmtoff... " >&6; }
-if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <time.h>
-
-int
-main ()
-{
-static struct tm ac_aggr;
-if (ac_aggr.tm_gmtoff)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_tm_tm_gmtoff=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <time.h>
-
-int
-main ()
-{
-static struct tm ac_aggr;
-if (sizeof ac_aggr.tm_gmtoff)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_tm_tm_gmtoff=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_tm_tm_gmtoff=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5
-$as_echo "$ac_cv_member_struct_tm_tm_gmtoff" >&6; }
-if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TM_GMTOFF 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for struct ifreq.ifr_flags" >&5
-$as_echo_n "checking for struct ifreq.ifr_flags... " >&6; }
-if test "${ac_cv_member_struct_ifreq_ifr_flags+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+$as_echo "#define HAVE_TZNAME 1" >>confdefs.h
+
+  fi
+fi
+
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then :
+
+$as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_flags" "ac_cv_member_struct_ifreq_ifr_flags" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (ac_aggr.ifr_flags)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_flags=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_flags" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFREQ_IFR_FLAGS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_hwaddr" "ac_cv_member_struct_ifreq_ifr_hwaddr" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (sizeof ac_aggr.ifr_flags)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_flags=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_ifreq_ifr_flags=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_flags" >&5
-$as_echo "$ac_cv_member_struct_ifreq_ifr_flags" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_flags = yes; then
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IFREQ_IFR_FLAGS 1
-_ACEOF
-
-
-fi
-{ $as_echo "$as_me:$LINENO: checking for struct ifreq.ifr_hwaddr" >&5
-$as_echo_n "checking for struct ifreq.ifr_hwaddr... " >&6; }
-if test "${ac_cv_member_struct_ifreq_ifr_hwaddr+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (ac_aggr.ifr_hwaddr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_hwaddr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+#define HAVE_STRUCT_IFREQ_IFR_HWADDR 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_netmask" "ac_cv_member_struct_ifreq_ifr_netmask" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (sizeof ac_aggr.ifr_hwaddr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_hwaddr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_ifreq_ifr_hwaddr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_hwaddr" >&5
-$as_echo "$ac_cv_member_struct_ifreq_ifr_hwaddr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_hwaddr = yes; then
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_netmask" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IFREQ_IFR_HWADDR 1
-_ACEOF
-
-
-fi
-{ $as_echo "$as_me:$LINENO: checking for struct ifreq.ifr_netmask" >&5
-$as_echo_n "checking for struct ifreq.ifr_netmask... " >&6; }
-if test "${ac_cv_member_struct_ifreq_ifr_netmask+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+#define HAVE_STRUCT_IFREQ_IFR_NETMASK 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_broadaddr" "ac_cv_member_struct_ifreq_ifr_broadaddr" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (ac_aggr.ifr_netmask)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_netmask=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (sizeof ac_aggr.ifr_netmask)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_netmask=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_ifreq_ifr_netmask=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_netmask" >&5
-$as_echo "$ac_cv_member_struct_ifreq_ifr_netmask" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_netmask = yes; then
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_broadaddr" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IFREQ_IFR_NETMASK 1
-_ACEOF
-
-
-fi
-{ $as_echo "$as_me:$LINENO: checking for struct ifreq.ifr_broadaddr" >&5
-$as_echo_n "checking for struct ifreq.ifr_broadaddr... " >&6; }
-if test "${ac_cv_member_struct_ifreq_ifr_broadaddr+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+#define HAVE_STRUCT_IFREQ_IFR_BROADADDR 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_addr" "ac_cv_member_struct_ifreq_ifr_addr" "$ac_includes_default
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
 #if HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (ac_aggr.ifr_broadaddr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_broadaddr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (sizeof ac_aggr.ifr_broadaddr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_broadaddr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_ifreq_ifr_broadaddr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_broadaddr" >&5
-$as_echo "$ac_cv_member_struct_ifreq_ifr_broadaddr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_broadaddr = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_IFREQ_IFR_BROADADDR 1
-_ACEOF
-
-
-fi
-{ $as_echo "$as_me:$LINENO: checking for struct ifreq.ifr_addr" >&5
-$as_echo_n "checking for struct ifreq.ifr_addr... " >&6; }
-if test "${ac_cv_member_struct_ifreq_ifr_addr+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (ac_aggr.ifr_addr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_addr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#if HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-int
-main ()
-{
-static struct ifreq ac_aggr;
-if (sizeof ac_aggr.ifr_addr)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_ifreq_ifr_addr=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_ifreq_ifr_addr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_addr" >&5
-$as_echo "$ac_cv_member_struct_ifreq_ifr_addr" >&6; }
-if test $ac_cv_member_struct_ifreq_ifr_addr = yes; then
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_addr" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_IFREQ_IFR_ADDR 1
@@ -8919,36 +6615,28 @@
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for function prototypes" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
 $as_echo_n "checking for function prototypes... " >&6; }
 if test "$ac_cv_prog_cc_c89" != no; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define PROTOTYPES 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define __PROTOTYPES 1
-_ACEOF
-
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "#define PROTOTYPES 1" >>confdefs.h
+
+
+$as_echo "#define __PROTOTYPES 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
 $as_echo_n "checking for working volatile... " >&6; }
-if test "${ac_cv_c_volatile+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_c_volatile+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -8962,54 +6650,27 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_volatile=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_volatile=no
-fi
-
+  ac_cv_c_volatile=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
 $as_echo "$ac_cv_c_volatile" >&6; }
 if test $ac_cv_c_volatile = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define volatile /**/
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_c_const+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9069,54 +6730,27 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_const=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_const=no
-fi
-
+  ac_cv_c_const=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
 $as_echo "$ac_cv_c_const" >&6; }
 if test $ac_cv_c_const = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define const /**/
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for void * support" >&5
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for void * support" >&5
 $as_echo_n "checking for void * support... " >&6; }
-if test "${emacs_cv_void_star+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_void_star+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9127,57 +6761,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_void_star=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_void_star=no
-fi
-
+  emacs_cv_void_star=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_void_star" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_void_star" >&5
 $as_echo "$emacs_cv_void_star" >&6; }
 if test $emacs_cv_void_star = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define POINTER_TYPE void
-_ACEOF
-
-else
-  cat >>confdefs.h <<\_ACEOF
-#define POINTER_TYPE char
-_ACEOF
-
-fi
-
-
-
-
-
-{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+  $as_echo "#define POINTER_TYPE void" >>confdefs.h
+
+else
+  $as_echo "#define POINTER_TYPE char" >>confdefs.h
+
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -9185,7 +6793,7 @@
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -9195,18 +6803,18 @@
 rm -f conftest.make
 fi
 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
   SET_MAKE=
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
 
 if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
-   { $as_echo "$as_me:$LINENO: checking whether we are using GNU Make" >&5
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU Make" >&5
 $as_echo_n "checking whether we are using GNU Make... " >&6; }
    HAVE_GNU_MAKE=no
    testval=`make --version 2>/dev/null | grep 'GNU Make'`
@@ -9215,73 +6823,46 @@
    else
       ac_enable_autodepend=no
    fi
-   { $as_echo "$as_me:$LINENO: result: $HAVE_GNU_MAKE" >&5
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_GNU_MAKE" >&5
 $as_echo "$HAVE_GNU_MAKE" >&6; }
    if test $HAVE_GNU_MAKE = yes; then
-      { $as_echo "$as_me:$LINENO: checking whether gcc understands -MMD -MF" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -MMD -MF" >&5
 $as_echo_n "checking whether gcc understands -MMD -MF... " >&6; }
       SAVE_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -MMD -MF deps.d"
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_enable_autodepend=no
-fi
-
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_enable_autodepend=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
       CFLAGS="$SAVE_CFLAGS"
       test -f deps.d || ac_enable_autodepend=no
       rm -rf deps.d
-      { $as_echo "$as_me:$LINENO: result: $ac_enable_autodepend" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_autodepend" >&5
 $as_echo "$ac_enable_autodepend" >&6; }
    fi
    if test $ac_enable_autodepend = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define AUTO_DEPEND 1
-_ACEOF
+$as_echo "#define AUTO_DEPEND 1" >>confdefs.h
 
    fi
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for long file names" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long file names" >&5
 $as_echo_n "checking for long file names... " >&6; }
-if test "${ac_cv_sys_long_file_names+set}" = set; then
+if test "${ac_cv_sys_long_file_names+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_long_file_names=yes
@@ -9311,25 +6892,23 @@
   test $ac_cv_sys_long_file_names = no && break
 done
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_long_file_names" >&5
 $as_echo "$ac_cv_sys_long_file_names" >&6; }
 if test $ac_cv_sys_long_file_names = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LONG_FILE_NAMES 1
-_ACEOF
+$as_echo "#define HAVE_LONG_FILE_NAMES 1" >>confdefs.h
 
 fi
 
 
 #### Choose a window system.
 
-{ $as_echo "$as_me:$LINENO: checking for X" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
 $as_echo_n "checking for X... " >&6; }
 
 
 # Check whether --with-x was given.
-if test "${with_x+set}" = set; then
+if test "${with_x+set}" = set; then :
   withval=$with_x;
 fi
 
@@ -9339,10 +6918,8 @@
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) { { $as_echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
-$as_echo "$as_me: error: Cannot use X directory names containing '" >&2;}
-   { (exit 1); exit 1; }; };; #(
-    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   # One or both of the vars are not set, and there is no cached value.
@@ -9359,7 +6936,7 @@
 	@echo libdir='${LIBDIR}'
 _ACEOF
   if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
     for ac_var in incroot usrlibdir libdir; do
       eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
     done
@@ -9378,7 +6955,7 @@
 	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
     esac
     case $ac_im_usrlibdir in
-	/usr/lib | /lib) ;;
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
 	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
     esac
   fi
@@ -9390,21 +6967,25 @@
 # Check X11 before X11Rn because it is often a symlink to the current release.
 ac_x_header_dirs='
 /usr/X11/include
+/usr/X11R7/include
 /usr/X11R6/include
 /usr/X11R5/include
 /usr/X11R4/include
 
 /usr/include/X11
+/usr/include/X11R7
 /usr/include/X11R6
 /usr/include/X11R5
 /usr/include/X11R4
 
 /usr/local/X11/include
+/usr/local/X11R7/include
 /usr/local/X11R6/include
 /usr/local/X11R5/include
 /usr/local/X11R4/include
 
 /usr/local/include/X11
+/usr/local/include/X11R7
 /usr/local/include/X11R6
 /usr/local/include/X11R5
 /usr/local/include/X11R4
@@ -9426,37 +7007,14 @@
 if test "$ac_x_includes" = no; then
   # Guess where to find include files, by looking for Xlib.h.
   # First, try using that file with no special directory specified.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # We can compile using X headers with no special include directory.
 ac_x_includes=
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   for ac_dir in $ac_x_header_dirs; do
   if test -r "$ac_dir/X11/Xlib.h"; then
     ac_x_includes=$ac_dir
@@ -9464,8 +7022,7 @@
   fi
 done
 fi
-
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 fi # $ac_x_includes = no
 
 if test "$ac_x_libraries" = no; then
@@ -9474,11 +7031,7 @@
   # Don't add to $LIBS permanently.
   ac_save_LIBS=$LIBS
   LIBS="-lX11 $LIBS"
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 int
@@ -9489,35 +7042,12 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
 ac_x_libraries=
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	LIBS=$ac_save_LIBS
+  LIBS=$ac_save_LIBS
 for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
@@ -9529,10 +7059,8 @@
   done
 done
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
 
 case $ac_x_includes,$ac_x_libraries in #(
@@ -9553,7 +7081,7 @@
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
 $as_echo "$have_x" >&6; }
   no_x=yes
 else
@@ -9564,7 +7092,7 @@
   ac_cv_have_x="have_x=yes\
 	ac_x_includes='$x_includes'\
 	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
 $as_echo "libraries $x_libraries, headers $x_includes" >&6; }
 fi
 
@@ -9660,150 +7188,17 @@
      REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
   fi
-  if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for AppKit/AppKit.h" >&5
-$as_echo_n "checking for AppKit/AppKit.h... " >&6; }
-if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_AppKit_AppKit_h" >&5
-$as_echo "$ac_cv_header_AppKit_AppKit_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking AppKit/AppKit.h usability" >&5
-$as_echo_n "checking AppKit/AppKit.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <AppKit/AppKit.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking AppKit/AppKit.h presence" >&5
-$as_echo_n "checking AppKit/AppKit.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <AppKit/AppKit.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: AppKit/AppKit.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: AppKit/AppKit.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for AppKit/AppKit.h" >&5
-$as_echo_n "checking for AppKit/AppKit.h... " >&6; }
-if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_AppKit_AppKit_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_AppKit_AppKit_h" >&5
-$as_echo "$ac_cv_header_AppKit_AppKit_h" >&6; }
-
-fi
-if test $ac_cv_header_AppKit_AppKit_h = yes; then
+  ac_fn_c_check_header_mongrel "$LINENO" "AppKit/AppKit.h" "ac_cv_header_AppKit_AppKit_h" "$ac_includes_default"
+if test "x$ac_cv_header_AppKit_AppKit_h" = x""yes; then :
   HAVE_NS=yes
 else
-  { { $as_echo "$as_me:$LINENO: error: \`--with-ns' was specified, but the include
-  files are missing or cannot be compiled." >&5
-$as_echo "$as_me: error: \`--with-ns' was specified, but the include
-  files are missing or cannot be compiled." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "\`--with-ns' was specified, but the include
+  files are missing or cannot be compiled." "$LINENO" 5
 fi
 
 
   NS_HAVE_NSINTEGER=yes
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <Foundation/NSObjCRuntime.h>
 int
@@ -9814,32 +7209,11 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ns_have_nsinteger=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ns_have_nsinteger=no
-fi
-
+  ns_have_nsinteger=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   if test $ns_have_nsinteger = no; then
     NS_HAVE_NSINTEGER=no
@@ -9881,9 +7255,9 @@
 if test "$window_system" = none && test "X$with_x" != "Xno"; then
    # Extract the first word of "X", so it can be a program name with args.
 set dummy X; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_HAVE_XSERVER+set}" = set; then
+if test "${ac_cv_prog_HAVE_XSERVER+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$HAVE_XSERVER"; then
@@ -9894,14 +7268,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_HAVE_XSERVER="true"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_prog_HAVE_XSERVER" && ac_cv_prog_HAVE_XSERVER="false"
@@ -9909,10 +7283,10 @@
 fi
 HAVE_XSERVER=$ac_cv_prog_HAVE_XSERVER
 if test -n "$HAVE_XSERVER"; then
-  { $as_echo "$as_me:$LINENO: result: $HAVE_XSERVER" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_XSERVER" >&5
 $as_echo "$HAVE_XSERVER" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9920,23 +7294,14 @@
    if test "$HAVE_XSERVER" = true ||
       test -n "$DISPLAY" ||
       test "`echo /usr/lib/libX11.*`" != "/usr/lib/libX11.*"; then
-        { { $as_echo "$as_me:$LINENO: error: You seem to be running X, but no X development libraries
+        as_fn_error $? "You seem to be running X, but no X development libraries
 were found.  You should install the relevant development files for X
 and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
 sure you have development files for image handling, i.e.
 tiff, gif, jpeg, png and xpm.
 If you are sure you want Emacs compiled without X window support, pass
   --without-x
-to configure." >&5
-$as_echo "$as_me: error: You seem to be running X, but no X development libraries
-were found.  You should install the relevant development files for X
-and for the toolkit you want, such as Gtk+, Lesstif or Motif.  Also make
-sure you have development files for image handling, i.e.
-tiff, gif, jpeg, png and xpm.
-If you are sure you want Emacs compiled without X window support, pass
-  --without-x
-to configure." >&2;}
-   { (exit 1); exit 1; }; }
+to configure." "$LINENO" 5
    fi
 fi
 
@@ -9950,198 +7315,26 @@
 # Assume not, until told otherwise.
 GNU_MALLOC=yes
 doug_lea_malloc=yes
-{ $as_echo "$as_me:$LINENO: checking for malloc_get_state" >&5
-$as_echo_n "checking for malloc_get_state... " >&6; }
-if test "${ac_cv_func_malloc_get_state+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define malloc_get_state to an innocuous variant, in case <limits.h> declares malloc_get_state.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define malloc_get_state innocuous_malloc_get_state
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char malloc_get_state (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef malloc_get_state
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char malloc_get_state ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_malloc_get_state || defined __stub___malloc_get_state
-choke me
-#endif
-
-int
-main ()
-{
-return malloc_get_state ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_malloc_get_state=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_malloc_get_state=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_get_state" >&5
-$as_echo "$ac_cv_func_malloc_get_state" >&6; }
-if test $ac_cv_func_malloc_get_state = yes; then
-  :
+ac_fn_c_check_func "$LINENO" "malloc_get_state" "ac_cv_func_malloc_get_state"
+if test "x$ac_cv_func_malloc_get_state" = x""yes; then :
+
 else
   doug_lea_malloc=no
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for malloc_set_state" >&5
-$as_echo_n "checking for malloc_set_state... " >&6; }
-if test "${ac_cv_func_malloc_set_state+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define malloc_set_state to an innocuous variant, in case <limits.h> declares malloc_set_state.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define malloc_set_state innocuous_malloc_set_state
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char malloc_set_state (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef malloc_set_state
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char malloc_set_state ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_malloc_set_state || defined __stub___malloc_set_state
-choke me
-#endif
-
-int
-main ()
-{
-return malloc_set_state ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_malloc_set_state=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_malloc_set_state=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_set_state" >&5
-$as_echo "$ac_cv_func_malloc_set_state" >&6; }
-if test $ac_cv_func_malloc_set_state = yes; then
-  :
+ac_fn_c_check_func "$LINENO" "malloc_set_state" "ac_cv_func_malloc_set_state"
+if test "x$ac_cv_func_malloc_set_state" = x""yes; then :
+
 else
   doug_lea_malloc=no
 fi
 
-{ $as_echo "$as_me:$LINENO: checking whether __after_morecore_hook exists" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __after_morecore_hook exists" >&5
 $as_echo_n "checking whether __after_morecore_hook exists... " >&6; }
-if test "${emacs_cv_var___after_morecore_hook+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_var___after_morecore_hook+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 extern void (* __after_morecore_hook)();
 int
@@ -10152,40 +7345,15 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_var___after_morecore_hook=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_var___after_morecore_hook=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_var___after_morecore_hook" >&5
+  emacs_cv_var___after_morecore_hook=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_var___after_morecore_hook" >&5
 $as_echo "$emacs_cv_var___after_morecore_hook" >&6; }
 if test $emacs_cv_var___after_morecore_hook = no; then
   doug_lea_malloc=no
@@ -10201,9 +7369,7 @@
       (Using Doug Lea's new malloc from the GNU C Library.)"
   fi
 
-cat >>confdefs.h <<\_ACEOF
-#define DOUG_LEA_MALLOC 1
-_ACEOF
+$as_echo "#define DOUG_LEA_MALLOC 1" >>confdefs.h
 
 fi
 
@@ -10214,142 +7380,13 @@
 
 
 
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -10359,118 +7396,32 @@
 done
 
 
+
+
+
+
+
+
 for ac_func in getpagesize
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-{ $as_echo "$as_me:$LINENO: checking for working mmap" >&5
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_mmap_fixed_mapped=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 /* malloc might have been renamed as rpl_malloc. */
@@ -10507,11 +7458,6 @@
 
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h.  */
-# ifndef HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
 # ifdef _SC_PAGESIZE
 #  define getpagesize() sysconf(_SC_PAGESIZE)
 # else /* no _SC_PAGESIZE */
@@ -10546,8 +7492,9 @@
 main ()
 {
   char *data, *data2, *data3;
+  const char *cdata2;
   int i, pagesize;
-  int fd;
+  int fd, fd2;
 
   pagesize = getpagesize ();
 
@@ -10560,27 +7507,41 @@
   umask (0);
   fd = creat ("conftest.mmap", 0600);
   if (fd < 0)
-    return 1;
+    return 2;
   if (write (fd, data, pagesize) != pagesize)
-    return 1;
+    return 3;
   close (fd);
 
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
+
   /* Next, try to mmap the file at a fixed address which already has
      something else allocated at it.  If we can, also make sure that
      we see the same garbage.  */
   fd = open ("conftest.mmap", O_RDWR);
   if (fd < 0)
-    return 1;
-  data2 = (char *) malloc (2 * pagesize);
-  if (!data2)
-    return 1;
-  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
+    return 9;
   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
 		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    return 1;
+    return 10;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data2 + i))
-      return 1;
+      return 11;
 
   /* Finally, make sure that changes to the mapped area do not
      percolate back to the file as seen by read().  (This is a bug on
@@ -10589,63 +7550,34 @@
     *(data2 + i) = *(data2 + i) + 1;
   data3 = (char *) malloc (pagesize);
   if (!data3)
-    return 1;
+    return 12;
   if (read (fd, data3, pagesize) != pagesize)
-    return 1;
+    return 13;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data3 + i))
-      return 1;
+      return 14;
   close (fd);
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_mmap_fixed_mapped=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-rm -f conftest.mmap
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
+
+fi
+rm -f conftest.mmap conftest.txt
 
 if test $use_mmap_for_buffers = yes; then
   REL_ALLOC=no
@@ -10653,19 +7585,14 @@
 
 LIBS="$libsrc_libs $LIBS"
 
-
-{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -10683,43 +7610,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_dnet_dnet_ntoa=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dnet_dnet_ntoa=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDNET 1
 _ACEOF
@@ -10729,18 +7631,14 @@
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lXbsd" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXbsd" >&5
 $as_echo_n "checking for main in -lXbsd... " >&6; }
-if test "${ac_cv_lib_Xbsd_main+set}" = set; then
+if test "${ac_cv_lib_Xbsd_main+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXbsd  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 
@@ -10752,60 +7650,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xbsd_main=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xbsd_main=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xbsd_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xbsd_main" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xbsd_main" >&5
 $as_echo "$ac_cv_lib_Xbsd_main" >&6; }
-if test $ac_cv_lib_Xbsd_main = yes; then
+if test "x$ac_cv_lib_Xbsd_main" = x""yes; then :
   LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"
 fi
 
 
-
-{ $as_echo "$as_me:$LINENO: checking for cma_open in -lpthreads" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cma_open in -lpthreads" >&5
 $as_echo_n "checking for cma_open in -lpthreads... " >&6; }
-if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then
+if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthreads  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -10823,43 +7691,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_pthreads_cma_open=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pthreads_cma_open=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_pthreads_cma_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_cma_open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_cma_open" >&5
 $as_echo "$ac_cv_lib_pthreads_cma_open" >&6; }
-if test $ac_cv_lib_pthreads_cma_open = yes; then
+if test "x$ac_cv_lib_pthreads_cma_open" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREADS 1
 _ACEOF
@@ -10872,9 +7715,9 @@
 
 case ${host_os} in
 aix*)
-  { $as_echo "$as_me:$LINENO: checking for -bbigtoc option" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -bbigtoc option" >&5
 $as_echo_n "checking for -bbigtoc option... " >&6; }
-if test "${gdb_cv_bigtoc+set}" = set; then
+if test "${gdb_cv_bigtoc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -10884,11 +7727,7 @@
     esac
 
     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -10899,41 +7738,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	gdb_cv_bigtoc=
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gdb_cv_bigtoc" >&5
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  gdb_cv_bigtoc=
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_bigtoc" >&5
 $as_echo "$gdb_cv_bigtoc" >&6; }
   ;;
 esac
@@ -10961,13 +7775,9 @@
   fi
 
   if test "${opsys}" = "gnu-linux"; then
-    { $as_echo "$as_me:$LINENO: checking whether X on GNU/Linux needs -b to link" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X on GNU/Linux needs -b to link" >&5
 $as_echo_n "checking whether X on GNU/Linux needs -b to link... " >&6; }
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -10978,38 +7788,13 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   xlinux_first_failure=no
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	xlinux_first_failure=yes
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  xlinux_first_failure=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
     if test "${xlinux_first_failure}" = "yes"; then
       OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
       OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
@@ -11019,11 +7804,7 @@
       C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
       CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
       LIBS="$LIBS -b i486-linuxaout"
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -11034,38 +7815,13 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   xlinux_second_failure=no
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	xlinux_second_failure=yes
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  xlinux_second_failure=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
       if test "${xlinux_second_failure}" = "yes"; then
 	# If we get the same failure with -b, there is no use adding -b.
 	# So take it out.  This plays safe.
@@ -11073,27 +7829,23 @@
 	C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
 	CPPFLAGS="$OLD_CPPFLAGS"
 	LIBS="$OLD_LIBS"
-        { $as_echo "$as_me:$LINENO: result: no" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       else
-        { $as_echo "$as_me:$LINENO: result: yes" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
       fi
     else
-      { $as_echo "$as_me:$LINENO: result: no" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     fi
   fi
 
   # Reportedly, some broken Solaris systems have XKBlib.h but are missing
   # header files included from there.
-  { $as_echo "$as_me:$LINENO: checking for Xkb" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xkb" >&5
 $as_echo_n "checking for Xkb... " >&6; }
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 #include <X11/XKBlib.h>
@@ -11105,145 +7857,27 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_xkb=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_xkb=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:$LINENO: result: $emacs_xkb" >&5
+  emacs_xkb=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_xkb" >&5
 $as_echo "$emacs_xkb" >&6; }
   if test $emacs_xkb = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XKBGETKEYBOARD 1
-_ACEOF
-
-  fi
-
-
-
-
-
-for ac_func in XrmSetDatabase XScreenResourceString \
+$as_echo "#define HAVE_XKBGETKEYBOARD 1" >>confdefs.h
+
+  fi
+
+  for ac_func in XrmSetDatabase XScreenResourceString \
 XScreenNumberOfScreen XSetWMProtocols
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -11254,16 +7888,12 @@
 fi
 
 if test "${window_system}" = "x11"; then
-  { $as_echo "$as_me:$LINENO: checking X11 version 6" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking X11 version 6" >&5
 $as_echo_n "checking X11 version 6... " >&6; }
-  if test "${emacs_cv_x11_version_6+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if test "${emacs_cv_x11_version_6+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 int
@@ -11277,50 +7907,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_x11_version_6=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_x11_version_6=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  emacs_cv_x11_version_6=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
   if test $emacs_cv_x11_version_6 = yes; then
-    { $as_echo "$as_me:$LINENO: result: 6 or newer" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: 6 or newer" >&5
 $as_echo "6 or newer" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X11R6 1
-_ACEOF
+$as_echo "#define HAVE_X11R6 1" >>confdefs.h
 
   else
-    { $as_echo "$as_me:$LINENO: result: before 6" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: before 6" >&5
 $as_echo "before 6" >&6; }
   fi
 fi
@@ -11338,9 +7941,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -11353,14 +7956,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -11369,10 +7972,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -11383,27 +7986,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for $RSVG_MODULE" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $RSVG_MODULE" >&5
 $as_echo_n "checking for $RSVG_MODULE... " >&6; }
 
         if $PKG_CONFIG --exists "$RSVG_MODULE" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking RSVG_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking RSVG_CFLAGS" >&5
 $as_echo_n "checking RSVG_CFLAGS... " >&6; }
             RSVG_CFLAGS=`$PKG_CONFIG --cflags "$RSVG_MODULE"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $RSVG_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RSVG_CFLAGS" >&5
 $as_echo "$RSVG_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking RSVG_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking RSVG_LIBS" >&5
 $as_echo_n "checking RSVG_LIBS... " >&6; }
             RSVG_LIBS=`$PKG_CONFIG --libs "$RSVG_MODULE"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $RSVG_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RSVG_LIBS" >&5
 $as_echo "$RSVG_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             RSVG_CFLAGS=""
             RSVG_LIBS=""
@@ -11433,9 +8036,7 @@
     if test ".${RSVG_CFLAGS}" != "."; then
       HAVE_RSVG=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RSVG 1
-_ACEOF
+$as_echo "#define HAVE_RSVG 1" >>confdefs.h
 
       CFLAGS="$CFLAGS $RSVG_CFLAGS"
       LIBS="$RSVG_LIBS $LIBS"
@@ -11455,9 +8056,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -11470,14 +8071,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -11486,10 +8087,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -11500,27 +8101,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for $GTK_MODULES" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GTK_MODULES" >&5
 $as_echo_n "checking for $GTK_MODULES... " >&6; }
 
         if $PKG_CONFIG --exists "$GTK_MODULES" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_CFLAGS" >&5
 $as_echo_n "checking GTK_CFLAGS... " >&6; }
             GTK_CFLAGS=`$PKG_CONFIG --cflags "$GTK_MODULES"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CFLAGS" >&5
 $as_echo "$GTK_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking GTK_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_LIBS" >&5
 $as_echo_n "checking GTK_LIBS... " >&6; }
             GTK_LIBS=`$PKG_CONFIG --libs "$GTK_MODULES"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $GTK_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_LIBS" >&5
 $as_echo "$GTK_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             GTK_CFLAGS=""
             GTK_LIBS=""
@@ -11545,9 +8146,7 @@
   fi
 
   if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then
-     { { $as_echo "$as_me:$LINENO: error: $GTK_PKG_ERRORS" >&5
-$as_echo "$as_me: error: $GTK_PKG_ERRORS" >&2;}
-   { (exit 1); exit 1; }; }
+     as_fn_error $? "$GTK_PKG_ERRORS" "$LINENO" 5
   fi
 fi
 
@@ -11560,101 +8159,12 @@
   CFLAGS="$CFLAGS $GTK_CFLAGS"
   LIBS="$GTK_LIBS $LIBS"
     GTK_COMPILES=no
-
-for ac_func in gtk_main
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_func in gtk_main
+do :
+  ac_fn_c_check_func "$LINENO" "gtk_main" "ac_cv_func_gtk_main"
+if test "x$ac_cv_func_gtk_main" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GTK_MAIN 1
 _ACEOF
  GTK_COMPILES=yes
 fi
@@ -11662,22 +8172,18 @@
 
   if test "${GTK_COMPILES}" != "yes"; then
     if test "$USE_X_TOOLKIT" != "maybe"; then
-      { { $as_echo "$as_me:$LINENO: error: Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" >&5
-$as_echo "$as_me: error: Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" >&2;}
-   { (exit 1); exit 1; }; };
+      as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log.  Maybe some x11-devel files missing?" "$LINENO" 5;
     fi
   else
     HAVE_GTK=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_GTK 1
-_ACEOF
+$as_echo "#define USE_GTK 1" >>confdefs.h
 
     USE_X_TOOLKIT=none
     if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
       :
     else
-      { $as_echo "$as_me:$LINENO: WARNING: Your version of Gtk+ will have problems with
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your version of Gtk+ will have problems with
        closing open displays.  This is no problem if you just use
        one display, but if you use more than one and close one of them
        Emacs may crash." >&5
@@ -11699,101 +8205,12 @@
   fi
 
       HAVE_GTK_MULTIDISPLAY=no
-
-for ac_func in gdk_display_open
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_func in gdk_display_open
+do :
+  ac_fn_c_check_func "$LINENO" "gdk_display_open" "ac_cv_func_gdk_display_open"
+if test "x$ac_cv_func_gdk_display_open" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GDK_DISPLAY_OPEN 1
 _ACEOF
  HAVE_GTK_MULTIDISPLAY=yes
 fi
@@ -11801,170 +8218,27 @@
 
   if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GTK_MULTIDISPLAY 1
-_ACEOF
+$as_echo "#define HAVE_GTK_MULTIDISPLAY 1" >>confdefs.h
 
   fi
 
           HAVE_GTK_FILE_SELECTION=no
-  { $as_echo "$as_me:$LINENO: checking whether GTK_TYPE_FILE_SELECTION is declared" >&5
-$as_echo_n "checking whether GTK_TYPE_FILE_SELECTION is declared... " >&6; }
-if test "${ac_cv_have_decl_GTK_TYPE_FILE_SELECTION+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+  ac_fn_c_check_decl "$LINENO" "GTK_TYPE_FILE_SELECTION" "ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" "$ac_includes_default
 #include <gtk/gtk.h>
-
-int
-main ()
-{
-#ifndef GTK_TYPE_FILE_SELECTION
-  (void) GTK_TYPE_FILE_SELECTION;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_GTK_TYPE_FILE_SELECTION=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_GTK_TYPE_FILE_SELECTION=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" >&5
-$as_echo "$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" >&6; }
-if test $ac_cv_have_decl_GTK_TYPE_FILE_SELECTION = yes; then
+"
+if test "x$ac_cv_have_decl_GTK_TYPE_FILE_SELECTION" = x""yes; then :
   HAVE_GTK_FILE_SELECTION=yes
 else
   HAVE_GTK_FILE_SELECTION=no
 fi
 
   if test "$HAVE_GTK_FILE_SELECTION" = yes; then
-
-for ac_func in gtk_file_selection_new
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_func in gtk_file_selection_new
+do :
+  ac_fn_c_check_func "$LINENO" "gtk_file_selection_new" "ac_cv_func_gtk_file_selection_new"
+if test "x$ac_cv_func_gtk_file_selection_new" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GTK_FILE_SELECTION_NEW 1
 _ACEOF
  HAVE_GTK_FILE_SELECTION=yes
 else
@@ -11975,163 +8249,22 @@
   fi
 
     HAVE_GTK_FILE_CHOOSER=no
-  { $as_echo "$as_me:$LINENO: checking whether GTK_TYPE_FILE_CHOOSER is declared" >&5
-$as_echo_n "checking whether GTK_TYPE_FILE_CHOOSER is declared... " >&6; }
-if test "${ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
+  ac_fn_c_check_decl "$LINENO" "GTK_TYPE_FILE_CHOOSER" "ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" "$ac_includes_default
 #include <gtk/gtk.h>
-
-int
-main ()
-{
-#ifndef GTK_TYPE_FILE_CHOOSER
-  (void) GTK_TYPE_FILE_CHOOSER;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" >&5
-$as_echo "$ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" >&6; }
-if test $ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER = yes; then
+"
+if test "x$ac_cv_have_decl_GTK_TYPE_FILE_CHOOSER" = x""yes; then :
   HAVE_GTK_FILE_CHOOSER=yes
 else
   HAVE_GTK_FILE_CHOOSER=no
 fi
 
   if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
-
-for ac_func in gtk_file_chooser_dialog_new
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_func in gtk_file_chooser_dialog_new
+do :
+  ac_fn_c_check_func "$LINENO" "gtk_file_chooser_dialog_new" "ac_cv_func_gtk_file_chooser_dialog_new"
+if test "x$ac_cv_func_gtk_file_chooser_dialog_new" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GTK_FILE_CHOOSER_DIALOG_NEW 1
 _ACEOF
  HAVE_GTK_FILE_CHOOSER=yes
 else
@@ -12144,153 +8277,18 @@
   if test "$HAVE_GTK_FILE_SELECTION" = yes \
      && test "$HAVE_GTK_FILE_CHOOSER" = yes;  then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GTK_FILE_BOTH 1
-_ACEOF
+$as_echo "#define HAVE_GTK_FILE_BOTH 1" >>confdefs.h
 
   fi
 
       if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
     HAVE_GTK_AND_PTHREAD=no
-
-for ac_header in pthread.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_header in pthread.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_PTHREAD_H 1
 _ACEOF
 
 fi
@@ -12298,18 +8296,14 @@
 done
 
     if test "$ac_cv_header_pthread_h"; then
-      { $as_echo "$as_me:$LINENO: checking for pthread_self in -lpthread" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5
 $as_echo_n "checking for pthread_self in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then
+if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -12327,43 +8321,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_pthread_pthread_self=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pthread_pthread_self=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_pthread_pthread_self=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_self" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_self" >&6; }
-if test $ac_cv_lib_pthread_pthread_self = yes; then
+if test "x$ac_cv_lib_pthread_pthread_self" = x""yes; then :
   HAVE_GTK_AND_PTHREAD=yes
 fi
 
@@ -12374,9 +8343,7 @@
         *) GTK_LIBS="$GTK_LIBS -lpthread" ;;
       esac
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GTK_AND_PTHREAD 1
-_ACEOF
+$as_echo "#define HAVE_GTK_AND_PTHREAD 1" >>confdefs.h
 
     fi
   fi
@@ -12389,9 +8356,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -12404,14 +8371,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -12420,10 +8387,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -12434,27 +8401,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for dbus-1 >= 1.0" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus-1 >= 1.0" >&5
 $as_echo_n "checking for dbus-1 >= 1.0... " >&6; }
 
         if $PKG_CONFIG --exists "dbus-1 >= 1.0" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking DBUS_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_CFLAGS" >&5
 $as_echo_n "checking DBUS_CFLAGS... " >&6; }
             DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $DBUS_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_CFLAGS" >&5
 $as_echo "$DBUS_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking DBUS_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_LIBS" >&5
 $as_echo_n "checking DBUS_LIBS... " >&6; }
             DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $DBUS_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_LIBS" >&5
 $as_echo "$DBUS_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             DBUS_CFLAGS=""
             DBUS_LIBS=""
@@ -12481,105 +8448,14 @@
    if test "$HAVE_DBUS" = yes; then
      LIBS="$LIBS $DBUS_LIBS"
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DBUS 1
-_ACEOF
-
-
-for ac_func in dbus_watch_get_unix_fd
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+$as_echo "#define HAVE_DBUS 1" >>confdefs.h
+
+     for ac_func in dbus_watch_get_unix_fd
+do :
+  ac_fn_c_check_func "$LINENO" "dbus_watch_get_unix_fd" "ac_cv_func_dbus_watch_get_unix_fd"
+if test "x$ac_cv_func_dbus_watch_get_unix_fd" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_DBUS_WATCH_GET_UNIX_FD 1
 _ACEOF
 
 fi
@@ -12595,9 +8471,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -12610,14 +8486,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -12626,10 +8502,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -12640,27 +8516,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for gconf-2.0 >= 2.13" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 >= 2.13" >&5
 $as_echo_n "checking for gconf-2.0 >= 2.13... " >&6; }
 
         if $PKG_CONFIG --exists "gconf-2.0 >= 2.13" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_CFLAGS" >&5
 $as_echo_n "checking GCONF_CFLAGS... " >&6; }
             GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= 2.13"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_CFLAGS" >&5
 $as_echo "$GCONF_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking GCONF_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_LIBS" >&5
 $as_echo_n "checking GCONF_LIBS... " >&6; }
             GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 >= 2.13"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_LIBS" >&5
 $as_echo "$GCONF_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             GCONF_CFLAGS=""
             GCONF_LIBS=""
@@ -12686,9 +8562,7 @@
 
    if test "$HAVE_GCONF" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GCONF 1
-_ACEOF
+$as_echo "#define HAVE_GCONF 1" >>confdefs.h
 
    fi
 fi
@@ -12696,16 +8570,12 @@
 HAVE_XAW3D=no
 if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
   if test "$with_xaw3d" != no; then
-    { $as_echo "$as_me:$LINENO: checking for xaw3d" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5
 $as_echo_n "checking for xaw3d... " >&6; }
-    if test "${emacs_cv_xaw3d+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    if test "${emacs_cv_xaw3d+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <X11/Intrinsic.h>
@@ -12718,66 +8588,35 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_xaw3d=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_xaw3d=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  emacs_cv_xaw3d=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
   else
     emacs_cv_xaw3d=no
   fi
   if test $emacs_cv_xaw3d = yes; then
-    { $as_echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; using Lucid toolkit" >&5
 $as_echo "yes; using Lucid toolkit" >&6; }
     USE_X_TOOLKIT=LUCID
     HAVE_XAW3D=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XAW3D 1
-_ACEOF
+$as_echo "#define HAVE_XAW3D 1" >>confdefs.h
 
   else
-    { $as_echo "$as_me:$LINENO: result: no" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-    { $as_echo "$as_me:$LINENO: checking for libXaw" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXaw" >&5
 $as_echo_n "checking for libXaw... " >&6; }
-    if test "${emacs_cv_xaw+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    if test "${emacs_cv_xaw+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <X11/Intrinsic.h>
@@ -12790,50 +8629,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_xaw=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_xaw=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  emacs_cv_xaw=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
     if test $emacs_cv_xaw = yes; then
-      { $as_echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; using Lucid toolkit" >&5
 $as_echo "yes; using Lucid toolkit" >&6; }
       USE_X_TOOLKIT=LUCID
     elif test x"${USE_X_TOOLKIT}" = xLUCID; then
-      { { $as_echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5
-$as_echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;}
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "Lucid toolkit requires X11/Xaw include files" "$LINENO" 5
     else
-      { $as_echo "$as_me:$LINENO: result: no; do not use toolkit by default" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no; do not use toolkit by default" >&5
 $as_echo "no; do not use toolkit by default" >&6; }
       USE_X_TOOLKIT=none
     fi
@@ -12843,16 +8655,12 @@
 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
 
 if test "${USE_X_TOOLKIT}" != "none"; then
-  { $as_echo "$as_me:$LINENO: checking X11 toolkit version" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking X11 toolkit version" >&5
 $as_echo_n "checking X11 toolkit version... " >&6; }
-  if test "${emacs_cv_x11_toolkit_version_6+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if test "${emacs_cv_x11_toolkit_version_6+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Intrinsic.h>
 int
@@ -12866,51 +8674,24 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_x11_toolkit_version_6=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_x11_toolkit_version_6=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  emacs_cv_x11_toolkit_version_6=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 fi
 
   HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
   if test $emacs_cv_x11_toolkit_version_6 = yes; then
-    { $as_echo "$as_me:$LINENO: result: 6 or newer" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: 6 or newer" >&5
 $as_echo "6 or newer" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X11XTR6 1
-_ACEOF
+$as_echo "#define HAVE_X11XTR6 1" >>confdefs.h
 
   else
-    { $as_echo "$as_me:$LINENO: result: before 6" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: before 6" >&5
 $as_echo "before 6" >&6; }
   fi
 
@@ -12920,19 +8701,14 @@
   else
     LIBS="-lXt $LIBS"
   fi
-
-{ $as_echo "$as_me:$LINENO: checking for XmuConvertStandardSelection in -lXmu" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmuConvertStandardSelection in -lXmu" >&5
 $as_echo_n "checking for XmuConvertStandardSelection in -lXmu... " >&6; }
-if test "${ac_cv_lib_Xmu_XmuConvertStandardSelection+set}" = set; then
+if test "${ac_cv_lib_Xmu_XmuConvertStandardSelection+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXmu  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -12950,43 +8726,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xmu_XmuConvertStandardSelection=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xmu_XmuConvertStandardSelection=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xmu_XmuConvertStandardSelection=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuConvertStandardSelection" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuConvertStandardSelection" >&5
 $as_echo "$ac_cv_lib_Xmu_XmuConvertStandardSelection" >&6; }
-if test $ac_cv_lib_Xmu_XmuConvertStandardSelection = yes; then
+if test "x$ac_cv_lib_Xmu_XmuConvertStandardSelection" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXMU 1
 _ACEOF
@@ -13001,19 +8752,14 @@
 # On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
 if test "${HAVE_X11}" = "yes"; then
   if test "${USE_X_TOOLKIT}" != "none"; then
-
-{ $as_echo "$as_me:$LINENO: checking for XShapeQueryExtension in -lXext" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5
 $as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_XShapeQueryExtension+set}" = set; then
+if test "${ac_cv_lib_Xext_XShapeQueryExtension+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXext  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -13031,43 +8777,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xext_XShapeQueryExtension=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xext_XShapeQueryExtension=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xext_XShapeQueryExtension=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; }
-if test $ac_cv_lib_Xext_XShapeQueryExtension = yes; then
+if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXEXT 1
 _ACEOF
@@ -13080,16 +8801,12 @@
 fi
 
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-  { $as_echo "$as_me:$LINENO: checking for Motif version 2.1" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Motif version 2.1" >&5
 $as_echo_n "checking for Motif version 2.1... " >&6; }
-if test "${emacs_cv_motif_version_2_1+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_motif_version_2_1+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <Xm/Xm.h>
 int
@@ -13104,56 +8821,29 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_motif_version_2_1=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_motif_version_2_1=no
-fi
-
+  emacs_cv_motif_version_2_1=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_motif_version_2_1" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_motif_version_2_1" >&5
 $as_echo "$emacs_cv_motif_version_2_1" >&6; }
   HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
   if test $emacs_cv_motif_version_2_1 = yes; then
     HAVE_LIBXP=no
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MOTIF_2_1 1
-_ACEOF
-
-    { $as_echo "$as_me:$LINENO: checking for XpCreateContext in -lXp" >&5
+$as_echo "#define HAVE_MOTIF_2_1 1" >>confdefs.h
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpCreateContext in -lXp" >&5
 $as_echo_n "checking for XpCreateContext in -lXp... " >&6; }
-if test "${ac_cv_lib_Xp_XpCreateContext+set}" = set; then
+if test "${ac_cv_lib_Xp_XpCreateContext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXp  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -13171,57 +8861,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xp_XpCreateContext=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xp_XpCreateContext=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xp_XpCreateContext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xp_XpCreateContext" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpCreateContext" >&5
 $as_echo "$ac_cv_lib_Xp_XpCreateContext" >&6; }
-if test $ac_cv_lib_Xp_XpCreateContext = yes; then
+if test "x$ac_cv_lib_Xp_XpCreateContext" = x""yes; then :
   HAVE_LIBXP=yes
 fi
 
     if test ${HAVE_LIBXP} = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBXP 1
-_ACEOF
+$as_echo "#define HAVE_LIBXP 1" >>confdefs.h
 
     fi
   else
-    { $as_echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LessTif where some systems put it" >&5
 $as_echo_n "checking for LessTif where some systems put it... " >&6; }
-if test "${emacs_cv_lesstif+set}" = set; then
+if test "${emacs_cv_lesstif+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   # We put this in CFLAGS temporarily to precede other -I options
@@ -13231,11 +8894,7 @@
     OLD_CFLAGS=$CFLAGS
     CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS"
     CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include </usr/X11R6/LessTif/Motif1.2/include/Xm/Xm.h>
 int
@@ -13246,35 +8905,14 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_lesstif=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_lesstif=no
-fi
-
+  emacs_cv_lesstif=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_lesstif" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_lesstif" >&5
 $as_echo "$emacs_cv_lesstif" >&6; }
     if test $emacs_cv_lesstif = yes; then
       # Make sure this -I option remains in CPPFLAGS after it is set
@@ -13292,44 +8930,31 @@
 fi
 
 
-
 USE_TOOLKIT_SCROLL_BARS=no
 if test "${with_toolkit_scroll_bars}" != "no"; then
   if test "${USE_X_TOOLKIT}" != "none"; then
     if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-      cat >>confdefs.h <<\_ACEOF
-#define USE_TOOLKIT_SCROLL_BARS 1
-_ACEOF
+      $as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
 
       HAVE_XAW3D=no
       USE_TOOLKIT_SCROLL_BARS=yes
     elif test "${HAVE_XAW3D}" = "yes"; then
-      cat >>confdefs.h <<\_ACEOF
-#define USE_TOOLKIT_SCROLL_BARS 1
-_ACEOF
+      $as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
 
       USE_TOOLKIT_SCROLL_BARS=yes
     fi
   elif test "${HAVE_GTK}" = "yes"; then
-    cat >>confdefs.h <<\_ACEOF
-#define USE_TOOLKIT_SCROLL_BARS 1
-_ACEOF
+    $as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
 
     USE_TOOLKIT_SCROLL_BARS=yes
   elif test "${HAVE_NS}" = "yes"; then
-    cat >>confdefs.h <<\_ACEOF
-#define USE_TOOLKIT_SCROLL_BARS 1
-_ACEOF
+    $as_echo "#define USE_TOOLKIT_SCROLL_BARS 1" >>confdefs.h
 
     USE_TOOLKIT_SCROLL_BARS=yes
   fi
 fi
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 	  #include <X11/Xlib.h>
@@ -13342,45 +8967,20 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   HAVE_XIM=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XIM 1
-_ACEOF
-
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	HAVE_XIM=no
-fi
-
+$as_echo "#define HAVE_XIM 1" >>confdefs.h
+
+else
+  HAVE_XIM=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 if test "${with_xim}" != "no"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_XIM 1
-_ACEOF
+$as_echo "#define USE_XIM 1" >>confdefs.h
 
 fi
 
@@ -13390,11 +8990,7 @@
   if test "$GCC" = yes; then
     CFLAGS="$CFLAGS --pedantic-errors"
   fi
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <X11/Xlib.h>
@@ -13420,43 +9016,15 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_arg6_star=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-  if test "$emacs_cv_arg6_star" = yes; then
-    cat >>confdefs.h <<\_ACEOF
-#define XRegisterIMInstantiateCallback_arg6 XPointer*
-_ACEOF
+    if test "$emacs_cv_arg6_star" = yes; then
+    $as_echo "#define XRegisterIMInstantiateCallback_arg6 XPointer*" >>confdefs.h
 
   else
-    cat >>confdefs.h <<\_ACEOF
-#define XRegisterIMInstantiateCallback_arg6 XPointer
-_ACEOF
+    $as_echo "#define XRegisterIMInstantiateCallback_arg6 XPointer" >>confdefs.h
 
   fi
   CFLAGS=$late_CFLAGS
@@ -13473,9 +9041,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -13488,14 +9056,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -13504,10 +9072,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -13518,27 +9086,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for fontconfig >= 2.2.0" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig >= 2.2.0" >&5
 $as_echo_n "checking for fontconfig >= 2.2.0... " >&6; }
 
         if $PKG_CONFIG --exists "fontconfig >= 2.2.0" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking FONTCONFIG_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking FONTCONFIG_CFLAGS" >&5
 $as_echo_n "checking FONTCONFIG_CFLAGS... " >&6; }
             FONTCONFIG_CFLAGS=`$PKG_CONFIG --cflags "fontconfig >= 2.2.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $FONTCONFIG_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_CFLAGS" >&5
 $as_echo "$FONTCONFIG_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking FONTCONFIG_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking FONTCONFIG_LIBS" >&5
 $as_echo_n "checking FONTCONFIG_LIBS... " >&6; }
             FONTCONFIG_LIBS=`$PKG_CONFIG --libs "fontconfig >= 2.2.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $FONTCONFIG_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FONTCONFIG_LIBS" >&5
 $as_echo "$FONTCONFIG_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             FONTCONFIG_CFLAGS=""
             FONTCONFIG_LIBS=""
@@ -13575,9 +9143,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -13590,14 +9158,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -13606,10 +9174,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -13620,27 +9188,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for xft >= 0.13.0" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xft >= 0.13.0" >&5
 $as_echo_n "checking for xft >= 0.13.0... " >&6; }
 
         if $PKG_CONFIG --exists "xft >= 0.13.0" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking XFT_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking XFT_CFLAGS" >&5
 $as_echo_n "checking XFT_CFLAGS... " >&6; }
             XFT_CFLAGS=`$PKG_CONFIG --cflags "xft >= 0.13.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $XFT_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XFT_CFLAGS" >&5
 $as_echo "$XFT_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking XFT_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking XFT_LIBS" >&5
 $as_echo_n "checking XFT_LIBS... " >&6; }
             XFT_LIBS=`$PKG_CONFIG --libs "xft >= 0.13.0"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $XFT_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XFT_LIBS" >&5
 $as_echo "$XFT_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             XFT_CFLAGS=""
             XFT_LIBS=""
@@ -13667,18 +9235,14 @@
       ## Because xftfont.c uses XRenderQueryExtension, we also
       ## need to link to -lXrender.
       HAVE_XRENDER=no
-      { $as_echo "$as_me:$LINENO: checking for XRenderQueryExtension in -lXrender" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryExtension in -lXrender" >&5
 $as_echo_n "checking for XRenderQueryExtension in -lXrender... " >&6; }
-if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then
+if test "${ac_cv_lib_Xrender_XRenderQueryExtension+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXrender  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -13696,43 +9260,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xrender_XRenderQueryExtension=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xrender_XRenderQueryExtension=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xrender_XRenderQueryExtension=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderQueryExtension" >&5
 $as_echo "$ac_cv_lib_Xrender_XRenderQueryExtension" >&6; }
-if test $ac_cv_lib_Xrender_XRenderQueryExtension = yes; then
+if test "x$ac_cv_lib_Xrender_XRenderQueryExtension" = x""yes; then :
   HAVE_XRENDER=yes
 fi
 
@@ -13744,146 +9283,16 @@
 	CFLAGS="$CFLAGS $XFT_CFLAGS"
 	XFT_LIBS="-lXrender $XFT_LIBS"
 	LIBS="$XFT_LIBS $LIBS"
-	if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5
-$as_echo_n "checking for X11/Xft/Xft.h... " >&6; }
-if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5
-$as_echo "$ac_cv_header_X11_Xft_Xft_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking X11/Xft/Xft.h usability" >&5
-$as_echo_n "checking X11/Xft/Xft.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <X11/Xft/Xft.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking X11/Xft/Xft.h presence" >&5
-$as_echo_n "checking X11/Xft/Xft.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/Xft/Xft.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/Xft/Xft.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: X11/Xft/Xft.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5
-$as_echo_n "checking for X11/Xft/Xft.h... " >&6; }
-if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_X11_Xft_Xft_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5
-$as_echo "$ac_cv_header_X11_Xft_Xft_h" >&6; }
-
-fi
-if test $ac_cv_header_X11_Xft_Xft_h = yes; then
-  { $as_echo "$as_me:$LINENO: checking for XftFontOpen in -lXft" >&5
+	ac_fn_c_check_header_mongrel "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "$ac_includes_default"
+if test "x$ac_cv_header_X11_Xft_Xft_h" = x""yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5
 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; }
-if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then
+if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXft $XFT_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -13901,43 +9310,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xft_XftFontOpen=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xft_XftFontOpen=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xft_XftFontOpen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpen" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5
 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; }
-if test $ac_cv_lib_Xft_XftFontOpen = yes; then
+if test "x$ac_cv_lib_Xft_XftFontOpen" = x""yes; then :
   HAVE_XFT=yes
 fi
 
@@ -13947,9 +9331,7 @@
 
 	if test "${HAVE_XFT}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XFT 1
-_ACEOF
+$as_echo "#define HAVE_XFT 1" >>confdefs.h
 
 
 	  C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
@@ -13978,9 +9360,7 @@
     HAVE_LIBOTF=no
     if test "${HAVE_FREETYPE}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FREETYPE 1
-_ACEOF
+$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h
 
       if test "${with_libotf}" != "no"; then
 
@@ -13988,9 +9368,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -14003,14 +9383,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -14019,10 +9399,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -14033,27 +9413,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for libotf" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libotf" >&5
 $as_echo_n "checking for libotf... " >&6; }
 
         if $PKG_CONFIG --exists "libotf" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking LIBOTF_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBOTF_CFLAGS" >&5
 $as_echo_n "checking LIBOTF_CFLAGS... " >&6; }
             LIBOTF_CFLAGS=`$PKG_CONFIG --cflags "libotf"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $LIBOTF_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTF_CFLAGS" >&5
 $as_echo "$LIBOTF_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking LIBOTF_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBOTF_LIBS" >&5
 $as_echo_n "checking LIBOTF_LIBS... " >&6; }
             LIBOTF_LIBS=`$PKG_CONFIG --libs "libotf"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $LIBOTF_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBOTF_LIBS" >&5
 $as_echo "$LIBOTF_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             LIBOTF_CFLAGS=""
             LIBOTF_LIBS=""
@@ -14079,22 +9459,16 @@
 
 	if test "$HAVE_LIBOTF" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBOTF 1
-_ACEOF
-
-	  { $as_echo "$as_me:$LINENO: checking for OTF_get_variation_glyphs in -lotf" >&5
+$as_echo "#define HAVE_LIBOTF 1" >>confdefs.h
+
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OTF_get_variation_glyphs in -lotf" >&5
 $as_echo_n "checking for OTF_get_variation_glyphs in -lotf... " >&6; }
-if test "${ac_cv_lib_otf_OTF_get_variation_glyphs+set}" = set; then
+if test "${ac_cv_lib_otf_OTF_get_variation_glyphs+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lotf  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -14112,43 +9486,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_otf_OTF_get_variation_glyphs=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_otf_OTF_get_variation_glyphs=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_otf_OTF_get_variation_glyphs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_otf_OTF_get_variation_glyphs" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_otf_OTF_get_variation_glyphs" >&5
 $as_echo "$ac_cv_lib_otf_OTF_get_variation_glyphs" >&6; }
-if test $ac_cv_lib_otf_OTF_get_variation_glyphs = yes; then
+if test "x$ac_cv_lib_otf_OTF_get_variation_glyphs" = x""yes; then :
   HAVE_OTF_GET_VARIATION_GLYPHS=yes
 else
   HAVE_OTF_GET_VARIATION_GLYPHS=no
@@ -14156,9 +9505,7 @@
 
 	  if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_OTF_GET_VARIATION_GLYPHS 1
-_ACEOF
+$as_echo "#define HAVE_OTF_GET_VARIATION_GLYPHS 1" >>confdefs.h
 
 	  fi
 	fi
@@ -14173,9 +9520,9 @@
 
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -14188,14 +9535,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
@@ -14204,10 +9551,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -14218,27 +9565,27 @@
   else
      PKG_CONFIG_MIN_VERSION=0.9.0
      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
-        { $as_echo "$as_me:$LINENO: checking for m17n-flt" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for m17n-flt" >&5
 $as_echo_n "checking for m17n-flt... " >&6; }
 
         if $PKG_CONFIG --exists "m17n-flt" 2>&5; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
             succeeded=yes
 
-            { $as_echo "$as_me:$LINENO: checking M17N_FLT_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking M17N_FLT_CFLAGS" >&5
 $as_echo_n "checking M17N_FLT_CFLAGS... " >&6; }
             M17N_FLT_CFLAGS=`$PKG_CONFIG --cflags "m17n-flt"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $M17N_FLT_CFLAGS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $M17N_FLT_CFLAGS" >&5
 $as_echo "$M17N_FLT_CFLAGS" >&6; }
 
-            { $as_echo "$as_me:$LINENO: checking M17N_FLT_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking M17N_FLT_LIBS" >&5
 $as_echo_n "checking M17N_FLT_LIBS... " >&6; }
             M17N_FLT_LIBS=`$PKG_CONFIG --libs "m17n-flt"|sed -e 's,///*,/,g'`
-            { $as_echo "$as_me:$LINENO: result: $M17N_FLT_LIBS" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $M17N_FLT_LIBS" >&5
 $as_echo "$M17N_FLT_LIBS" >&6; }
         else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
             M17N_FLT_CFLAGS=""
             M17N_FLT_LIBS=""
@@ -14264,9 +9611,7 @@
 
 	if test "$HAVE_M17N_FLT" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_M17N_FLT 1
-_ACEOF
+$as_echo "#define HAVE_M17N_FLT 1" >>confdefs.h
 
 	fi
       fi
@@ -14292,146 +9637,16 @@
 HAVE_XPM=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_xpm}" != "no"; then
-    if test "${ac_cv_header_X11_xpm_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
-$as_echo_n "checking for X11/xpm.h... " >&6; }
-if test "${ac_cv_header_X11_xpm_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
-$as_echo "$ac_cv_header_X11_xpm_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking X11/xpm.h usability" >&5
-$as_echo_n "checking X11/xpm.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <X11/xpm.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking X11/xpm.h presence" >&5
-$as_echo_n "checking X11/xpm.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/xpm.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/xpm.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: X11/xpm.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
-$as_echo_n "checking for X11/xpm.h... " >&6; }
-if test "${ac_cv_header_X11_xpm_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_X11_xpm_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
-$as_echo "$ac_cv_header_X11_xpm_h" >&6; }
-
-fi
-if test $ac_cv_header_X11_xpm_h = yes; then
-  { $as_echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5
+    ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default"
+if test "x$ac_cv_header_X11_xpm_h" = x""yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReadFileToPixmap in -lXpm" >&5
 $as_echo_n "checking for XpmReadFileToPixmap in -lXpm... " >&6; }
-if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then
+if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXpm -lX11 $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -14449,43 +9664,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_Xpm_XpmReadFileToPixmap=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_Xpm_XpmReadFileToPixmap=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_Xpm_XpmReadFileToPixmap=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5
 $as_echo "$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; }
-if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then
+if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = x""yes; then :
   HAVE_XPM=yes
 fi
 
@@ -14493,13 +9683,9 @@
 
 
     if test "${HAVE_XPM}" = "yes"; then
-      { $as_echo "$as_me:$LINENO: checking for XpmReturnAllocPixels preprocessor define" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReturnAllocPixels preprocessor define" >&5
 $as_echo_n "checking for XpmReturnAllocPixels preprocessor define... " >&6; }
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include "X11/xpm.h"
 #ifndef XpmReturnAllocPixels
@@ -14508,7 +9694,7 @@
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "no_return_alloc_pixels" >/dev/null 2>&1; then
+  $EGREP "no_return_alloc_pixels" >/dev/null 2>&1; then :
   HAVE_XPM=no
 else
   HAVE_XPM=yes
@@ -14517,10 +9703,10 @@
 
 
       if test "${HAVE_XPM}" = "yes"; then
-	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
       else
-	{ $as_echo "$as_me:$LINENO: result: no" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       fi
     fi
@@ -14528,9 +9714,7 @@
 
   if test "${HAVE_XPM}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_XPM 1
-_ACEOF
+$as_echo "#define HAVE_XPM 1" >>confdefs.h
 
   fi
 fi
@@ -14539,146 +9723,16 @@
 HAVE_JPEG=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_jpeg}" != "no"; then
-            if test "${ac_cv_header_jerror_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for jerror.h" >&5
-$as_echo_n "checking for jerror.h... " >&6; }
-if test "${ac_cv_header_jerror_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
-$as_echo "$ac_cv_header_jerror_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking jerror.h usability" >&5
-$as_echo_n "checking jerror.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <jerror.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking jerror.h presence" >&5
-$as_echo_n "checking jerror.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <jerror.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: jerror.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: jerror.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: jerror.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: jerror.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: jerror.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: jerror.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: jerror.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: jerror.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: jerror.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for jerror.h" >&5
-$as_echo_n "checking for jerror.h... " >&6; }
-if test "${ac_cv_header_jerror_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_jerror_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
-$as_echo "$ac_cv_header_jerror_h" >&6; }
-
-fi
-if test $ac_cv_header_jerror_h = yes; then
-  { $as_echo "$as_me:$LINENO: checking for jpeg_destroy_compress in -ljpeg" >&5
+            ac_fn_c_check_header_mongrel "$LINENO" "jerror.h" "ac_cv_header_jerror_h" "$ac_includes_default"
+if test "x$ac_cv_header_jerror_h" = x""yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_compress in -ljpeg" >&5
 $as_echo_n "checking for jpeg_destroy_compress in -ljpeg... " >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_destroy_compress+set}" = set; then
+if test "${ac_cv_lib_jpeg_jpeg_destroy_compress+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ljpeg  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -14696,43 +9750,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_jpeg_jpeg_destroy_compress=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_jpeg_jpeg_destroy_compress=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_jpeg_jpeg_destroy_compress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_compress" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_compress" >&5
 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6; }
-if test $ac_cv_lib_jpeg_jpeg_destroy_compress = yes; then
+if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = x""yes; then :
   HAVE_JPEG=yes
 fi
 
@@ -14741,30 +9770,21 @@
 
   fi
 
-
-  if test "${HAVE_JPEG}" = "yes"; then
-    cat >>confdefs.h <<\_ACEOF
-#define HAVE_JPEG 1
-_ACEOF
-
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    if test "${HAVE_JPEG}" = "yes"; then
+    $as_echo "#define HAVE_JPEG 1" >>confdefs.h
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <jpeglib.h>
 	 version=JPEG_LIB_VERSION
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "version= *(6[2-9]|[7-9][0-9])" >/dev/null 2>&1; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_JPEG 1
-_ACEOF
-
-else
-  { $as_echo "$as_me:$LINENO: WARNING: libjpeg found, but not version 6b or later" >&5
+  $EGREP "version= *(6[2-9]|[7-9][0-9])" >/dev/null 2>&1; then :
+  $as_echo "#define HAVE_JPEG 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libjpeg found, but not version 6b or later" >&5
 $as_echo "$as_me: WARNING: libjpeg found, but not version 6b or later" >&2;}
         HAVE_JPEG=no
 fi
@@ -14779,144 +9799,11 @@
   if test "${with_png}" != "no"; then
     # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
     # in /usr/include/libpng.
-
-
-for ac_header in png.h libpng/png.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_header in png.h libpng/png.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -14926,18 +9813,14 @@
 done
 
     if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
-      { $as_echo "$as_me:$LINENO: checking for png_get_channels in -lpng" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_get_channels in -lpng" >&5
 $as_echo_n "checking for png_get_channels in -lpng... " >&6; }
-if test "${ac_cv_lib_png_png_get_channels+set}" = set; then
+if test "${ac_cv_lib_png_png_get_channels+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpng -lz -lm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -14955,43 +9838,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_png_png_get_channels=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_png_png_get_channels=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_png_png_get_channels=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_get_channels" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_get_channels" >&5
 $as_echo "$ac_cv_lib_png_png_get_channels" >&6; }
-if test $ac_cv_lib_png_png_get_channels = yes; then
+if test "x$ac_cv_lib_png_png_get_channels" = x""yes; then :
   HAVE_PNG=yes
 fi
 
@@ -15000,9 +9858,7 @@
 
   if test "${HAVE_PNG}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PNG 1
-_ACEOF
+$as_echo "#define HAVE_PNG 1" >>confdefs.h
 
   fi
 fi
@@ -15011,149 +9867,19 @@
 HAVE_TIFF=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_tiff}" != "no"; then
-    if test "${ac_cv_header_tiffio_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for tiffio.h" >&5
-$as_echo_n "checking for tiffio.h... " >&6; }
-if test "${ac_cv_header_tiffio_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
-$as_echo "$ac_cv_header_tiffio_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking tiffio.h usability" >&5
-$as_echo_n "checking tiffio.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <tiffio.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking tiffio.h presence" >&5
-$as_echo_n "checking tiffio.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <tiffio.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: tiffio.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: tiffio.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: tiffio.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: tiffio.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: tiffio.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: tiffio.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: tiffio.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: tiffio.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: tiffio.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for tiffio.h" >&5
-$as_echo_n "checking for tiffio.h... " >&6; }
-if test "${ac_cv_header_tiffio_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_tiffio_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
-$as_echo "$ac_cv_header_tiffio_h" >&6; }
-
-fi
-if test $ac_cv_header_tiffio_h = yes; then
+    ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default"
+if test "x$ac_cv_header_tiffio_h" = x""yes; then :
   tifflibs="-lz -lm"
       # At least one tiff package requires the jpeg library.
       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
-      { $as_echo "$as_me:$LINENO: checking for TIFFGetVersion in -ltiff" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFGetVersion in -ltiff" >&5
 $as_echo_n "checking for TIFFGetVersion in -ltiff... " >&6; }
-if test "${ac_cv_lib_tiff_TIFFGetVersion+set}" = set; then
+if test "${ac_cv_lib_tiff_TIFFGetVersion+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ltiff $tifflibs $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -15171,43 +9897,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_tiff_TIFFGetVersion=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_tiff_TIFFGetVersion=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_tiff_TIFFGetVersion=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5
 $as_echo "$ac_cv_lib_tiff_TIFFGetVersion" >&6; }
-if test $ac_cv_lib_tiff_TIFFGetVersion = yes; then
+if test "x$ac_cv_lib_tiff_TIFFGetVersion" = x""yes; then :
   HAVE_TIFF=yes
 fi
 
@@ -15218,9 +9919,7 @@
 
   if test "${HAVE_TIFF}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TIFF 1
-_ACEOF
+$as_echo "#define HAVE_TIFF 1" >>confdefs.h
 
   fi
 fi
@@ -15228,148 +9927,18 @@
 ### Use -lgif or -lungif if available, unless `--with-gif=no'.
 HAVE_GIF=no
 if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
-  if test "${ac_cv_header_gif_lib_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for gif_lib.h" >&5
-$as_echo_n "checking for gif_lib.h... " >&6; }
-if test "${ac_cv_header_gif_lib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
-$as_echo "$ac_cv_header_gif_lib_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking gif_lib.h usability" >&5
-$as_echo_n "checking gif_lib.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <gif_lib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking gif_lib.h presence" >&5
-$as_echo_n "checking gif_lib.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <gif_lib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for gif_lib.h" >&5
-$as_echo_n "checking for gif_lib.h... " >&6; }
-if test "${ac_cv_header_gif_lib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_gif_lib_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
-$as_echo "$ac_cv_header_gif_lib_h" >&6; }
-
-fi
-if test $ac_cv_header_gif_lib_h = yes; then
+  ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gif_lib_h" = x""yes; then :
   # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
-    { $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lgif" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGifPutExtensionLast in -lgif" >&5
 $as_echo_n "checking for EGifPutExtensionLast in -lgif... " >&6; }
-if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then
+if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgif  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -15387,43 +9956,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_gif_EGifPutExtensionLast=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_gif_EGifPutExtensionLast=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_gif_EGifPutExtensionLast=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_gif_EGifPutExtensionLast = yes; then
+if test "x$ac_cv_lib_gif_EGifPutExtensionLast" = x""yes; then :
   HAVE_GIF=yes
 else
   try_libungif=yes
@@ -15439,18 +9983,14 @@
 
 # If gif_lib.h but no libgif, try libungif.
   if test x"$try_libungif" = xyes; then
-    { $as_echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGifPutExtensionLast in -lungif" >&5
 $as_echo_n "checking for EGifPutExtensionLast in -lungif... " >&6; }
-if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
+if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lungif  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -15468,52 +10008,25 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_ungif_EGifPutExtensionLast=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ungif_EGifPutExtensionLast=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_ungif_EGifPutExtensionLast=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
 $as_echo "$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
-if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
+if test "x$ac_cv_lib_ungif_EGifPutExtensionLast" = x""yes; then :
   HAVE_GIF=yes
 fi
 
 
     if test "$HAVE_GIF" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define LIBGIF -lungif
-_ACEOF
+$as_echo "#define LIBGIF -lungif" >>confdefs.h
 
       ac_gif_lib_name="-lungif"
     fi
@@ -15521,9 +10034,7 @@
 
   if test "${HAVE_GIF}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GIF 1
-_ACEOF
+$as_echo "#define HAVE_GIF 1" >>confdefs.h
 
   fi
 fi
@@ -15543,165 +10054,28 @@
     MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
 
   if test "X${MISSING}" != X; then
-    { { $as_echo "$as_me:$LINENO: error: The following required libraries were not found:
+    as_fn_error $? "The following required libraries were not found:
     $MISSING
 Maybe some development libraries/packages are missing?
 If you don't want to link with them give
     $WITH_NO
-as options to configure" >&5
-$as_echo "$as_me: error: The following required libraries were not found:
-    $MISSING
-Maybe some development libraries/packages are missing?
-If you don't want to link with them give
-    $WITH_NO
-as options to configure" >&2;}
-   { (exit 1); exit 1; }; }
+as options to configure" "$LINENO" 5
   fi
 fi
 
 ### Use -lgpm if available, unless `--with-gpm=no'.
 HAVE_GPM=no
 if test "${with_gpm}" != "no"; then
-  if test "${ac_cv_header_gpm_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for gpm.h" >&5
-$as_echo_n "checking for gpm.h... " >&6; }
-if test "${ac_cv_header_gpm_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gpm_h" >&5
-$as_echo "$ac_cv_header_gpm_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking gpm.h usability" >&5
-$as_echo_n "checking gpm.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <gpm.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking gpm.h presence" >&5
-$as_echo_n "checking gpm.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <gpm.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: gpm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: gpm.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: gpm.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: gpm.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: gpm.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: gpm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: gpm.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: gpm.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: gpm.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for gpm.h" >&5
-$as_echo_n "checking for gpm.h... " >&6; }
-if test "${ac_cv_header_gpm_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_gpm_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gpm_h" >&5
-$as_echo "$ac_cv_header_gpm_h" >&6; }
-
-fi
-if test $ac_cv_header_gpm_h = yes; then
-  { $as_echo "$as_me:$LINENO: checking for Gpm_Open in -lgpm" >&5
+  ac_fn_c_check_header_mongrel "$LINENO" "gpm.h" "ac_cv_header_gpm_h" "$ac_includes_default"
+if test "x$ac_cv_header_gpm_h" = x""yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Gpm_Open in -lgpm" >&5
 $as_echo_n "checking for Gpm_Open in -lgpm... " >&6; }
-if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -15719,43 +10093,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_gpm_Gpm_Open=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_gpm_Gpm_Open=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 $as_echo "$ac_cv_lib_gpm_Gpm_Open" >&6; }
-if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+if test "x$ac_cv_lib_gpm_Gpm_Open" = x""yes; then :
   HAVE_GPM=yes
 fi
 
@@ -15766,144 +10115,14 @@
 
 if test "${HAVE_GPM}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GPM 1
-_ACEOF
-
-fi
-
-if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
-$as_echo_n "checking for malloc/malloc.h... " >&6; }
-if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
-$as_echo "$ac_cv_header_malloc_malloc_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking malloc/malloc.h usability" >&5
-$as_echo_n "checking malloc/malloc.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <malloc/malloc.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking malloc/malloc.h presence" >&5
-$as_echo_n "checking malloc/malloc.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <malloc/malloc.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: malloc/malloc.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: malloc/malloc.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
-$as_echo_n "checking for malloc/malloc.h... " >&6; }
-if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_malloc_malloc_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
-$as_echo "$ac_cv_header_malloc_malloc_h" >&6; }
-
-fi
-if test $ac_cv_header_malloc_malloc_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MALLOC_MALLOC_H 1
-_ACEOF
+$as_echo "#define HAVE_GPM 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_header_mongrel "$LINENO" "malloc/malloc.h" "ac_cv_header_malloc_malloc_h" "$ac_includes_default"
+if test "x$ac_cv_header_malloc_malloc_h" = x""yes; then :
+
+$as_echo "#define HAVE_MALLOC_MALLOC_H 1" >>confdefs.h
 
 fi
 
@@ -15912,31 +10131,23 @@
 ### Use NeXTstep API to implement GUI.
 if test "${HAVE_NS}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_NS 1
-_ACEOF
+$as_echo "#define HAVE_NS 1" >>confdefs.h
 
   if test "${NS_IMPL_COCOA}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define NS_IMPL_COCOA 1
-_ACEOF
+$as_echo "#define NS_IMPL_COCOA 1" >>confdefs.h
 
     GNU_OBJC_CFLAGS=
   fi
   if test "${NS_IMPL_GNUSTEP}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define NS_IMPL_GNUSTEP 1
-_ACEOF
+$as_echo "#define NS_IMPL_GNUSTEP 1" >>confdefs.h
 
     GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE"
   fi
   if test "${NS_HAVE_NSINTEGER}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define NS_HAVE_NSINTEGER 1
-_ACEOF
+$as_echo "#define NS_HAVE_NSINTEGER 1" >>confdefs.h
 
   fi
   # We also have mouse menus.
@@ -15948,146 +10159,16 @@
 ### Use session management (-lSM -lICE) if available
 HAVE_X_SM=no
 if test "${HAVE_X11}" = "yes"; then
-  if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
-$as_echo_n "checking for X11/SM/SMlib.h... " >&6; }
-if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
-$as_echo "$ac_cv_header_X11_SM_SMlib_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking X11/SM/SMlib.h usability" >&5
-$as_echo_n "checking X11/SM/SMlib.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <X11/SM/SMlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking X11/SM/SMlib.h presence" >&5
-$as_echo_n "checking X11/SM/SMlib.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <X11/SM/SMlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: X11/SM/SMlib.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
-$as_echo_n "checking for X11/SM/SMlib.h... " >&6; }
-if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_X11_SM_SMlib_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
-$as_echo "$ac_cv_header_X11_SM_SMlib_h" >&6; }
-
-fi
-if test $ac_cv_header_X11_SM_SMlib_h = yes; then
-  { $as_echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5
+  ac_fn_c_check_header_mongrel "$LINENO" "X11/SM/SMlib.h" "ac_cv_header_X11_SM_SMlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_X11_SM_SMlib_h" = x""yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SmcOpenConnection in -lSM" >&5
 $as_echo_n "checking for SmcOpenConnection in -lSM... " >&6; }
-if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then
+if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lSM -lICE $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -16105,43 +10186,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_SM_SmcOpenConnection=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_SM_SmcOpenConnection=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_SM_SmcOpenConnection=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SM_SmcOpenConnection" >&5
 $as_echo "$ac_cv_lib_SM_SmcOpenConnection" >&6; }
-if test $ac_cv_lib_SM_SmcOpenConnection = yes; then
+if test "x$ac_cv_lib_SM_SmcOpenConnection" = x""yes; then :
   HAVE_X_SM=yes
 fi
 
@@ -16151,9 +10207,7 @@
 
   if test "${HAVE_X_SM}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X_SM 1
-_ACEOF
+$as_echo "#define HAVE_X_SM 1" >>confdefs.h
 
     case "$LIBS" in
       *-lSM*) ;;
@@ -16163,16 +10217,12 @@
 fi
 
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
-{ $as_echo "$as_me:$LINENO: checking whether netdb declares h_errno" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether netdb declares h_errno" >&5
 $as_echo_n "checking whether netdb declares h_errno... " >&6; }
-if test "${emacs_cv_netdb_declares_h_errno+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_netdb_declares_h_errno+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netdb.h>
 int
@@ -16183,61 +10233,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_netdb_declares_h_errno=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_netdb_declares_h_errno=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_netdb_declares_h_errno" >&5
+  emacs_cv_netdb_declares_h_errno=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_netdb_declares_h_errno" >&5
 $as_echo "$emacs_cv_netdb_declares_h_errno" >&6; }
 if test $emacs_cv_netdb_declares_h_errno = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_H_ERRNO 1
-_ACEOF
+$as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h
 
 fi
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_working_alloca_h+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <alloca.h>
 int
@@ -16249,59 +10268,28 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_working_alloca_h=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_working_alloca_h=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+  ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
 $as_echo "$ac_cv_working_alloca_h" >&6; }
 if test $ac_cv_working_alloca_h = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for alloca" >&5
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_func_alloca_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __GNUC__
 # define alloca __builtin_alloca
@@ -16333,47 +10321,20 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_func_alloca_works=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_alloca_works=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+  ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
 $as_echo "$ac_cv_func_alloca_works" >&6; }
 
 if test $ac_cv_func_alloca_works = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA 1
-_ACEOF
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
 
 else
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
@@ -16383,21 +10344,15 @@
 
 ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
-cat >>confdefs.h <<\_ACEOF
-#define C_ALLOCA 1
-_ACEOF
-
-
-{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_os_cray+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #if defined CRAY && ! defined CRAY2
 webecray
@@ -16407,7 +10362,7 @@
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then
+  $EGREP "webecray" >/dev/null 2>&1; then :
   ac_cv_os_cray=yes
 else
   ac_cv_os_cray=no
@@ -16415,100 +10370,13 @@
 rm -f conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
 $as_echo "$ac_cv_os_cray" >&6; }
 if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 
 cat >>confdefs.h <<_ACEOF
 #define CRAY_STACKSEG_END $ac_func
@@ -16520,19 +10388,15 @@
   done
 fi
 
-{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
+if test "${ac_cv_c_stack_direction+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
   ac_cv_c_stack_direction=0
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
@@ -16555,46 +10419,18 @@
   return find_stack_direction () < 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_c_stack_direction=1
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_stack_direction=-1
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+  ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
 $as_echo "$ac_cv_c_stack_direction" >&6; }
-
 cat >>confdefs.h <<_ACEOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
 _ACEOF
@@ -16604,26 +10440,19 @@
 
 
 if test x"$ac_cv_func_alloca_works" != xyes; then
-   { { $as_echo "$as_me:$LINENO: error: a system implementation of alloca is required " >&5
-$as_echo "$as_me: error: a system implementation of alloca is required " >&2;}
-   { (exit 1); exit 1; }; }
+   as_fn_error $? "a system implementation of alloca is required " "$LINENO" 5
 fi
 
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
-
-{ $as_echo "$as_me:$LINENO: checking for sqrt in -lm" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
 $as_echo_n "checking for sqrt in -lm... " >&6; }
-if test "${ac_cv_lib_m_sqrt+set}" = set; then
+if test "${ac_cv_lib_m_sqrt+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -16641,43 +10470,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_m_sqrt=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_m_sqrt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_m_sqrt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
 $as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test $ac_cv_lib_m_sqrt = yes; then
+if test "x$ac_cv_lib_m_sqrt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -16689,19 +10493,14 @@
 
 # Check for mail-locking functions in a "mail" library.  Probably this should
 # have the same check as for liblockfile below.
-
-{ $as_echo "$as_me:$LINENO: checking for maillock in -lmail" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for maillock in -lmail" >&5
 $as_echo_n "checking for maillock in -lmail... " >&6; }
-if test "${ac_cv_lib_mail_maillock+set}" = set; then
+if test "${ac_cv_lib_mail_maillock+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmail  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -16719,43 +10518,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_mail_maillock=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_mail_maillock=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_mail_maillock=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mail_maillock" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mail_maillock" >&5
 $as_echo "$ac_cv_lib_mail_maillock" >&6; }
-if test $ac_cv_lib_mail_maillock = yes; then
+if test "x$ac_cv_lib_mail_maillock" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBMAIL 1
 _ACEOF
@@ -16764,19 +10538,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for maillock in -llockfile" >&5
 $as_echo_n "checking for maillock in -llockfile... " >&6; }
-if test "${ac_cv_lib_lockfile_maillock+set}" = set; then
+if test "${ac_cv_lib_lockfile_maillock+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-llockfile  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -16794,43 +10563,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_lockfile_maillock=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_lockfile_maillock=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_lockfile_maillock=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lockfile_maillock" >&5
 $as_echo "$ac_cv_lib_lockfile_maillock" >&6; }
-if test $ac_cv_lib_lockfile_maillock = yes; then
+if test "x$ac_cv_lib_lockfile_maillock" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBLOCKFILE 1
 _ACEOF
@@ -16845,9 +10589,9 @@
 if test "$ac_cv_lib_lockfile_maillock" = no; then
       # Extract the first word of "liblockfile.so", so it can be a program name with args.
 set dummy liblockfile.so; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_liblockfile+set}" = set; then
+if test "${ac_cv_prog_liblockfile+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$liblockfile"; then
@@ -16859,14 +10603,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_liblockfile="yes"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_prog_liblockfile" && ac_cv_prog_liblockfile="no"
@@ -16874,340 +10618,43 @@
 fi
 liblockfile=$ac_cv_prog_liblockfile
 if test -n "$liblockfile"; then
-  { $as_echo "$as_me:$LINENO: result: $liblockfile" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $liblockfile" >&5
 $as_echo "$liblockfile" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
   if test $ac_cv_prog_liblockfile = yes; then
-    { { $as_echo "$as_me:$LINENO: error: Shared liblockfile found but can't link against it.
-This probably means that movemail could lose mail.
-There may be a \`development' package to install containing liblockfile." >&5
-$as_echo "$as_me: error: Shared liblockfile found but can't link against it.
+    as_fn_error $? "Shared liblockfile found but can't link against it.
 This probably means that movemail could lose mail.
-There may be a \`development' package to install containing liblockfile." >&2;}
-   { (exit 1); exit 1; }; }
+There may be a \`development' package to install containing liblockfile." "$LINENO" 5
   else :
   fi
 fi
-
 for ac_func in touchlock
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "touchlock" "ac_cv_func_touchlock"
+if test "x$ac_cv_func_touchlock" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
+#define HAVE_TOUCHLOCK 1
+_ACEOF
+
+fi
+done
 
 for ac_header in maillock.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "maillock.h" "ac_cv_header_maillock_h" "$ac_includes_default"
+if test "x$ac_cv_header_maillock_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#define HAVE_MAILLOCK_H 1
+_ACEOF
+
+fi
+
+done
 
 
 for ac_func in gethostname getdomainname dup2 \
@@ -17220,97 +10667,10 @@
 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
 cfmakeraw cfsetspeed
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -17319,400 +10679,29 @@
 done
 
 
-
 for ac_header in sys/un.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_un_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-for ac_header in $ac_header_list
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-for ac_func in $ac_func_list
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_SYS_UN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+  for ac_func in $ac_func_list
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -17724,31 +10713,15 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:$LINENO: checking for working mktime" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if test "${ac_cv_func_working_mktime+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
+if test "${ac_cv_func_working_mktime+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_working_mktime=no
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 /* Test program from Paul Eggert and Tony Leneis.  */
 #ifdef TIME_WITH_SYS_TIME
@@ -17780,8 +10753,8 @@
 static time_t time_t_min;
 
 /* Values we'll use to set the TZ environment variable.  */
-static char *tz_strings[] = {
-  (char *) 0, "TZ=GMT0", "TZ=JST-9",
+static const char *tz_strings[] = {
+  (const char *) 0, "TZ=GMT0", "TZ=JST-9",
   "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
 };
 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
@@ -17798,7 +10771,7 @@
      instead of "TZ=America/Vancouver" in order to detect the bug even
      on systems that don't support the Olson extension, or don't have the
      full zoneinfo tables installed.  */
-  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
 
   tm.tm_year = 98;
   tm.tm_mon = 3;
@@ -17811,16 +10784,14 @@
 }
 
 static int
-mktime_test1 (now)
-     time_t now;
+mktime_test1 (time_t now)
 {
   struct tm *lt;
   return ! (lt = localtime (&now)) || mktime (lt) == now;
 }
 
 static int
-mktime_test (now)
-     time_t now;
+mktime_test (time_t now)
 {
   return (mktime_test1 (now)
 	  && mktime_test1 ((time_t) (time_t_max - now))
@@ -17844,8 +10815,7 @@
 }
 
 static int
-bigtime_test (j)
-     int j;
+bigtime_test (int j)
 {
   struct tm tm;
   time_t now;
@@ -17889,7 +10859,7 @@
      instead of "TZ=America/Vancouver" in order to detect the bug even
      on systems that don't support the Olson extension, or don't have the
      full zoneinfo tables installed.  */
-  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+  putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
 
   t = mktime (&tm);
 
@@ -17924,7 +10894,7 @@
   for (i = 0; i < N_STRINGS; i++)
     {
       if (tz_strings[i])
-	putenv (tz_strings[i]);
+	putenv ((char*) tz_strings[i]);
 
       for (t = 0; t <= time_t_max - delta; t += delta)
 	if (! mktime_test (t))
@@ -17945,44 +10915,17 @@
   return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_working_mktime=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_working_mktime=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5
+  ac_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5
 $as_echo "$ac_cv_func_working_mktime" >&6; }
 if test $ac_cv_func_working_mktime = no; then
   case " $LIBOBJS " in
@@ -17995,9 +10938,7 @@
 
 if test "$ac_cv_func_working_mktime" = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define BROKEN_MKTIME 1
-_ACEOF
+$as_echo "#define BROKEN_MKTIME 1" >>confdefs.h
 
 fi
 
@@ -18005,99 +10946,13 @@
 
 # Make sure getloadavg.c is where it belongs, at configure-time.
 test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" ||
-  { { $as_echo "$as_me:$LINENO: error: $srcdir/$ac_config_libobj_dir/getloadavg.c is missing" >&5
-$as_echo "$as_me: error: $srcdir/$ac_config_libobj_dir/getloadavg.c is missing" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "$srcdir/$ac_config_libobj_dir/getloadavg.c is missing" "$LINENO" 5
 
 ac_save_LIBS=$LIBS
 
 # Check for getloadavg, but be sure not to touch the cache variable.
-({ $as_echo "$as_me:$LINENO: checking for getloadavg" >&5
-$as_echo_n "checking for getloadavg... " >&6; }
-if test "${ac_cv_func_getloadavg+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define getloadavg to an innocuous variant, in case <limits.h> declares getloadavg.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define getloadavg innocuous_getloadavg
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getloadavg (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef getloadavg
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getloadavg ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_getloadavg || defined __stub___getloadavg
-choke me
-#endif
-
-int
-main ()
-{
-return getloadavg ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_getloadavg=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_getloadavg=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg" >&5
-$as_echo "$ac_cv_func_getloadavg" >&6; }
-if test $ac_cv_func_getloadavg = yes; then
+(ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
+if test "x$ac_cv_func_getloadavg" = x""yes; then :
   exit 0
 else
   exit 1
@@ -18105,101 +10960,12 @@
 ) && ac_have_func=yes
 
 # On HPUX9, an unprivileged user can get load averages through this function.
-
 for ac_func in pstat_getdynamic
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
+if test "x$ac_cv_func_pstat_getdynamic" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_PSTAT_GETDYNAMIC 1
 _ACEOF
 
 fi
@@ -18207,19 +10973,14 @@
 
 
 # Solaris has libkstat which does not require root.
-
-{ $as_echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
 $as_echo_n "checking for kstat_open in -lkstat... " >&6; }
-if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then
+if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkstat  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -18237,43 +10998,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_kstat_kstat_open=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_kstat_kstat_open=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_kstat_kstat_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kstat_kstat_open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5
 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
-if test $ac_cv_lib_kstat_kstat_open = yes; then
+if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKSTAT 1
 _ACEOF
@@ -18289,18 +11025,14 @@
 # to get the right answer into the cache.
 # For kstat on solaris, we need libelf to force the definition of SVR4 below.
 if test $ac_have_func = no; then
-  { $as_echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
 $as_echo_n "checking for elf_begin in -lelf... " >&6; }
-if test "${ac_cv_lib_elf_elf_begin+set}" = set; then
+if test "${ac_cv_lib_elf_elf_begin+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lelf  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -18318,60 +11050,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_elf_elf_begin=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_elf_elf_begin=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_elf_elf_begin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_elf_elf_begin" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5
 $as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
-if test $ac_cv_lib_elf_elf_begin = yes; then
+if test "x$ac_cv_lib_elf_elf_begin" = x""yes; then :
   LIBS="-lelf $LIBS"
 fi
 
 fi
 if test $ac_have_func = no; then
-  { $as_echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
 $as_echo_n "checking for kvm_open in -lkvm... " >&6; }
-if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then
+if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkvm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -18389,135 +11092,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_kvm_kvm_open=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_kvm_kvm_open=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_kvm_kvm_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
-if test $ac_cv_lib_kvm_kvm_open = yes; then
+if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then :
   LIBS="-lkvm $LIBS"
 fi
 
   # Check for the 4.4BSD definition of getloadavg.
-  { $as_echo "$as_me:$LINENO: checking for getloadavg in -lutil" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
 $as_echo_n "checking for getloadavg in -lutil... " >&6; }
-if test "${ac_cv_lib_util_getloadavg+set}" = set; then
+if test "${ac_cv_lib_util_getloadavg+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getloadavg ();
-int
-main ()
-{
-return getloadavg ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_util_getloadavg=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_util_getloadavg=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_getloadavg" >&5
-$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
-if test $ac_cv_lib_util_getloadavg = yes; then
-  LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
-fi
-
-fi
-
-if test $ac_have_func = no; then
-  # There is a commonly available library for RS/6000 AIX.
-  # Since it is not a standard part of AIX, it might be installed locally.
-  ac_getloadavg_LIBS=$LIBS
-  LIBS="-L/usr/local/lib $LIBS"
-  { $as_echo "$as_me:$LINENO: checking for getloadavg in -lgetloadavg" >&5
-$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
-if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgetloadavg  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -18535,43 +11133,65 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_util_getloadavg=yes
+else
+  ac_cv_lib_util_getloadavg=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5
+$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
+if test "x$ac_cv_lib_util_getloadavg" = x""yes; then :
+  LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
+fi
+
+fi
+
+if test $ac_have_func = no; then
+  # There is a commonly available library for RS/6000 AIX.
+  # Since it is not a standard part of AIX, it might be installed locally.
+  ac_getloadavg_LIBS=$LIBS
+  LIBS="-L/usr/local/lib $LIBS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
+$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
+if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgetloadavg  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getloadavg ();
+int
+main ()
+{
+return getloadavg ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_getloadavg_getloadavg=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_getloadavg_getloadavg=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_getloadavg_getloadavg=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_getloadavg_getloadavg" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getloadavg_getloadavg" >&5
 $as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
-if test $ac_cv_lib_getloadavg_getloadavg = yes; then
+if test "x$ac_cv_lib_getloadavg_getloadavg" = x""yes; then :
   LIBS="-lgetloadavg $LIBS"
 else
   LIBS=$ac_getloadavg_LIBS
@@ -18581,101 +11201,12 @@
 
 # Make sure it is really in the library, if we think we found it,
 # otherwise set up the replacement function.
-
 for ac_func in getloadavg
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
+if test "x$ac_cv_func_getloadavg" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETLOADAVG 1
 _ACEOF
 
 else
@@ -18686,159 +11217,24 @@
 esac
 
 
-cat >>confdefs.h <<\_ACEOF
-#define C_GETLOADAVG 1
-_ACEOF
+$as_echo "#define C_GETLOADAVG 1" >>confdefs.h
 
 # Figure out what our getloadavg.c needs.
 ac_have_func=no
-if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-$as_echo_n "checking for sys/dg_sys_info.h... " >&6; }
-if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5
-$as_echo_n "checking sys/dg_sys_info.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <sys/dg_sys_info.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5
-$as_echo_n "checking sys/dg_sys_info.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/dg_sys_info.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-$as_echo_n "checking for sys/dg_sys_info.h... " >&6; }
-if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_sys_dg_sys_info_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; }
-
-fi
-if test $ac_cv_header_sys_dg_sys_info_h = yes; then
+ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then :
   ac_have_func=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define DGUX 1
-_ACEOF
-
-
-{ $as_echo "$as_me:$LINENO: checking for dg_sys_info in -ldgc" >&5
+$as_echo "#define DGUX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
 $as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
-if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then
+if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldgc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -18856,43 +11252,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_dgc_dg_sys_info=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_dgc_dg_sys_info=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_dgc_dg_sys_info=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_dg_sys_info" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_dg_sys_info" >&5
 $as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
-if test $ac_cv_lib_dgc_dg_sys_info = yes; then
+if test "x$ac_cv_lib_dgc_dg_sys_info" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDGC 1
 _ACEOF
@@ -18905,230 +11276,18 @@
 
 
 
-if test "${ac_cv_header_locale_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for locale.h" >&5
-$as_echo_n "checking for locale.h... " >&6; }
-if test "${ac_cv_header_locale_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-$as_echo "$ac_cv_header_locale_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking locale.h usability" >&5
-$as_echo_n "checking locale.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <locale.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking locale.h presence" >&5
-$as_echo_n "checking locale.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <locale.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: locale.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: locale.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: locale.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: locale.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: locale.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: locale.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for locale.h" >&5
-$as_echo_n "checking for locale.h... " >&6; }
-if test "${ac_cv_header_locale_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_locale_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-$as_echo "$ac_cv_header_locale_h" >&6; }
-
-fi
-
+ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
+if test "x$ac_cv_header_locale_h" = x""yes; then :
+
+fi
 
 
 for ac_func in setlocale
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale"
+if test "x$ac_cv_func_setlocale" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_SETLOCALE 1
 _ACEOF
 
 fi
@@ -19141,151 +11300,19 @@
 if test $ac_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
   ac_have_func=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define SVR4 1
-_ACEOF
+$as_echo "#define SVR4 1" >>confdefs.h
 
 fi
 
 if test $ac_have_func = no; then
-  if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
-$as_echo_n "checking for inq_stats/cpustats.h... " >&6; }
-if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
-$as_echo "$ac_cv_header_inq_stats_cpustats_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking inq_stats/cpustats.h usability" >&5
-$as_echo_n "checking inq_stats/cpustats.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <inq_stats/cpustats.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking inq_stats/cpustats.h presence" >&5
-$as_echo_n "checking inq_stats/cpustats.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <inq_stats/cpustats.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
-$as_echo_n "checking for inq_stats/cpustats.h... " >&6; }
-if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_inq_stats_cpustats_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
-$as_echo "$ac_cv_header_inq_stats_cpustats_h" >&6; }
-
-fi
-if test $ac_cv_header_inq_stats_cpustats_h = yes; then
+  ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_inq_stats_cpustats_h" = x""yes; then :
   ac_have_func=yes
 
-cat >>confdefs.h <<\_ACEOF
-#define UMAX 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define UMAX4_3 1
-_ACEOF
+$as_echo "#define UMAX 1" >>confdefs.h
+
+
+$as_echo "#define UMAX4_3 1" >>confdefs.h
 
 fi
 
@@ -19293,137 +11320,9 @@
 fi
 
 if test $ac_have_func = no; then
-  if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
-$as_echo_n "checking for sys/cpustats.h... " >&6; }
-if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
-$as_echo "$ac_cv_header_sys_cpustats_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking sys/cpustats.h usability" >&5
-$as_echo_n "checking sys/cpustats.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <sys/cpustats.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking sys/cpustats.h presence" >&5
-$as_echo_n "checking sys/cpustats.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/cpustats.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
-$as_echo_n "checking for sys/cpustats.h... " >&6; }
-if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_sys_cpustats_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
-$as_echo "$ac_cv_header_sys_cpustats_h" >&6; }
-
-fi
-if test $ac_cv_header_sys_cpustats_h = yes; then
-  ac_have_func=yes; cat >>confdefs.h <<\_ACEOF
-#define UMAX 1
-_ACEOF
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_cpustats_h" = x""yes; then :
+  ac_have_func=yes; $as_echo "#define UMAX 1" >>confdefs.h
 
 fi
 
@@ -19431,400 +11330,37 @@
 fi
 
 if test $ac_have_func = no; then
-
-for ac_header in mach/mach.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_header in mach/mach.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_mach_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-fi
-
+#define HAVE_MACH_MACH_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
 
 for ac_header in nlist.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
+if test "x$ac_cv_header_nlist_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- { $as_echo "$as_me:$LINENO: checking for struct nlist.n_un.n_name" >&5
-$as_echo_n "checking for struct nlist.n_un.n_name... " >&6; }
-if test "${ac_cv_member_struct_nlist_n_un_n_name+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <nlist.h>
-
-int
-main ()
-{
-static struct nlist ac_aggr;
-if (ac_aggr.n_un.n_name)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_nlist_n_un_n_name=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <nlist.h>
-
-int
-main ()
-{
-static struct nlist ac_aggr;
-if (sizeof ac_aggr.n_un.n_name)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_struct_nlist_n_un_n_name=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_struct_nlist_n_un_n_name=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_nlist_n_un_n_name" >&5
-$as_echo "$ac_cv_member_struct_nlist_n_un_n_name" >&6; }
-if test $ac_cv_member_struct_nlist_n_un_n_name = yes; then
+#define HAVE_NLIST_H 1
+_ACEOF
+ ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
+"
+if test "x$ac_cv_member_struct_nlist_n_un_n_name" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
 _ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define NLIST_NAME_UNION 1
-_ACEOF
+$as_echo "#define NLIST_NAME_UNION 1" >>confdefs.h
 
 fi
 
@@ -19838,16 +11374,12 @@
 
 
 # Some definitions of getloadavg require that the program be installed setgid.
-{ $as_echo "$as_me:$LINENO: checking whether getloadavg requires setgid" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getloadavg requires setgid" >&5
 $as_echo_n "checking whether getloadavg requires setgid... " >&6; }
-if test "${ac_cv_func_getloadavg_setgid+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_func_getloadavg_setgid+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
 #ifdef LDAV_PRIVILEGED
@@ -19855,7 +11387,7 @@
 #endif
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Yowza Am I SETGID yet" >/dev/null 2>&1; then
+  $EGREP "Yowza Am I SETGID yet" >/dev/null 2>&1; then :
   ac_cv_func_getloadavg_setgid=yes
 else
   ac_cv_func_getloadavg_setgid=no
@@ -19863,23 +11395,21 @@
 rm -f conftest*
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg_setgid" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getloadavg_setgid" >&5
 $as_echo "$ac_cv_func_getloadavg_setgid" >&6; }
 if test $ac_cv_func_getloadavg_setgid = yes; then
   NEED_SETGID=true
 
-cat >>confdefs.h <<\_ACEOF
-#define GETLOADAVG_PRIVILEGED 1
-_ACEOF
+$as_echo "#define GETLOADAVG_PRIVILEGED 1" >>confdefs.h
 
 else
   NEED_SETGID=false
 fi
 
 if test $ac_cv_func_getloadavg_setgid = yes; then
-  { $as_echo "$as_me:$LINENO: checking group of /dev/kmem" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking group of /dev/kmem" >&5
 $as_echo_n "checking group of /dev/kmem... " >&6; }
-if test "${ac_cv_group_kmem+set}" = set; then
+if test "${ac_cv_group_kmem+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
    # On Solaris, /dev/kmem is a symlink.  Get info on the real file.
@@ -19892,7 +11422,7 @@
 	       / /s/.* //;p;'`
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_group_kmem" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_group_kmem" >&5
 $as_echo "$ac_cv_group_kmem" >&6; }
   KMEM_GROUP=$ac_cv_group_kmem
 fi
@@ -19905,17 +11435,13 @@
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_source+set}" = set; then
+if test "${ac_cv_sys_largefile_source+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h> /* for off_t */
      #include <stdio.h>
@@ -19928,43 +11454,12 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_sys_largefile_source=no; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _LARGEFILE_SOURCE 1
 #include <sys/types.h> /* for off_t */
@@ -19978,43 +11473,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_sys_largefile_source=1; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
   ac_cv_sys_largefile_source=unknown
   break
 done
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
 $as_echo "$ac_cv_sys_largefile_source" >&6; }
 case $ac_cv_sys_largefile_source in #(
   no | unknown) ;;
@@ -20031,9 +11499,7 @@
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
 if test $ac_cv_sys_largefile_source != unknown; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_FSEEKO 1
-_ACEOF
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
 
 fi
 
@@ -20061,145 +11527,12 @@
 
 
   GETOPT_H=
-
-for ac_header in getopt.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_header in getopt.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_GETOPT_H 1
 _ACEOF
 
 else
@@ -20209,101 +11542,12 @@
 done
 
   if test -z "$GETOPT_H"; then
-
-for ac_func in getopt_long_only
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_func in getopt_long_only
+do :
+  ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
+if test "x$ac_cv_func_getopt_long_only" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETOPT_LONG_ONLY 1
 _ACEOF
 
 else
@@ -20314,139 +11558,31 @@
   fi
 
       if test -z "$GETOPT_H"; then
-    { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5
-$as_echo_n "checking whether optreset is declared... " >&6; }
-if test "${ac_cv_have_decl_optreset+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <getopt.h>
-
-int
-main ()
-{
-#ifndef optreset
-  (void) optreset;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_optreset=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_optreset=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
-$as_echo "$ac_cv_have_decl_optreset" >&6; }
-if test $ac_cv_have_decl_optreset = yes; then
+    ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include <getopt.h>
+"
+if test "x$ac_cv_have_decl_optreset" = x""yes; then :
   GETOPT_H=getopt.h
 fi
 
   fi
 
       if test -z "$GETOPT_H"; then
-    { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
 $as_echo_n "checking for working GNU getopt function... " >&6; }
-if test "${gl_cv_func_gnu_getopt+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  	 	 	 { $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
-$as_echo_n "checking whether getopt_clip is declared... " >&6; }
-if test "${ac_cv_have_decl_getopt_clip+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <getopt.h>
-
-int
-main ()
-{
-#ifndef getopt_clip
-  (void) getopt_clip;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_have_decl_getopt_clip=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_have_decl_getopt_clip=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
-$as_echo "$ac_cv_have_decl_getopt_clip" >&6; }
-if test $ac_cv_have_decl_getopt_clip = yes; then
+if test "${gl_cv_func_gnu_getopt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  	 	 	 ac_fn_c_check_decl "$LINENO" "getopt_clip" "ac_cv_have_decl_getopt_clip" "#include <getopt.h>
+"
+if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then :
   gl_cv_func_gnu_getopt=no
 else
   gl_cv_func_gnu_getopt=yes
 fi
 
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <getopt.h>
 int
@@ -20463,44 +11599,17 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   gl_cv_func_gnu_getopt=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-gl_cv_func_gnu_getopt=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5
+  gl_cv_func_gnu_getopt=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gnu_getopt" >&5
 $as_echo "$gl_cv_func_gnu_getopt" >&6; }
     if test "$gl_cv_func_gnu_getopt" = "no"; then
       GETOPT_H=getopt.h
@@ -20509,14 +11618,12 @@
 
 
 
-  if test -n "$GETOPT_H"; then
+  if test -n "$GETOPT_H"; then :
 
 
   GETOPT_H=getopt.h
 
-cat >>confdefs.h <<\_ACEOF
-#define __GETOPT_PREFIX rpl_
-_ACEOF
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
@@ -20527,18 +11634,13 @@
 
 
 
-
-{ $as_echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5
 $as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
-if test "${ac_cv_func_getpgrp_void+set}" = set; then
+if test "${ac_cv_func_getpgrp_void+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   # Use it with a single arg.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
@@ -20549,157 +11651,41 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_func_getpgrp_void=no
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_getpgrp_void=yes
-fi
-
+  ac_cv_func_getpgrp_void=yes
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5
 $as_echo "$ac_cv_func_getpgrp_void" >&6; }
 if test $ac_cv_func_getpgrp_void = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GETPGRP_VOID 1
-_ACEOF
-
-fi
-
+$as_echo "#define GETPGRP_VOID 1" >>confdefs.h
+
+fi
 
 
 for ac_func in strftime
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRFTIME 1
 _ACEOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
 $as_echo_n "checking for strftime in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
+if test "${ac_cv_lib_intl_strftime+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -20717,46 +11703,19 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_intl_strftime=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_intl_strftime=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_intl_strftime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
 $as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
+if test "x$ac_cv_lib_intl_strftime" = x""yes; then :
+  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
 
 LIBS="-lintl $LIBS"
 fi
@@ -20766,101 +11725,12 @@
 
 
 # UNIX98 PTYs.
-
 for ac_func in grantpt
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "grantpt" "ac_cv_func_grantpt"
+if test "x$ac_cv_func_grantpt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GRANTPT 1
 _ACEOF
 
 fi
@@ -20868,101 +11738,12 @@
 
 
 # PTY-related GNU extensions.
-
 for ac_func in getpt
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt"
+if test "x$ac_cv_func_getpt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETPT 1
 _ACEOF
 
 fi
@@ -20973,19 +11754,14 @@
 # That is because we have not set up to link ncurses in lib-src.
 # It's better to believe a function is not available
 # than to expect to find it in ncurses.
-
-{ $as_echo "$as_me:$LINENO: checking for tparm in -lncurses" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tparm in -lncurses" >&5
 $as_echo_n "checking for tparm in -lncurses... " >&6; }
-if test "${ac_cv_lib_ncurses_tparm+set}" = set; then
+if test "${ac_cv_lib_ncurses_tparm+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lncurses  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21003,43 +11779,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_ncurses_tparm=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ncurses_tparm=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_ncurses_tparm=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tparm" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tparm" >&5
 $as_echo "$ac_cv_lib_ncurses_tparm" >&6; }
-if test $ac_cv_lib_ncurses_tparm = yes; then
+if test "x$ac_cv_lib_ncurses_tparm" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBNCURSES 1
 _ACEOF
@@ -21052,11 +11803,7 @@
 # Do we have res_init, for detecting changes in /etc/resolv.conf?
 
 resolv=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
 #include <arpa/nameser.h>
@@ -21069,48 +11816,19 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   have_res_init=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	have_res_init=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  have_res_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 if test "$have_res_init" = no; then
   OLIBS="$LIBS"
   LIBS="$LIBS -lresolv"
-  { $as_echo "$as_me:$LINENO: checking for res_init with -lresolv" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_init with -lresolv" >&5
 $as_echo_n "checking for res_init with -lresolv... " >&6; }
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
 #include <arpa/nameser.h>
@@ -21123,39 +11841,14 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   have_res_init=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	have_res_init=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  { $as_echo "$as_me:$LINENO: result: $have_res_init" >&5
+  have_res_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_res_init" >&5
 $as_echo "$have_res_init" >&6; }
   if test "$have_res_init" = yes ; then
     resolv=yes
@@ -21165,203 +11858,29 @@
 
 if test "$have_res_init" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RES_INIT 1
-_ACEOF
+$as_echo "#define HAVE_RES_INIT 1" >>confdefs.h
 
 fi
 
 # Do we need the Hesiod library to provide the support routines?
 if test "$with_hesiod" != no ; then
   # Don't set $LIBS here -- see comments above.
-  { $as_echo "$as_me:$LINENO: checking for res_send" >&5
-$as_echo_n "checking for res_send... " >&6; }
-if test "${ac_cv_func_res_send+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define res_send to an innocuous variant, in case <limits.h> declares res_send.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define res_send innocuous_res_send
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char res_send (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef res_send
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char res_send ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_res_send || defined __stub___res_send
-choke me
-#endif
-
-int
-main ()
-{
-return res_send ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_res_send=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_res_send=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_res_send" >&5
-$as_echo "$ac_cv_func_res_send" >&6; }
-if test $ac_cv_func_res_send = yes; then
-  :
-else
-  { $as_echo "$as_me:$LINENO: checking for __res_send" >&5
-$as_echo_n "checking for __res_send... " >&6; }
-if test "${ac_cv_func___res_send+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define __res_send to an innocuous variant, in case <limits.h> declares __res_send.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define __res_send innocuous___res_send
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char __res_send (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef __res_send
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char __res_send ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub___res_send || defined __stub_____res_send
-choke me
-#endif
-
-int
-main ()
-{
-return __res_send ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func___res_send=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func___res_send=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___res_send" >&5
-$as_echo "$ac_cv_func___res_send" >&6; }
-if test $ac_cv_func___res_send = yes; then
-  :
-else
-  { $as_echo "$as_me:$LINENO: checking for res_send in -lresolv" >&5
+  ac_fn_c_check_func "$LINENO" "res_send" "ac_cv_func_res_send"
+if test "x$ac_cv_func_res_send" = x""yes; then :
+
+else
+  ac_fn_c_check_func "$LINENO" "__res_send" "ac_cv_func___res_send"
+if test "x$ac_cv_func___res_send" = x""yes; then :
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_send in -lresolv" >&5
 $as_echo_n "checking for res_send in -lresolv... " >&6; }
-if test "${ac_cv_lib_resolv_res_send+set}" = set; then
+if test "${ac_cv_lib_resolv_res_send+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21379,57 +11898,28 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_resolv_res_send=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_resolv_res_send=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_resolv_res_send=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_send" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_send" >&5
 $as_echo "$ac_cv_lib_resolv_res_send" >&6; }
-if test $ac_cv_lib_resolv_res_send = yes; then
+if test "x$ac_cv_lib_resolv_res_send" = x""yes; then :
   resolv=yes
 else
-  { $as_echo "$as_me:$LINENO: checking for __res_send in -lresolv" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_send in -lresolv" >&5
 $as_echo_n "checking for __res_send in -lresolv... " >&6; }
-if test "${ac_cv_lib_resolv___res_send+set}" = set; then
+if test "${ac_cv_lib_resolv___res_send+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21447,43 +11937,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_resolv___res_send=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_resolv___res_send=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_resolv___res_send=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv___res_send" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___res_send" >&5
 $as_echo "$ac_cv_lib_resolv___res_send" >&6; }
-if test $ac_cv_lib_resolv___res_send = yes; then
+if test "x$ac_cv_lib_resolv___res_send" = x""yes; then :
   resolv=yes
 fi
 
@@ -21498,106 +11963,18 @@
   else
     RESOLVLIB=
   fi
-  { $as_echo "$as_me:$LINENO: checking for hes_getmailhost" >&5
-$as_echo_n "checking for hes_getmailhost... " >&6; }
-if test "${ac_cv_func_hes_getmailhost+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define hes_getmailhost to an innocuous variant, in case <limits.h> declares hes_getmailhost.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define hes_getmailhost innocuous_hes_getmailhost
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char hes_getmailhost (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef hes_getmailhost
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char hes_getmailhost ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_hes_getmailhost || defined __stub___hes_getmailhost
-choke me
-#endif
-
-int
-main ()
-{
-return hes_getmailhost ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_hes_getmailhost=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_hes_getmailhost=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_hes_getmailhost" >&5
-$as_echo "$ac_cv_func_hes_getmailhost" >&6; }
-if test $ac_cv_func_hes_getmailhost = yes; then
-  :
-else
-  { $as_echo "$as_me:$LINENO: checking for hes_getmailhost in -lhesiod" >&5
+  ac_fn_c_check_func "$LINENO" "hes_getmailhost" "ac_cv_func_hes_getmailhost"
+if test "x$ac_cv_func_hes_getmailhost" = x""yes; then :
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hes_getmailhost in -lhesiod" >&5
 $as_echo_n "checking for hes_getmailhost in -lhesiod... " >&6; }
-if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then
+if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lhesiod $RESOLVLIB $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21615,47 +11992,20 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_hesiod_hes_getmailhost=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_hesiod_hes_getmailhost=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_hesiod_hes_getmailhost=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
 $as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
-if test $ac_cv_lib_hesiod_hes_getmailhost = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBHESIOD 1
-_ACEOF
+if test "x$ac_cv_lib_hesiod_hes_getmailhost" = x""yes; then :
+
+$as_echo "#define HAVE_LIBHESIOD 1" >>confdefs.h
 
 else
   :
@@ -21668,27 +12018,20 @@
 # Do we need libresolv (due to res_init or Hesiod)?
 if test "$resolv" = yes ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
+$as_echo "#define HAVE_LIBRESOLV 1" >>confdefs.h
 
 fi
 
 # These tell us which Kerberos-related libraries to use.
 if test "${with_kerberos}" != no; then
-
-{ $as_echo "$as_me:$LINENO: checking for com_err in -lcom_err" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5
 $as_echo_n "checking for com_err in -lcom_err... " >&6; }
-if test "${ac_cv_lib_com_err_com_err+set}" = set; then
+if test "${ac_cv_lib_com_err_com_err+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcom_err  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21706,43 +12049,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_com_err_com_err=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_com_err_com_err=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_com_err_com_err=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_com_err_com_err" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5
 $as_echo "$ac_cv_lib_com_err_com_err" >&6; }
-if test $ac_cv_lib_com_err_com_err = yes; then
+if test "x$ac_cv_lib_com_err_com_err" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCOM_ERR 1
 _ACEOF
@@ -21751,94 +12069,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
 $as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
-if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then
+if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lk5crypto  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char mit_des_cbc_encrypt ();
-int
-main ()
-{
-return mit_des_cbc_encrypt ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
-$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_k5crypto_mit_des_cbc_encrypt = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBK5CRYPTO 1
-_ACEOF
-
-  LIBS="-lk5crypto $LIBS"
-
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lcrypto" >&5
-$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21856,43 +12094,63 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
+else
+  ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
+$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
+if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBK5CRYPTO 1
+_ACEOF
+
+  LIBS="-lk5crypto $LIBS"
+
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lcrypto" >&5
+$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
+if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mit_des_cbc_encrypt ();
+int
+main ()
+{
+return mit_des_cbc_encrypt ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_crypto_mit_des_cbc_encrypt=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_crypto_mit_des_cbc_encrypt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_crypto_mit_des_cbc_encrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_crypto_mit_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -21901,19 +12159,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lkrb5" >&5
 $as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
-if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
+if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkrb5  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -21931,43 +12184,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_krb5_krb5_init_context=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_krb5_krb5_init_context=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_krb5_krb5_init_context=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_init_context" >&5
 $as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
-if test $ac_cv_lib_krb5_krb5_init_context = yes; then
+if test "x$ac_cv_lib_krb5_krb5_init_context" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKRB5 1
 _ACEOF
@@ -21977,19 +12205,14 @@
 fi
 
   if test "${with_kerberos5}" = no; then
-
-{ $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes425" >&5
 $as_echo_n "checking for des_cbc_encrypt in -ldes425... " >&6; }
-if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then
+if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldes425  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -22007,43 +12230,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_des425_des_cbc_encrypt=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_des425_des_cbc_encrypt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_des425_des_cbc_encrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_des425_des_cbc_encrypt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDES425 1
 _ACEOF
@@ -22051,19 +12249,14 @@
   LIBS="-ldes425 $LIBS"
 
 else
-
-{ $as_echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes" >&5
 $as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
-if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then
+if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldes  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -22081,43 +12274,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_des_des_cbc_encrypt=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_des_des_cbc_encrypt=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_des_des_cbc_encrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
 $as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
-if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
+if test "x$ac_cv_lib_des_des_cbc_encrypt" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDES 1
 _ACEOF
@@ -22128,93 +12296,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb4" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb4" >&5
 $as_echo_n "checking for krb_get_cred in -lkrb4... " >&6; }
-if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then
+if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lkrb4  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char krb_get_cred ();
-int
-main ()
-{
-return krb_get_cred ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_krb4_krb_get_cred=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_krb4_krb_get_cred=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_krb_get_cred" >&5
-$as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
-if test $ac_cv_lib_krb4_krb_get_cred = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB4 1
-_ACEOF
-
-  LIBS="-lkrb4 $LIBS"
-
-else
-
-{ $as_echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb" >&5
-$as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
-if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -22232,43 +12321,62 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_krb4_krb_get_cred=yes
+else
+  ac_cv_lib_krb4_krb_get_cred=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb4_krb_get_cred" >&5
+$as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
+if test "x$ac_cv_lib_krb4_krb_get_cred" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKRB4 1
+_ACEOF
+
+  LIBS="-lkrb4 $LIBS"
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb" >&5
+$as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
+if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb_get_cred ();
+int
+main ()
+{
+return krb_get_cred ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_krb_krb_get_cred=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_krb_krb_get_cred=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_krb_krb_get_cred=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb_krb_get_cred" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb_krb_get_cred" >&5
 $as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
-if test $ac_cv_lib_krb_krb_get_cred = yes; then
+if test "x$ac_cv_lib_krb_krb_get_cred" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKRB 1
 _ACEOF
@@ -22282,244 +12390,16 @@
   fi
 
   if test "${with_kerberos5}" != no; then
-
-for ac_header in krb5.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_header in krb5.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
+if test "x$ac_cv_header_krb5_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- { $as_echo "$as_me:$LINENO: checking for krb5_error.text" >&5
-$as_echo_n "checking for krb5_error.text... " >&6; }
-if test "${ac_cv_member_krb5_error_text+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <krb5.h>
-
-int
-main ()
-{
-static krb5_error ac_aggr;
-if (ac_aggr.text)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_krb5_error_text=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <krb5.h>
-
-int
-main ()
-{
-static krb5_error ac_aggr;
-if (sizeof ac_aggr.text)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_krb5_error_text=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_krb5_error_text=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_text" >&5
-$as_echo "$ac_cv_member_krb5_error_text" >&6; }
-if test $ac_cv_member_krb5_error_text = yes; then
+#define HAVE_KRB5_H 1
+_ACEOF
+ ac_fn_c_check_member "$LINENO" "krb5_error" "text" "ac_cv_member_krb5_error_text" "#include <krb5.h>
+"
+if test "x$ac_cv_member_krb5_error_text" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_TEXT 1
@@ -22527,104 +12407,9 @@
 
 
 fi
-{ $as_echo "$as_me:$LINENO: checking for krb5_error.e_text" >&5
-$as_echo_n "checking for krb5_error.e_text... " >&6; }
-if test "${ac_cv_member_krb5_error_e_text+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <krb5.h>
-
-int
-main ()
-{
-static krb5_error ac_aggr;
-if (ac_aggr.e_text)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_krb5_error_e_text=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <krb5.h>
-
-int
-main ()
-{
-static krb5_error ac_aggr;
-if (sizeof ac_aggr.e_text)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_member_krb5_error_e_text=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_member_krb5_error_e_text=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_e_text" >&5
-$as_echo "$ac_cv_member_krb5_error_e_text" >&6; }
-if test $ac_cv_member_krb5_error_e_text = yes; then
+ac_fn_c_check_member "$LINENO" "krb5_error" "e_text" "ac_cv_member_krb5_error_e_text" "#include <krb5.h>
+"
+if test "x$ac_cv_member_krb5_error_e_text" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_KRB5_ERROR_E_TEXT 1
@@ -22638,1020 +12423,89 @@
 done
 
   else
-
-for ac_header in des.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+    for ac_header in des.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "des.h" "ac_cv_header_des_h" "$ac_includes_default"
+if test "x$ac_cv_header_des_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
-
-for ac_header in kerberosIV/des.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_DES_H 1
+_ACEOF
+
+else
+  for ac_header in kerberosIV/des.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/des.h" "ac_cv_header_kerberosIV_des_h" "$ac_includes_default"
+if test "x$ac_cv_header_kerberosIV_des_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
-
-for ac_header in kerberos/des.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_KERBEROSIV_DES_H 1
+_ACEOF
+
+else
+  for ac_header in kerberos/des.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "kerberos/des.h" "ac_cv_header_kerberos_des_h" "$ac_includes_default"
+if test "x$ac_cv_header_kerberos_des_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-fi
-
-done
-
-fi
-
-done
-
-
-for ac_header in krb.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_KERBEROS_DES_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+done
+
+fi
+
+done
+
+    for ac_header in krb.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "krb.h" "ac_cv_header_krb_h" "$ac_includes_default"
+if test "x$ac_cv_header_krb_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
-
-for ac_header in kerberosIV/krb.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_KRB_H 1
+_ACEOF
+
+else
+  for ac_header in kerberosIV/krb.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/krb.h" "ac_cv_header_kerberosIV_krb_h" "$ac_includes_default"
+if test "x$ac_cv_header_kerberosIV_krb_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
-
-for ac_header in kerberos/krb.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_KERBEROSIV_KRB_H 1
+_ACEOF
+
+else
+  for ac_header in kerberos/krb.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "kerberos/krb.h" "ac_cv_header_kerberos_krb_h" "$ac_includes_default"
+if test "x$ac_cv_header_kerberos_krb_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-fi
-
-done
-
-fi
-
-done
-
-  fi
-
-for ac_header in com_err.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+#define HAVE_KERBEROS_KRB_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+done
+
+fi
+
+done
+
+  fi
+  for ac_header in com_err.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "com_err.h" "ac_cv_header_com_err_h" "$ac_includes_default"
+if test "x$ac_cv_header_com_err_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_COM_ERR_H 1
 _ACEOF
 
 fi
@@ -23662,19 +12516,14 @@
 
 # Solaris requires -lintl if you want strerror (which calls dgettext)
 # to return localized messages.
-
-{ $as_echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
 $as_echo_n "checking for dgettext in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_dgettext+set}" = set; then
+if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -23692,43 +12541,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_intl_dgettext=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_intl_dgettext=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_lib_intl_dgettext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
 $as_echo "$ac_cv_lib_intl_dgettext" >&6; }
-if test $ac_cv_lib_intl_dgettext = yes; then
+if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBINTL 1
 _ACEOF
@@ -23738,21 +12562,17 @@
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking whether localtime caches TZ" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
 $as_echo_n "checking whether localtime caches TZ... " >&6; }
-if test "${emacs_cv_localtime_cache+set}" = set; then
+if test "${emacs_cv_localtime_cache+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test x$ac_cv_func_tzset = xyes; then
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = yes; then :
   # If we have tzset, assume the worst when cross-compiling.
 emacs_cv_localtime_cache=yes
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
 extern char **environ;
@@ -23784,41 +12604,14 @@
   exit (0);
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   emacs_cv_localtime_cache=no
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-emacs_cv_localtime_cache=yes
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+  emacs_cv_localtime_cache=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 else
 	# If we lack tzset, report that localtime does not cache TZ,
@@ -23826,128 +12619,33 @@
 	emacs_cv_localtime_cache=no
 fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_localtime_cache" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_localtime_cache" >&5
 $as_echo "$emacs_cv_localtime_cache" >&6; }
 if test $emacs_cv_localtime_cache = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define LOCALTIME_CACHE 1
-_ACEOF
+$as_echo "#define LOCALTIME_CACHE 1" >>confdefs.h
 
 fi
 
 if test "x$HAVE_TIMEVAL" = xyes; then
-
-for ac_func in gettimeofday
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+  for ac_func in gettimeofday
+do :
+  ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
+if test "x$ac_cv_func_gettimeofday" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETTIMEOFDAY 1
 _ACEOF
 
 fi
 done
 
   if test $ac_cv_func_gettimeofday = yes; then
-    { $as_echo "$as_me:$LINENO: checking whether gettimeofday can accept two arguments" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday can accept two arguments" >&5
 $as_echo_n "checking whether gettimeofday can accept two arguments... " >&6; }
-if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #ifdef TIME_WITH_SYS_TIME
@@ -23969,268 +12667,35 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_gettimeofday_two_arguments=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_gettimeofday_two_arguments=no
-fi
-
+  emacs_cv_gettimeofday_two_arguments=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_gettimeofday_two_arguments" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_gettimeofday_two_arguments" >&5
 $as_echo "$emacs_cv_gettimeofday_two_arguments" >&6; }
     if test $emacs_cv_gettimeofday_two_arguments = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GETTIMEOFDAY_ONE_ARGUMENT 1
-_ACEOF
+$as_echo "#define GETTIMEOFDAY_ONE_ARGUMENT 1" >>confdefs.h
 
     fi
   fi
 fi
 
 ok_so_far=yes
-{ $as_echo "$as_me:$LINENO: checking for socket" >&5
-$as_echo_n "checking for socket... " >&6; }
-if test "${ac_cv_func_socket+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define socket to an innocuous variant, in case <limits.h> declares socket.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define socket innocuous_socket
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char socket (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef socket
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_socket || defined __stub___socket
-choke me
-#endif
-
-int
-main ()
-{
-return socket ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_socket=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_socket=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
-$as_echo "$ac_cv_func_socket" >&6; }
-if test $ac_cv_func_socket = yes; then
-  :
+ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
+if test "x$ac_cv_func_socket" = x""yes; then :
+
 else
   ok_so_far=no
 fi
 
 if test $ok_so_far = yes; then
-  if test "${ac_cv_header_netinet_in_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for netinet/in.h" >&5
-$as_echo_n "checking for netinet/in.h... " >&6; }
-if test "${ac_cv_header_netinet_in_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
-$as_echo "$ac_cv_header_netinet_in_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking netinet/in.h usability" >&5
-$as_echo_n "checking netinet/in.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <netinet/in.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking netinet/in.h presence" >&5
-$as_echo_n "checking netinet/in.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <netinet/in.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: netinet/in.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: netinet/in.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for netinet/in.h" >&5
-$as_echo_n "checking for netinet/in.h... " >&6; }
-if test "${ac_cv_header_netinet_in_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_netinet_in_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
-$as_echo "$ac_cv_header_netinet_in_h" >&6; }
-
-fi
-if test $ac_cv_header_netinet_in_h = yes; then
-  :
+  ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = x""yes; then :
+
 else
   ok_so_far=no
 fi
@@ -24238,135 +12703,9 @@
 
 fi
 if test $ok_so_far = yes; then
-  if test "${ac_cv_header_arpa_inet_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
-$as_echo_n "checking for arpa/inet.h... " >&6; }
-if test "${ac_cv_header_arpa_inet_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
-$as_echo "$ac_cv_header_arpa_inet_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5
-$as_echo_n "checking arpa/inet.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <arpa/inet.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5
-$as_echo_n "checking arpa/inet.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <arpa/inet.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
-$as_echo_n "checking for arpa/inet.h... " >&6; }
-if test "${ac_cv_header_arpa_inet_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_arpa_inet_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
-$as_echo "$ac_cv_header_arpa_inet_h" >&6; }
-
-fi
-if test $ac_cv_header_arpa_inet_h = yes; then
-  :
+  ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default"
+if test "x$ac_cv_header_arpa_inet_h" = x""yes; then :
+
 else
   ok_so_far=no
 fi
@@ -24375,151 +12714,16 @@
 fi
 if test $ok_so_far = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INET_SOCKETS 1
-_ACEOF
-
-fi
-
+$as_echo "#define HAVE_INET_SOCKETS 1" >>confdefs.h
+
+fi
 
 for ac_header in sys/ioctl.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_ioctl_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SYS_IOCTL_H 1
 _ACEOF
 
 fi
@@ -24529,123 +12733,26 @@
 
 if test -f /usr/lpp/X11/bin/smt.exp; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AIX_SMT_EXP 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether system supports dynamic ptys" >&5
+$as_echo "#define HAVE_AIX_SMT_EXP 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system supports dynamic ptys" >&5
 $as_echo_n "checking whether system supports dynamic ptys... " >&6; }
 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DEV_PTMX 1
-_ACEOF
-
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
-$as_echo_n "checking for pid_t... " >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_pid_t=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof (pid_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof ((pid_t)))
-	  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_pid_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-$as_echo "$ac_cv_type_pid_t" >&6; }
-if test $ac_cv_type_pid_t = yes; then
-  :
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = x""yes; then :
+
 else
 
 cat >>confdefs.h <<_ACEOF
@@ -24654,245 +12761,23 @@
 
 fi
 
-
 for ac_header in vfork.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
+if test "x$ac_cv_header_vfork_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
+#define HAVE_VFORK_H 1
+_ACEOF
+
+fi
+
+done
 
 for ac_func in fork vfork
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -24901,19 +12786,15 @@
 done
 
 if test "x$ac_cv_func_fork" = xyes; then
-  { $as_echo "$as_me:$LINENO: checking for working fork" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
+if test "${ac_cv_func_fork_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_fork_works=cross
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
@@ -24927,44 +12808,17 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_fork_works=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_fork_works=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+  ac_cv_func_fork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
 $as_echo "$ac_cv_func_fork_works" >&6; }
 
 else
@@ -24980,24 +12834,20 @@
       ac_cv_func_fork_works=yes
       ;;
   esac
-  { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
 fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 if test "x$ac_cv_func_vfork" = xyes; then
-  { $as_echo "$as_me:$LINENO: checking for working vfork" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
+if test "${ac_cv_func_vfork_works+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
   ac_cv_func_vfork_works=cross
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 /* Thanks to Paul Eggert for this test.  */
 $ac_includes_default
@@ -25089,85 +12939,48 @@
   }
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_func_vfork_works=yes
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_vfork_works=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+  ac_cv_func_vfork_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
 $as_echo "$ac_cv_func_vfork_works" >&6; }
 
 fi;
 if test "x$ac_cv_func_fork_works" = xcross; then
   ac_cv_func_vfork_works=$ac_cv_func_vfork
-  { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
 fi
 
 if test "x$ac_cv_func_vfork_works" = xyes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_VFORK 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define vfork fork
-_ACEOF
+$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
+
+else
+
+$as_echo "#define vfork fork" >>confdefs.h
 
 fi
 if test "x$ac_cv_func_fork_works" = xyes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_FORK 1
-_ACEOF
-
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if test "${emacs_cv_langinfo_codeset+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_langinfo_codeset+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <langinfo.h>
 int
@@ -25178,145 +12991,25 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   emacs_cv_langinfo_codeset=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_langinfo_codeset=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_langinfo_codeset" >&5
+  emacs_cv_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_langinfo_codeset" >&5
 $as_echo "$emacs_cv_langinfo_codeset" >&6; }
 if test $emacs_cv_langinfo_codeset = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LANGINFO_CODESET 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
-$as_echo_n "checking for size_t... " >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_size_t=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof (size_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if (sizeof ((size_t)))
-	  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_size_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-$as_echo "$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
+$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_SIZE_T 1
@@ -25326,16 +13019,12 @@
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for mbstate_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
-if test "${ac_cv_type_mbstate_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${ac_cv_type_mbstate_t+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 #	    include <wchar.h>
@@ -25347,60 +13036,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_type_mbstate_t=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_mbstate_t=no
-fi
-
+  ac_cv_type_mbstate_t=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
 $as_echo "$ac_cv_type_mbstate_t" >&6; }
    if test $ac_cv_type_mbstate_t = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MBSTATE_T 1
-_ACEOF
+$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
 
    else
 
-cat >>confdefs.h <<\_ACEOF
-#define mbstate_t int
-_ACEOF
+$as_echo "#define mbstate_t int" >>confdefs.h
 
    fi
 
-{ $as_echo "$as_me:$LINENO: checking for C restrict keyword" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restrict keyword" >&5
 $as_echo_n "checking for C restrict keyword... " >&6; }
-if test "${emacs_cv_c_restrict+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_c_restrict+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 void fred (int *restrict x);
 int
@@ -25411,34 +13071,10 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_c_restrict=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 void fred (int *__restrict x);
 int
@@ -25449,38 +13085,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_c_restrict=__restrict
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_c_restrict=no
-fi
-
+  emacs_cv_c_restrict=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_c_restrict" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_c_restrict" >&5
 $as_echo "$emacs_cv_c_restrict" >&6; }
 case "$emacs_cv_c_restrict" in
   yes) emacs_restrict=restrict;;
@@ -25495,16 +13109,12 @@
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for C restricted array declarations" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restricted array declarations" >&5
 $as_echo_n "checking for C restricted array declarations... " >&6; }
-if test "${emacs_cv_c_restrict_arr+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if test "${emacs_cv_c_restrict_arr+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 void fred (int x[__restrict]);
 int
@@ -25515,41 +13125,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   emacs_cv_c_restrict_arr=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	emacs_cv_c_restrict_arr=no
-fi
-
+  emacs_cv_c_restrict_arr=no
+fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $emacs_cv_c_restrict_arr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_c_restrict_arr" >&5
 $as_echo "$emacs_cv_c_restrict_arr" >&6; }
 if test "$emacs_cv_c_restrict_arr" = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define __restrict_arr __restrict
-_ACEOF
+$as_echo "#define __restrict_arr __restrict" >>confdefs.h
 
 fi
 
@@ -25564,21 +13151,17 @@
    && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
    && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
    && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
-   { { $as_echo "$as_me:$LINENO: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&5
-$as_echo "$as_me: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&2;}
-   { (exit 1); exit 1; }; }
+   as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
 fi
 
 #### Find out which version of Emacs this is.
 version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 if test x"${version}" = x; then
-  { { $as_echo "$as_me:$LINENO: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&5
-$as_echo "$as_me: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "can't find current emacs version in \`${srcdir}/lisp/version.el'." "$LINENO" 5
 fi
 if test x"${version}" != x"$PACKAGE_VERSION"; then
-  { $as_echo "$as_me:$LINENO: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&5
 $as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&2;}
 fi
 
@@ -25670,61 +13253,43 @@
 
 if test "${HAVE_X_WINDOWS}" = "yes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X_WINDOWS 1
-_ACEOF
+$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h
 
 fi
 if test "${USE_X_TOOLKIT}" != "none" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_X_TOOLKIT 1
-_ACEOF
+$as_echo "#define USE_X_TOOLKIT 1" >>confdefs.h
 
   if test "${USE_X_TOOLKIT}" = "LUCID"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_LUCID 1
-_ACEOF
+$as_echo "#define USE_LUCID 1" >>confdefs.h
 
   elif test "${USE_X_TOOLKIT}" = "MOTIF"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_MOTIF 1
-_ACEOF
+$as_echo "#define USE_MOTIF 1" >>confdefs.h
 
   fi
 fi
 if test "${HAVE_X11}" = "yes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_X11 1
-_ACEOF
+$as_echo "#define HAVE_X11 1" >>confdefs.h
 
 fi
 if test "${HAVE_MENUS}" = "yes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MENUS 1
-_ACEOF
+$as_echo "#define HAVE_MENUS 1" >>confdefs.h
 
 fi
 if test "${GNU_MALLOC}" = "yes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GNU_MALLOC 1
-_ACEOF
+$as_echo "#define GNU_MALLOC 1" >>confdefs.h
 
 fi
 if test "${REL_ALLOC}" = "yes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define REL_ALLOC 1
-_ACEOF
-
-fi
-
-
+$as_echo "#define REL_ALLOC 1" >>confdefs.h
+
+fi
 
 
 
@@ -25820,7 +13385,7 @@
 # the C preprocessor to some helpful value like 1, or maybe the empty
 # string.  Needless to say consequent macro substitutions are less
 # than conducive to the makefile finding the correct directory.
-cpp_undefs="`echo $srcdir $configuration $canonical |
+cpp_undefs="`echo $srcdir $configuration $canonical unix |
   sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/  *$//' \
   -e 's/  */ -U/g' -e 's/-U[0-9][^ ]*//g'`"
 
@@ -25829,16 +13394,12 @@
 ## from Makefile.c can correctly provide the arg `-traditional' to the
 ## C preprocessor.
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 yes..yes
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes..yes" >/dev/null 2>&1; then
+  $EGREP "yes..yes" >/dev/null 2>&1; then :
   CPP_NEED_TRADITIONAL=no
 else
   CPP_NEED_TRADITIONAL=yes
@@ -25877,13 +13438,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -25891,8 +13452,8 @@
   (set) 2>&1 |
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
     *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -25915,11 +13476,11 @@
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
@@ -25933,14 +13494,15 @@
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -25952,9 +13514,10 @@
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -25964,17 +13527,18 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
+
 SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -25982,22 +13546,14 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+fi
+
 
 as_nl='
 '
@@ -26006,7 +13562,13 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -26017,7 +13579,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -26040,13 +13602,6 @@
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -26056,15 +13611,15 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -26076,12 +13631,16 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -26093,7 +13652,89 @@
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -26107,8 +13748,12 @@
   as_basename=false
 fi
 
-
-# Name of the executable.
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -26128,76 +13773,25 @@
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
-
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -26226,8 +13820,56 @@
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -26246,10 +13888,10 @@
       if test -d "$1"; then
 	test -d "$1/.";
       else
-	case $1 in
+	case $1 in #(
 	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -26264,13 +13906,19 @@
 
 
 exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by emacs $as_me 23.2, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+This file was extended by emacs $as_me 23.2.50, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -26283,6 +13931,15 @@
 
 _ACEOF
 
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
@@ -26293,19 +13950,22 @@
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
+      --file=FILE[:TEMPLATE]
                    instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
+      --header=FILE[:TEMPLATE]
                    instantiate the configuration header FILE
 
 Configuration files:
@@ -26317,16 +13977,17 @@
 Configuration commands:
 $config_commands
 
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to the package provider."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-emacs config.status 23.2
-configured by $0, generated by GNU Autoconf 2.62,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2008 Free Software Foundation, Inc.
+emacs config.status 23.2.50
+configured by $0, generated by GNU Autoconf 2.67,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -26342,11 +14003,16 @@
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -26360,27 +14026,29 @@
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { $as_echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; };;
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
@@ -26388,11 +14056,10 @@
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { $as_echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1"
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
@@ -26457,9 +14124,7 @@
     "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
-  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -26486,7 +14151,7 @@
   trap 'exit_status=$?
   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
@@ -26497,11 +14162,7 @@
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} ||
-{
-   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -26509,7 +14170,13 @@
 if test -n "$CONFIG_FILES"; then
 
 
-ac_cr='
'
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
   ac_cs_awk_cr='\\r'
@@ -26526,23 +14193,18 @@
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -26564,7 +14226,7 @@
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -26578,7 +14240,7 @@
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
@@ -26631,22 +14293,28 @@
 else
   cat
 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-   { (exit 1); exit 1; }; }
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_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[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  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
@@ -26674,9 +14342,7 @@
   if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -26742,9 +14408,9 @@
   }
   split(mac1, mac2, "(") #)
   macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
   if (D_is_set[macro]) {
     # Preserve the white space surrounding the "#".
-    prefix = substr(line, 1, index(line, defundef) - 1)
     print prefix "define", macro P[macro] D[macro]
     next
   } else {
@@ -26752,7 +14418,7 @@
     # in the case of _POSIX_SOURCE, which is predefined and required
     # on some systems where configure will not decide to define it.
     if (defundef == "undef") {
-      print "/*", line, "*/"
+      print "/*", prefix defundef, macro, "*/"
       next
     }
   }
@@ -26761,9 +14427,7 @@
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
-$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -26776,9 +14440,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
-   { (exit 1); exit 1; }; };;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -26806,12 +14468,10 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
+      as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
@@ -26822,7 +14482,7 @@
 	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
 $as_echo "$as_me: creating $ac_file" >&6;}
     fi
     # Neutralize special characters interpreted by sed in replacement strings.
@@ -26835,9 +14495,7 @@
 
     case $ac_tag in
     *:-:* | *:-) cat >"$tmp/stdin" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; } ;;
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -26865,47 +14523,7 @@
 	    q
 	  }
 	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
 case "$ac_dir" in
@@ -26957,7 +14575,6 @@
 # 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=
-
 ac_sed_dataroot='
 /datarootdir/ {
   p
@@ -26967,12 +14584,11 @@
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p
-'
+/@mandir@/p'
 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -26982,7 +14598,7 @@
   s&@infodir@&$infodir&g
   s&@localedir@&$localedir&g
   s&@mandir@&$mandir&g
-    s&\\\${datarootdir}&$datarootdir&g' ;;
+  s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
 
@@ -27010,26 +14626,22 @@
 $ac_datarootdir_hack
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
   -) cat "$tmp/out" && rm -f "$tmp/out";;
   *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -27040,29 +14652,23 @@
       $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
     } >"$tmp/config.h" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
       mv "$tmp/config.h" "$ac_file" \
-	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
-$as_echo "$as_me: error: could not create -" >&2;}
-   { (exit 1); exit 1; }; }
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
-  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
 $as_echo "$as_me: executing $ac_file commands" >&6;}
  ;;
   esac
@@ -27133,15 +14739,12 @@
 done # for ac_tag
 
 
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
+as_fn_exit 0
+_ACEOF
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -27162,11 +14765,11 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
--- a/doc/emacs/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,27 @@
+2010-09-14  Glenn Morris  <rgm@gnu.org>
+
+	* cal-xtra.texi (Fancy Diary Display): Emphasize that sort should be
+	the last hook item.
+
+	* calendar.texi (Appointments): Also updated when a diary include file
+	is saved.
+
+2010-09-12  Glenn Morris  <rgm@gnu.org>
+
+	* trouble.texi (Bugs): Update the section intro.
+	(Known Problems): New section.
+	(Checklist): Misc updates.  Prefer M-x report-emacs-bug.
+	(Sending Patches): Bug fixes are best as responses to existing bugs.
+	* emacs.texi (Known Problems): Add menu entry for new section.
+
+2010-09-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* dired.texi (Dired Enter): Minor doc fix (Bug#6982).
+
+2010-09-02  Glenn Morris  <rgm@gnu.org>
+
+	* misc.texi (Saving Emacs Sessions): Mention desktop-path.  (Bug#6948)
+
 2010-08-21  Glenn Morris  <rgm@gnu.org>
 
 	* misc.texi (Amusements): Mention bubbles and animate.
@@ -123,7 +147,7 @@
 
 	* custom.texi (Init Examples): Add xref to Mail Header.
 
-	* emacs.texi (Top):  Fix xrefs.
+	* emacs.texi (Top): Fix xrefs.
 
 2010-03-25  Chong Yidong  <cyd@stupidchicken.com>
 
--- a/doc/emacs/cal-xtra.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/cal-xtra.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -613,7 +613,9 @@
 @noindent
 For each day, this sorts diary entries that begin with a recognizable
 time of day according to their times.  Diary entries without times come
-first within each day.
+first within each day.  Note how the sort command is placed at the end
+of the hook list, in case earlier members of the list change the order
+of the diary entries, or add items.
 
 @vindex diary-include-string
   Your main diary file can include other files.  This permits a group of
--- a/doc/emacs/calendar.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/calendar.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -1508,7 +1508,14 @@
 time by re-enabling appointment notification.  Both these actions also
 display the day's diary buffer, unless you set
 @code{appt-display-diary} to @code{nil}.  The appointments list is
-also updated whenever the diary file is saved.
+also updated whenever the diary file (or a file it includes; see
+@iftex
+@inforef{Fancy Diary Display,, emacs-xtra})
+@end iftex
+@ifnottex
+@ref{Fancy Diary Display})
+@end ifnottex
+is saved.
 
 @findex appt-add
 @findex appt-delete
--- a/doc/emacs/dired.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/dired.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -75,13 +75,12 @@
 
   The variable @code{dired-listing-switches} specifies the options to
 give to @code{ls} for listing the directory; this string @emph{must}
-contain @samp{-l}.  If you use a numeric prefix argument with the
-@code{dired} command, you can specify the @code{ls} switches with the
-minibuffer before you enter the directory specification.  No matter
-how they are specified, the @code{ls} switches can include short
-options (that is, single characters) requiring no arguments, and long
-options (starting with @samp{--}) whose arguments are specified with
-@samp{=}.
+contain @samp{-l}.  If you use a prefix argument with the @code{dired}
+command, you can specify the @code{ls} switches with the minibuffer
+before you enter the directory specification.  No matter how they are
+specified, the @code{ls} switches can include short options (that is,
+single characters) requiring no arguments, and long options (starting
+with @samp{--}) whose arguments are specified with @samp{=}.
 
   On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls};
 see @ref{ls in Lisp}, for options and peculiarities of that emulation.
--- a/doc/emacs/emacs.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/emacs.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -1135,6 +1135,7 @@
 
 Reporting Bugs
 
+* Known Problems::      How to read about known problems and bugs.
 * Bug Criteria::        Have you really found a bug?
 * Understanding Bug Reporting:: How to report a bug effectively.
 * Checklist::           Steps to follow for a good bug report.
--- a/doc/emacs/misc.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/misc.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -2349,8 +2349,11 @@
 
 @findex desktop-change-dir
 @findex desktop-revert
+@vindex desktop-path
   If you turn on @code{desktop-save-mode} in your init file, then when
 Emacs starts, it looks for a saved desktop in the current directory.
+(More precisely, it looks in the directories specified by
+@var{desktop-path}, and uses the first desktop it finds.)
 Thus, you can have separate saved desktops in different directories,
 and the starting directory determines which one Emacs reloads.  You
 can save the current desktop and reload one saved in another directory
--- a/doc/emacs/trouble.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/emacs/trouble.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -409,29 +409,76 @@
 @section Reporting Bugs
 
 @cindex bugs
-  Sometimes you will encounter a bug in Emacs.  Although we cannot
-promise we can or will fix the bug, and we might not even agree that it
-is a bug, we want to hear about problems you encounter.  Often we agree
-they are bugs and want to fix them.
-
-  To make it possible for us to fix a bug, you must report it.  In order
-to do so effectively, you must know when and how to do it.
-
-  Before reporting a bug, it is a good idea to see if it is already
-known.  You can find the list of known problems in the file
-@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-p} to read
-it.  Some additional user-level problems can be found in @ref{Bugs and
-problems, , Bugs and problems, efaq, GNU Emacs FAQ}.  Looking up your
-problem in these two documents might provide you with a solution or a
-work-around, or give you additional information about related issues.
+  If you think you have found a bug in Emacs, please report it.  We
+cannot promise to fix it, or always to agree that it is a bug, but we
+certainly want to hear about it.  The same applies for new features
+you would like to see added.  The following sections will help you to
+construct an effective bug report.
 
 @menu
+* Known Problems::               How to read about known problems and bugs.
 * Criteria:  Bug Criteria.       Have you really found a bug?
 * Understanding Bug Reporting::  How to report a bug effectively.
 * Checklist::                    Steps to follow for a good bug report.
 * Sending Patches::              How to send a patch for GNU Emacs.
 @end menu
 
+@node Known Problems
+@subsection Reading Existing Bug Reports and Known Problems
+
+  Before reporting a bug, if at all possible please check to see if it
+is already known about.  Indeed, it may already have been fixed in a
+later release of Emacs, or in the development version.  Here is a list
+of the main places you can read about known issues:
+
+@itemize
+@item
+The @file{etc/PROBLEMS} file in the Emacs distribution; type @kbd{C-h
+C-p} to read it.  This file contains a list of particularly well-known
+issues that have been encountered in compiling, installing and running
+Emacs.  Often, there are suggestions for workarounds and solutions.
+
+@item
+Some additional user-level problems can be found in @ref{Bugs and
+problems, , Bugs and problems, efaq, GNU Emacs FAQ}.
+
+@item
+The @samp{bug-gnu-emacs} mailing list (also available as the newsgroup
+@samp{gnu.emacs.bug}).  This is where you will find most Emacs bug
+reports.  You can read the list archives at
+@url{http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs}.  If you
+like, you can also subscribe to the list.  Be aware that the sole
+purpose of this list is to provide the Emacs maintainers with
+information about bugs and feature requests.  Reports may contain
+fairly large amounts of data; spectators should not complain about
+this.
+
+@item
+The bug tracker at @url{http://debbugs.gnu.org}.  From early 2008,
+reports from the @samp{bug-gnu-emacs} list have been sent here.  The
+tracker contains the same information as the mailing list, just in a
+different format.  You may prefer to browse and read reports using the
+tracker.
+
+@item
+The @samp{emacs-pretest-bug} mailing list.  This list is no longer
+used, and is mainly of historical interest.  At one time, it was used
+for bug reports in development (i.e., not yet released) versions of
+Emacs.  You can read the archives for 2003 to mid 2007 at
+@url{http://lists.gnu.org/archive/html/emacs-pretest-bug/}.  From
+late 2007 to mid 2008, the address was an alias for the
+@samp{emacs-devel} mailing list.  From mid 2008 onwards, it has been
+an alias for @samp{bug-gnu-emacs}.
+
+@item
+The @samp{emacs-devel} mailing list.  Sometimes people report bugs to
+this mailing list.  This is not the main purpose of the list, however,
+and it is much better to send bug reports to the bug list.  You should
+not feel obliged to read this list before reporting a bug.
+
+@end itemize
+
+
 @node Bug Criteria
 @subsection When Is There a Bug
 
@@ -540,56 +587,81 @@
 @subsection Checklist for Bug Reports
 
 @cindex reporting bugs
-  The best way to send a bug report is to mail it electronically to the
-Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}.  (If you want to
-suggest a change as an improvement, use the same address.)
+
+  Before reporting a bug, first try to see if the problem has already
+been reported (@pxref{Known Problems}).
 
-  If you'd like to read the bug reports, you can find them on the
-newsgroup @samp{gnu.emacs.bug}; keep in mind, however, that as a
-spectator you should not criticize anything about what you see there.
-The purpose of bug reports is to give information to the Emacs
-maintainers.  Spectators are welcome only as long as they do not
-interfere with this.  In particular, some bug reports contain fairly
-large amounts of data; spectators should not complain about this.
-
-  Please do not post bug reports using netnews; mail is more reliable
-than netnews about reporting your correct address, which we may need
-in order to ask you for more information.  If your data is more than
-500,000 bytes, please don't include it directly in the bug report;
-instead, offer to send it on request, or make it available by ftp and
-say where.
+If you are able to, try the latest release of Emacs to see if the
+problem has already been fixed.  Even better is to try the latest
+development version.  We recognize that this is not easy for some
+people, so do not feel that you absolutely must do this before making
+a report.
 
 @findex report-emacs-bug
-  A convenient way to send a bug report for Emacs is to use the command
-@kbd{M-x report-emacs-bug}.  This sets up a mail buffer (@pxref{Sending
-Mail}) and automatically inserts @emph{some} of the essential
-information.  However, it cannot supply all the necessary information;
-you should still read and follow the guidelines below, so you can enter
-the other crucial information by hand before you send the message.
+  The best way to write a bug report for Emacs is to use the command
+@kbd{M-x report-emacs-bug}.  This sets up a mail buffer
+(@pxref{Sending Mail}) and automatically inserts @emph{some} of the
+essential information.  However, it cannot supply all the necessary
+information; you should still read and follow the guidelines below, so
+you can enter the other crucial information by hand before you send
+the message.  You may feel that some of the information inserted by
+@kbd{M-x report-emacs-bug} is not relevant, but unless you are
+absolutely sure it is best to leave it, so that the developers can
+decide for themselves.
+
+When you have finished writing your report, type @kbd{C-c C-c} and it
+will be sent to the Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}.
+(If you want to suggest an improvement or new feature, use the same
+address.)  If you cannot send mail from inside Emacs, you can copy the
+text of your report to your normal mail client and send it to that
+address.  Or you can simply send an email to that address describing
+the problem.
+
+Your report will be sent to the @samp{bug-gnu-emacs} mailing list, and
+stored in the tracker at @url{http://debbugs.gnu.org}.  Please try to
+include a valid reply email address, in case we need to ask you for
+more information about your report.  Submissions are moderated, so
+there may be a delay before your report appears.
+
+You do not need to know how the @url{http://debbugs.gnu.org} bug
+tracker works in order to report a bug, but if you want to, you can
+read the tracker's online documentation to see the various features
+you can use.
+
+All mail sent to the @samp{bug-gnu-emacs} mailing list is also
+gatewayed to the @samp{bug.gnu.emacs} newsgroup.  The reverse is also
+true, but we ask you not to post bug reports via the newsgroup.  It
+can make it much harder to contact you if we need to ask for more
+information, and it does not integrate well with the bug tracker.
+
+If your data is more than 500,000 bytes, please don't include it
+directly in the bug report; instead, offer to send it on request, or
+make it available by ftp and say where.
 
   To enable maintainers to investigate a bug, your report
 should include all these things:
 
 @itemize @bullet
 @item
-The version number of Emacs.  Without this, we won't know whether there
-is any point in looking for the bug in the current version of GNU
-Emacs.
+The version number of Emacs.  Without this, we won't know whether there is any
+point in looking for the bug in the current version of GNU Emacs.
 
-You can get the version number by typing @kbd{M-x emacs-version
-@key{RET}}.  If that command does not work, you probably have something
-other than GNU Emacs, so you will have to report the bug somewhere
-else.
+@kbd{M-x report-emacs-bug} includes this information automatically,
+but if you are not using that command for your report you can get the
+version number by typing @kbd{M-x emacs-version @key{RET}}.  If that
+command does not work, you probably have something other than GNU
+Emacs, so you will have to report the bug somewhere else.
 
 @item
 The type of machine you are using, and the operating system name and
-version number.  @kbd{M-x emacs-version @key{RET}} provides this
-information too.  Copy its output from the @samp{*Messages*} buffer, so
-that you get it all and get it accurately.
+version number (again, automatically included by @kbd{M-x
+report-emacs-bug}).  @kbd{M-x emacs-version @key{RET}} provides this
+information too.  Copy its output from the @samp{*Messages*} buffer,
+so that you get it all and get it accurately.
 
 @item
 The operands given to the @code{configure} command when Emacs was
-installed.
+installed (automatically included by @kbd{M-x report-emacs-bug}).
 
 @item
 A complete list of any modifications you have made to the Emacs source.
@@ -619,12 +691,15 @@
 
 @item
 The precise commands we need to type to reproduce the bug.
+If at all possible, give a full recipe for an Emacs started with the
+@samp{-Q} option (@pxref{Initial Options}).  This bypasses your
+@file{.emacs} customizations.
 
 @findex open-dribble-file
 @cindex dribble file
 @cindex logging keystrokes
-The easy way to record the input to Emacs precisely is to write a
-dribble file.  To start the file, execute the Lisp expression
+One way to record the input to Emacs precisely is to write a dribble
+file.  To start the file, execute the Lisp expression
 
 @example
 (open-dribble-file "~/dribble")
@@ -735,7 +810,7 @@
 including your @file{.emacs} file, set any variables that may affect the
 functioning of Emacs.  Also, see whether the problem happens in a
 freshly started Emacs without loading your @file{.emacs} file (start
-Emacs with the @code{-q} switch to prevent loading the init file).  If
+Emacs with the @code{-Q} switch to prevent loading the init files).  If
 the problem does @emph{not} occur then, you must report the precise
 contents of any programs that you must load into the Lisp world in order
 to cause the problem to occur.
@@ -907,12 +982,10 @@
 @itemize @bullet
 @item
 Send an explanation with your changes of what problem they fix or what
-improvement they bring about.  For a bug fix, just include a copy of the
-bug report, and explain why the change fixes the bug.
-
-(Referring to a bug report is not as good as including it, because then
-we will have to look it up, and we have probably already deleted it if
-we've already fixed the bug.)
+improvement they bring about.  For a fix for an existing bug, it is
+best to reply to the relevant discussion on the @samp{bug-gnu-emacs}
+list, or item in the @url{http://debbugs.gnu.org} tracker.  Explain
+why your change fixes the bug.
 
 @item
 Always include a proper bug report for the problem you think you have
--- a/doc/lispintro/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,9 @@
+2010-09-21  Glenn Morris  <rgm@gnu.org>
+
+	* cons-1.eps, cons-2.eps, cons-2a.eps, cons-3.eps, cons-4.eps:
+	* cons-5.eps, lambda-1.eps, lambda-2.eps, lambda-3.eps:
+	Add first line EPSF magic comment.  (Bug#7064)
+
 2010-06-23  Glenn Morris  <rgm@gnu.org>
 
 	* emacs-lisp-intro.texi: Untabify.
--- a/doc/lispintro/cons-1.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-1.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 35 711 289 757
 %%Title: cons-cell-diagram1
 %%CreationDate: Wed Mar  8 14:26:58 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/cons-2.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-2.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 15 712 321 775
 %%Title: cons-cell-diagram2
 %%CreationDate: Wed Mar  8 14:26:39 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/cons-2a.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-2a.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 15 702 300 767
 %%Title: cons-cell-diagram2a
 %%CreationDate: Tue Mar 14 15:09:30 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/cons-3.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-3.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: -1 691 324 757
 %%Title: cons-cell-diagram3
 %%CreationDate: Wed Mar  8 14:25:41 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/cons-4.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-4.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 6 681 355 758
 %%Title: cons-cell-diagram4
 %%CreationDate: Wed Mar  8 14:25:06 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/cons-5.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/cons-5.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 15 680 305 764
 %%Title: cons-cell-diagram5
 %%CreationDate: Wed Mar  8 14:27:28 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/lambda-1.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/lambda-1.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 33 710 173 759
 %%Title: lambda-diagram1
 %%CreationDate: Wed Mar  8 14:31:53 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/lambda-2.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/lambda-2.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 33 730 240 777
 %%Title: lambda-diagram2
 %%CreationDate: Wed Mar  8 14:33:09 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispintro/lambda-3.eps	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispintro/lambda-3.eps	Wed Oct 13 22:40:51 2010 +0900
@@ -1,14 +1,11 @@
-%!
+%!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 33 728 211 777
 %%Title: lambda-diagram3
 %%CreationDate: Wed Mar  8 14:33:49 1995
 %%Creator: Tgif-2.16-p4 by William Chia-Wei Cheng (william@cs.UCLA.edu)
-%
-%	Due to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1
-%
 
-% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-%   Free Software Foundation, Inc.
+% Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+%   2008, 2009, 2010  Free Software Foundation, Inc.
 %
 % This file is part of GNU Emacs.
 %
--- a/doc/lispref/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispref/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,7 @@
+2010-09-05  Alexander Klimov  <alserkli@inbox.ru>  (tiny change)
+
+	* files.texi (Directory Names): Use \` rather than ^.
+
 2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
 
 	* modes.texi (Defining Minor Modes): Doc fix (Bug#6880).
@@ -2321,6 +2325,12 @@
 
 	* display.texi (Images): Delete redundant @findex.
 
+2007-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* text.texi (Change Hooks): (after|before)-change-functions are no
+	longer bound to nil while running; rather inhibit-modification-hooks
+	is t.
+
 2007-08-16  Richard Stallman  <rms@gnu.org>
 
 	* processes.texi (Asynchronous Processes): Clarify
--- a/doc/lispref/files.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/lispref/files.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -1933,7 +1933,7 @@
 abbreviations to use for file directories.  Each element has the form
 @code{(@var{from} . @var{to})}, and says to replace @var{from} with
 @var{to} when it appears in a directory name.  The @var{from} string is
-actually a regular expression; it should always start with @samp{^}.
+actually a regular expression; it should always start with @samp{\`}.
 The @var{to} string should be an ordinary absolute directory name.  Do
 not use @samp{~} to stand for a home directory in that string.  The
 function @code{abbreviate-file-name} performs these substitutions.
@@ -1946,9 +1946,9 @@
 and so on.
 
 @example
-(("^/home/fsf" . "/fsf")
- ("^/home/gp" . "/gp")
- ("^/home/gd" . "/gd"))
+(("\\`/home/fsf" . "/fsf")
+ ("\\`/home/gp" . "/gp")
+ ("\\`/home/gd" . "/gd"))
 @end example
 @end defopt
 
--- a/doc/man/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/man/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,11 @@
+2010-10-10  Glenn Morris  <rgm@gnu.org>
+
+	* emacs.1: Small fixes.
+
+2010-10-09  Ulrich Mueller  <ulm@gentoo.org>
+
+	* emacs.1: Update license description.
+
 2010-08-26  Sven Joachim  <svenjoac@gmx.de>
 
 	* emacs.1: Mention "maximized" value for the "fullscreen" X resource.
--- a/doc/man/emacs.1	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/man/emacs.1	Wed Oct 13 22:40:51 2010 +0900
@@ -41,9 +41,9 @@
 Help Tutorial (CTRL-h t) starts an interactive tutorial to quickly
 teach beginners the fundamentals of
 .I Emacs.
-Help Apropos (CTRL-h a) helps you find a command given its
-functionality, Help Key (CTRL-h k) describes a given key sequence, and
-Help Function (CTRL-h f) describes a given Lisp function.
+Help Apropos (CTRL-h a) helps you find a command with a name matching
+a given pattern, Help Key (CTRL-h k) describes a given key sequence,
+and Help Function (CTRL-h f) describes a given Lisp function.
 .PP
 .IR "GNU Emacs" 's
 many special packages handle mail reading (RMail) and sending (Mail),
@@ -531,12 +531,12 @@
 .SH MANUALS
 You can order printed copies of the GNU Emacs Manual from the Free
 Software Foundation, which develops GNU software.
-See the file ORDERS for ordering information.
+See the online store at <http://shop.fsf.org/>.
 .br
-Your local Emacs maintainer might also have copies available.
+Your local administrator might also have copies available.
 As with all software and publications from FSF, everyone is permitted
 to make and distribute copies of the Emacs manual.
-The TeX source to the manual is also included in the Emacs source
+The Texinfo source to the manual is also included in the Emacs source
 distribution.
 .
 .
@@ -545,7 +545,8 @@
 The complete text of the Emacs reference manual is included in a
 convenient tree structured form.
 Also includes the Emacs Lisp Reference Manual, useful to anyone
-wishing to write programs in the Emacs Lisp extension language.
+wishing to write programs in the Emacs Lisp extension language,
+and the Introduction to Programming in Emacs Lisp.
 
 /usr/local/share/emacs/$VERSION/lisp \(em Lisp source files and
 compiled files that define most editing commands.
@@ -572,9 +573,8 @@
 bugs and fixes.
 But before reporting something as a bug, please try to be sure that
 it really is a bug, not a misunderstanding or a deliberate feature.
-We ask you to read the section ``Reporting Emacs Bugs'' near the
-end of the reference manual (or Info system) for hints on how and
-when to report bugs.
+We ask you to read the section ``Reporting Bugs'' in the Emacs manual
+for hints on how and when to report bugs.
 Also, include the version number of the Emacs you are running in
 \fIevery\fR bug report that you send in.
 Bugs tend actually to be fixed if they can be isolated, so it is
@@ -596,10 +596,7 @@
 .I Emacs
 is free; anyone may redistribute copies of
 .I Emacs
-to
-anyone under the terms stated in the
-.I Emacs
-General Public License,
+to anyone under the terms stated in the GNU General Public License,
 a copy of which accompanies each copy of
 .I Emacs
 and which also
@@ -611,7 +608,7 @@
 but it is never included in the scope of any license covering those
 systems.
 Such inclusion violates the terms on which distribution is permitted.
-In fact, the primary purpose of the General Public License is to
+In fact, the primary purpose of the GNU General Public License is to
 prohibit anyone from attaching any other restrictions to
 redistribution of
 .IR Emacs .
--- a/doc/misc/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/misc/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,16 @@
+2010-10-08  Glenn Morris  <rgm@gnu.org>
+
+	* cl.texi (Organization, Installation, Old CL Compatibility):
+	Deprecate cl-compat for new code.
+
+2010-10-07  Glenn Morris  <rgm@gnu.org>
+
+	* eudc.texi (CCSO PH/QI, LDAP Requirements): Remove old information.
+
+2010-10-06  Glenn Morris  <rgm@gnu.org>
+
+	* cl.texi (Usage, Installation): Remove outdated information.
+
 2010-08-26  Michael Albinus  <michael.albinus@gmx.de>
 
 	Sync with Tramp 2.1.19.
--- a/doc/misc/cl.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/misc/cl.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -163,19 +163,6 @@
 @end example
 
 @noindent
-If you want to ensure that the new (Gillespie) version of @dfn{CL}
-is the one that is present, add an additional @code{(require 'cl-19)}
-call:
-
-@example
-(require 'cl)
-(require 'cl-19)
-@end example
-
-@noindent
-The second call will fail (with ``@file{cl-19.el} not found'') if
-the old @file{cl.el} package was in use.
-
 It is safe to arrange to load @dfn{CL} at all times, e.g.,
 in your @file{.emacs} file.  But it's a good idea, for portability,
 to @code{(require 'cl)} in your code even if you do this.
@@ -219,39 +206,26 @@
 needed.
 
 There is another file, @file{cl-compat.el}, which defines some
-routines from the older @file{cl.el} package that are no longer
+routines from the older @file{cl.el} package that are not otherwise
 present in the new package.  This includes internal routines
 like @code{setelt} and @code{zip-lists}, deprecated features
 like @code{defkeyword}, and an emulation of the old-style
-multiple-values feature.  @xref{Old CL Compatibility}.
+multiple-values feature.  This file is obsolete and should not be used
+in new code.  @xref{Old CL Compatibility}.
 
 @node Installation, Naming Conventions, Organization, Overview
 @section Installation
 
 @noindent
-Installation of the @dfn{CL} package is simple:  Just put the
-byte-compiled files @file{cl.elc}, @file{cl-extra.elc},
-@file{cl-seq.elc}, @file{cl-macs.elc}, and @file{cl-compat.elc}
-into a directory on your @code{load-path}.
-
-There are no special requirements to compile this package:
-The files do not have to be loaded before they are compiled,
-nor do they need to be compiled in any particular order.
-
-You may choose to put the files into your main @file{lisp/}
-directory, replacing the original @file{cl.el} file there.  Or,
-you could put them into a directory that comes before @file{lisp/}
-on your @code{load-path} so that the old @file{cl.el} is
-effectively hidden.
-
-Also, format the @file{cl.texinfo} file and put the resulting
-Info files in the @file{info/} directory or another suitable place.
-
-You may instead wish to leave this package's components all in
-their own directory, and then add this directory to your
-@code{load-path} and @code{Info-directory-list}.
-Add the directory to the front of the list so the old @dfn{CL}
-package and its documentation are hidden.
+The @dfn{CL} package is distributed with Emacs, so there is no need
+to install anything.
+
+If you do need to install it, just put the byte-compiled files
+@file{cl.elc}, @file{cl-extra.elc}, @file{cl-seq.elc},
+@file{cl-macs.elc}, and (if necessary) @file{cl-compat.elc} into a
+directory on your @code{load-path}.  Also, format the @file{cl.texi}
+file and put the resulting Info files into a directory in your
+@code{Info-directory-list}.
 
 @node Naming Conventions,  , Installation, Overview
 @section Naming Conventions
@@ -5076,8 +5050,8 @@
 @noindent
 The @dfn{CL} package includes emulations of some features of the
 old @file{cl.el}, in the form of a compatibility package
-@code{cl-compat}.  To use it, put @code{(require 'cl-compat)} in
-your program.
+@code{cl-compat}.  This file is obsolete and may be removed in future,
+so it should not be used in new code.
 
 The old package defined a number of internal routines without
 @code{cl-} prefixes or other annotations.  Call to these routines
--- a/doc/misc/eudc.texi	Sun Aug 29 14:22:52 2010 +0900
+++ b/doc/misc/eudc.texi	Wed Oct 13 22:40:51 2010 +0900
@@ -137,7 +137,7 @@
 LDAP servers usually store (but are not limited to) information about
 people such as their name, phone number, email address, office
 location, etc@enddots{} More information about LDAP can be found at
-@url{http://www.openldap.org/}
+@url{http://www.openldap.org/}.
 
 EUDC requires external support to access LDAP directory servers
 (@pxref{LDAP Requirements})
@@ -148,17 +148,15 @@
 @section CCSO PH/QI
 
 The Central Computing Services Office (CCSO) of the University of
-Illinois at Urbana Champaign (UIUC) created and freely distributes a
-directory system that is currently in use in more than 300 organizations
-around the world.  The system records information about people such as
-their address, phone number, email, academic information or any other
-details it was configured to.
+Illinois at Urbana Champaign created and freely distributed a
+directory system that was used by many organizations in the 1990s.
+The system records information about people such as their address,
+phone number, email, academic information or any other details it was
+configured to.  Nowadays this system is not widely used.
 
 The system consists of two parts: a database server traditionally called
-@samp{qi} and a command-line client called @samp{ph}.
-@url{ftp://uiarchive.cso.uiuc.edu/pub/packages/ph} is the main
-distribution site.  @url{http://www.uiuc.edu/cgi-bin/ph/lookup?Query=.}
-provides a listing of the active @samp{qi} servers.
+@samp{qi} and a command-line client called @samp{ph}.  As of 2010, the
+code can still be downloaded from @url{http://www-dev.cites.uiuc.edu/ph/}.
 
 The original command-line @samp{ph} client that comes with the
 @samp{ph/qi} distribution provides additional features like the
@@ -225,18 +223,10 @@
 @comment  node-name,  next,  previous,  up
 @section LDAP Requirements
 
-LDAP support is added by means of @file{ldap.el} which is part of Emacs.
+LDAP support is added by means of @file{ldap.el}, which is part of Emacs.
 @file{ldap.el} needs an external command line utility named
-@file{ldapsearch} which is available as part of LDAP toolkits:
-
-@itemize @bullet
-@item
-Open LDAP Libraries
-(@url{http://www.openldap.org/})
-@item
-University of Michigan's LDAP Client software
-(@url{http://www.umich.edu/~dirsvcs/ldap/})
-@end itemize
+@file{ldapsearch}, available as part of Open LDAP
+(@url{http://www.openldap.org/}).
 
 
 @node Usage, Credits, Installation, Top
@@ -968,7 +958,3 @@
 @printindex vr
 
 @bye
-
-@ignore
-   arch-tag: 1b79460b-4ea1-441d-ab45-05ddd16ef241
-@end ignore
--- a/etc/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/etc/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,11 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* tutorials/TUTORIAL.es: Fix typos.
+
+2010-09-21  Eric Ludlam  <zappo@gnu.org>
+
+	* srecode/java.srt: Make NAME be a prompt.
+
 2010-08-22  Alex Harsanyi  <harsanyi@mac.com>  (tiny change)
 
 	* emacs3.py: Import imp module and use it (Bug#5756).
--- a/etc/NEWS	Sun Aug 29 14:22:52 2010 +0900
+++ b/etc/NEWS	Wed Oct 13 22:40:51 2010 +0900
@@ -21,6 +21,9 @@
 
 * Changes in Emacs 23.3
 
+** The nextstep port can have different modifiers for the left and right
+alt/option key by customizing the value for ns-right-alternate-modifier.
+
 
 * Editing Changes in Emacs 23.3
 
@@ -31,6 +34,11 @@
 ** The appt-add command takes an optional argument for the warning time.
 This can be used in place of the default appt-message-warning-time.
 
+** Obsolete packages
+
++++
+*** lmenu.el and cl-compat.el are now obsolete.
+
 
 * New Modes and Packages in Emacs 23.3
 
@@ -40,6 +48,10 @@
 
 * Lisp changes in Emacs 23.3
 
+** `e' and `pi' are now called `float-e' and `float-pi'.
+  The old names are obsolete.
+** The use of unintern without an obarray arg is declared obsolete.
+
 ** New function byte-to-string, like char-to-string but for bytes.
 
 
--- a/etc/srecode/java.srt	Sun Aug 29 14:22:52 2010 +0900
+++ b/etc/srecode/java.srt	Wed Oct 13 22:40:51 2010 +0900
@@ -83,7 +83,7 @@
 template include :blank
 "An include statement."
 ----
-import {{NAME}};
+import {{?NAME}};
 ----
 
 context misc
--- a/etc/tutorials/TUTORIAL.es	Sun Aug 29 14:22:52 2010 +0900
+++ b/etc/tutorials/TUTORIAL.es	Wed Oct 13 22:40:51 2010 +0900
@@ -1,4 +1,4 @@
-Tutorial de Emacs. Vea al final las condiciones de copiado.
+Tutorial de Emacs.  Vea al final las condiciones de copiado.
 
 Generalmente los comandos de Emacs involucran la tecla CONTROL
 (algunas veces llamada CTRL O CTL) o la tecla meta (algunas veces
@@ -17,7 +17,7 @@
 caracteres).  Los caracteres ">>" en el margen izquierdo indican
 instrucciones para que usted trate de usar un comando.  Por ejemplo:
 <<Blank lines inserted around following line by help-with-tutorial>>
-[Mitad de página en blanco para propósitos didácticos. El texto continúa abajo]
+[Mitad de página en blanco para propósitos didácticos.  El texto continúa abajo]
 >> Ahora teclee C-v (ver la próxima pantalla) para desplazarse a la
 	siguiente pantalla (hágalo manteniendo la tecla control
 	oprimida mientras teclea v).  Desde ahora debería hacer esto
@@ -75,7 +75,7 @@
 			Línea siguiente, C-n
 
 >> Mueva el cursor a la línea en la mitad del diagrama
-   usando C-n o C-p. Luego teclee C-l para ver el
+   usando C-n o C-p.  Luego teclee C-l para ver el
    diagrama completo centrado en la pantalla.
 
 Le resultará fácil recordar estas letras por las palabras que
@@ -200,7 +200,7 @@
 C-u y luego los dígitos antes de introducir los comandos.  Si tiene
 una tecla META (o EDIT o ALT), hay una manera alternativa para
 ingresar un argumento numérico: teclear los dígitos mientras presiona
-la tecla META.  Recomendamos aprender el método C-u porque este
+la tecla META.  Recomendamos aprender el método C-u porque éste
 funciona en cualquier terminal.  El argumento numérico es también
 llamado un "argumento prefijo", porque usted teclea el argumento antes
 del comando al que se aplica.
@@ -321,13 +321,13 @@
 <Delback> es una tecla en el teclado--la misma que normalmente usa
 fuera de emacs para borrar el último carácter que escribió.
 Normalmente es una tecla una o dos filas arriba de la tecla <Return>,
-y que esta usualmente rotulada como "Backspace", "Del" o simplemente
+y que está usualmente rotulada como "Backspace", "Del" o simplemente
 con una flecha en dirección izquierda que no es parte de las teclas de
 flecha.
 
-Si la tecla larga esta rotulada "Backspace", entonces esa es la que
-debe de usar para <Delback>. Puede haber otra tecla llamada "Del" en
-otra parte, pero esa no es <Delback>.
+Si la tecla larga está rotulada "Backspace", entonces ésa es la que
+debe de usar para <Delback>.  Puede haber otra tecla llamada "Del" en
+otra parte, pero ésa no es <Delback>.
 
 Generalmente, <Delback> borra el carácter inmediatamente anterior a la
 posición actual del cursor.
@@ -393,7 +393,7 @@
 entre las dos posiciones.
 
 >> Mueva el cursor a la letra T del inicio del párrafo anterior.
->> Teclee C-SPC. Emacs debe mostrar el mensaje "Mark set" en la parte
+>> Teclee C-SPC.  Emacs debe mostrar el mensaje "Mark set" en la parte
    de abajo de la pantalla.
 >> Mueva el cursor a la x en "extremo", en la segunda línea del
    párrafo.
@@ -405,7 +405,7 @@
 reinsertadas.  La reinserción de texto eliminado se llama "yanking" o
 "pegar".  Generalmente, los comandos que pueden quitar mucho texto lo
 eliminan, mientras que los comandos que quitan solo un carácter, o
-solo lineas en blanco y espacios, borran (para que no pueda pegar ese
+solo líneas en blanco y espacios, borran (para que no pueda pegar ese
 texto).
 
 >> Mueva el cursor al comienzo de una línea que no esté vacía.
@@ -417,14 +417,14 @@
 y un segundo C-k elimina la línea misma, y hace que todas las otras
 líneas se muevan hacia arriba.  C-k trata un argumento numérico
 especialmente: Elimina ese número de líneas y TAMBIÉN sus
-contenidos. Esto no es una simple repetición.  C-u 2 C-k elimina dos
+contenidos.  Esto no es una simple repetición.  C-u 2 C-k elimina dos
 líneas y sus nuevas líneas, tecleando C-k dos veces no hace esto.
 
 Traer texto eliminado de regreso es llamado "yanking" o "pegar".
 (Piense en ello como pegar de nuevo, o traer de vuelta, algún texto
 que le fue quitado.)  Puede pegar el texto eliminado en, ya sea el
 lugar en que fue eliminado, o en otra parte del buffer, o hasta en un
-archivo diferente. Puede pegar el texto varias veces, lo que hace
+archivo diferente.  Puede pegar el texto varias veces, lo que hace
 varias copias de él.
 
 El comando para pegar es C-y.  Reinserta el último texto eliminado, en
@@ -460,7 +460,7 @@
    Luego teclee M-y y será reemplazado por la primera línea eliminada.
    Teclee más veces M-y y vea lo que obtiene.  Siga haciéndolo hasta
    que la segunda línea eliminada regrese, y entonces unas pocas
-   más. Si quiere, puede tratar de darle a M-y argumentos positivos y
+   más.  Si quiere, puede tratar de darle a M-y argumentos positivos y
    negativos.
 
 
@@ -477,7 +477,7 @@
 Pero hay dos excepciones: los comandos que no cambian el texto no
 cuentan (esto incluye los comandos de movimiento del cursor y el
 comando de desplazamiento), y los caracteres de autoinserción se
-manejan usualmente en grupos de hasta 20. (Esto es para reducir el
+manejan usualmente en grupos de hasta 20.  (Esto es para reducir el
 numero de C-x u que tenga que teclear para deshacer una inserción en
 el texto.)
 
@@ -504,7 +504,7 @@
 Para que pueda hacer permanente el texto que edite, lo debe colocar en
 un archivo.  De otra manera, éste se perderá cuando cierre Emacs.
 Para poder poner su texto en un archivo, debe "encontrar" el archivo
-antes de ingresar el texto. (Esto se llama también "visitar" el
+antes de ingresar el texto.  (Esto se llama también "visitar" el
 archivo.)
 
 Encontrar un archivo significa que puede ver su contenido dentro de
@@ -556,7 +556,7 @@
 
 Esto copia el texto dentro de Emacs al archivo.  La primera vez que
 haga esto, Emacs renombrará el archivo original con un nuevo nombre
-para que este no se pierda. El nuevo nombre se hace agregando "~" al
+para que éste no se pierda.  El nuevo nombre se hace agregando "~" al
 final del nombre del archivo original.
 
 Cuando guardar haya terminado, Emacs mostrará el nombre del archivo
@@ -595,13 +595,13 @@
 Emacs.  Para mirar la lista de los buffers que existen actualmente en
 su sesión de Emacs, teclee:
 
-	C-x C-b   Lista de Buffers
+	C-x C-b   Lista de buffers
 
 >> Pruebe C-x C-b ahora.
 
 Vea como cada buffer tiene un nombre, y además puede tener un nombre
-de archivo para el archivo que contiene. CUALQUIER texto que vea en
-una ventana de Emacs es siempre parte de algún Buffer.
+de archivo para el archivo que contiene.  CUALQUIER texto que vea en
+una ventana de Emacs es siempre parte de algún buffer.
 
 >> Teclee C-x 1 para deshacerse de la lista de buffers.
 
@@ -610,14 +610,14 @@
 otro buffer, necesita "cambiar" a él.  Si quiere cambiar a un buffer
 que corresponde a un archivo, puede hacerlo visitando el archivo de
 nuevo con C-x C-f.  Pero existe una manera más rápida: use el comando
-C-x b. En ese comando, necesita teclear el nombre de buffer.
+C-x b.  En ese comando, necesita teclear el nombre de buffer.
 
 >> Teclee C-x b foo <Return> para volver al buffer "foo" que contiene
    el texto del archivo "foo".  Después teclee C-x b TUTORIAL.es
    <Return> para regresar a este tutorial.
 
 La mayoría del tiempo el nombre del buffer es el mismo que el nombre
-del archivo (sin la parte del directorio del archivo). Sin embargo,
+del archivo (sin la parte del directorio del archivo).  Sin embargo,
 esto no es así siempre.  La lista de buffers que hace con C-x C-b
 siempre muestra el nombre de todos los buffers.
 
@@ -638,7 +638,7 @@
 segundo buffer de archivo no afecta al primero.  Esto es muy útil,
 pero también significa que necesita una forma conveniente para guardar
 el archivo del primer buffer.  Sería una molestia tener que volver a
-este con C-x C-f para guardarlo con C-x C-s. Así tenemos
+éste con C-x C-f para guardarlo con C-x C-s.  Así tenemos
 
 	C-x s 	Guardar algunos buffers
 
@@ -655,10 +655,10 @@
 
 Hay muchísimos más comandos de Emacs que los que podrían asignarse a
 todos los caracteres control y meta.  Emacs puede darle la vuelta a
-esto usando el comando X (eXtendido).  Este viene de dos formas:
+esto usando el comando X (eXtendido).  Éste viene de dos formas:
 
-	C-x 	Carácter eXtendido. Seguido por un carácter.
-        M-x 	Comando eXtendido por nombre. Seguido por un nombre
+	C-x 	Carácter eXtendido.  Seguido por un carácter.
+        M-x 	Comando eXtendido por nombre.  Seguido por un nombre
                 largo.
 
 Estos comandos son generalmente útiles pero menos usados que los
@@ -713,7 +713,7 @@
 caracteres a reemplazar, y la cadena de caracteres para reemplazarla.
 Debe terminar cada argumento con <Return>.
 
->> Mueva el cursor hacia la línea en blanco dos líneas abajo de esta.
+>> Mueva el cursor hacia la línea en blanco dos líneas abajo de ésta.
    A continuación escriba
    M-x repl s<Return>cambiado<Return>alterado<Return>.
 
@@ -762,7 +762,7 @@
 Ya sabe qué significa el nombre del archivo: es el archivo que usted
 ha encontrado.  -NN%-- indica su posición actual en el texto; esto
 significa que NN por ciento del texto está encima de la parte superior
-de la pantalla.  Si el principio del archivo está en la pantalla, este
+de la pantalla.  Si el principio del archivo está en la pantalla, éste
 dirá --Top-- en vez de --00%--.  Si el final del texto está en la
 pantalla, dirá --Bot--.  Si está mirando un texto tan pequeño que cabe
 en la pantalla, el modo de línea dirá --All--.
@@ -776,7 +776,7 @@
 
 La parte de la línea de modo dentro de los paréntesis es para
 indicarle en qué modo de edición está.  El modo por omisión es
-Fundamental, el cual está usando ahora.  Este es un ejemplo de un
+Fundamental, el cual está usando ahora.  Éste es un ejemplo de un
 "modo mayor".
 
 Emacs tiene diferentes modos mayores.  Algunos están hechos para
@@ -841,7 +841,7 @@
    Debe intercalar espacios porque Auto Fill sólo rompe líneas en los
    espacios.
 
-El margen esta normalmente puesto en 70 caracteres, pero puede
+El margen está normalmente puesto en 70 caracteres, pero puede
 cambiarlo con el comando C-x f.  Debe indicar el margen deseado como
 un argumento numérico.
 
@@ -1079,7 +1079,7 @@
 valores pueda poner para adecuar el comportamiento de Emacs.  Necesita
 teclear el nombre de la variable cuando Emacs pregunte por ella.
 
-   C-h a 	Comando Apropos. Teclee una palabra y Emacs hará una
+   C-h a 	Comando Apropos.  Teclee una palabra y Emacs hará una
 		lista de todos los comandos que contengan esa palabra.
 		Todos estos comandos pueden ser invocados con META-x.
 		Para algunos comandos, el Comando Apropos también
@@ -1113,7 +1113,7 @@
 ---------------------
 
 Puede aprender más de Emacs leyendo su manual, ya sea como libro o en
-línea en el Info (use el menú Ayuda--"Help"--o teclee F10 h r). Dos
+línea en el Info (use el menú Ayuda--"Help"--o teclee F10 h r).  Dos
 características que pueden gustarle son la completación, que ahorra
 teclear, y dired, que simplifica el manejo de archivos.
 
@@ -1126,7 +1126,7 @@
 
 Dired le permite listar los archivos en un directorio (y opcionalmente
 sus subdirectorios), moverse alrededor de esa lista, visitar,
-renombrar, borrar y aparte de eso operar en los archivos.  Dired esta
+renombrar, borrar y aparte de eso operar en los archivos.  Dired está
 descrito en el Info en el manual de Emacs en el nodo llamado "Dired".
 
 El manual también describe otras características de Emacs.
@@ -1189,7 +1189,7 @@
    posterior como lo permite esta nota.
 
    Se permite distribuir versiones modificadas de este documento, o
-   porciones de este, bajo las condiciones anteriores, siempre que
+   porciones de éste, bajo las condiciones anteriores, siempre que
    ellas tengan nota visible especificando quién fue el último en
    alterarlas.
 
--- a/lib-src/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lib-src/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,8 @@
+2010-10-01  Glenn Morris  <rgm@gnu.org>
+
+	* emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a fall-back
+	DARWIN_USER_TEMP_DIR.  (Bug#3992)
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/lib-src/emacsclient.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/lib-src/emacsclient.c	Wed Oct 13 22:40:51 2010 +0900
@@ -1249,7 +1249,18 @@
       {
 	tmpdir = egetenv ("TMPDIR");
 	if (!tmpdir)
-	  tmpdir = "/tmp";
+          {
+#ifdef DARWIN_OS
+            size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
+            if (n > 0)
+              {
+                tmpdir = alloca (n);
+                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
+              }
+            else
+#endif
+              tmpdir = "/tmp";
+          }
 	socket_name = alloca (strlen (tmpdir) + strlen (server_name)
 			      + EXTRA_SPACE);
 	sprintf (socket_name, "%s/emacs%d/%s",
--- a/lisp/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,285 @@
+2010-10-13  Glenn Morris  <rgm@gnu.org>
+
+	* mail/emacsbug.el (report-emacs-bug): Mention debbugs.gnu.org.
+
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* international/mule.el (define-coding-system):
+	* international/titdic-cnv.el (quail-cxterm-package-ext-info):
+	* composite.el (compose-region): Fix typo in docstring.
+
+2010-10-10  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* term/ns-win.el (ns-right-alternate-modifier): New defvar.
+	(ns-right-option-modifier): New alias for ns-right-alternate-modifier.
+	(mac-right-option-modifier): New alias for ns-right-option-modifier.
+
+	* cus-start.el (all): ns-right-alternate-modifier is new.
+
+2010-10-10  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* Makefile.in (ELCFILES): Update.
+
+2010-10-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/lisp.el (lisp-completion-at-point):
+	Use emacs-lisp-mode-syntax-table for the whole function.
+
+2010-10-09  Richard Sharman  <richard_sharman@mitel.com>  (tiny change)
+
+	* progmodes/gdb-ui.el (gdb-mouse-toggle-breakpoint-margin)
+	(gdb-mouse-toggle-breakpoint-fringe): Correct regexp to
+	work when breakpoint number exceeds nine.
+
+2010-10-05  David Koppelman  <koppel@ece.lsu.edu>
+
+	* hi-lock.el (hi-lock-font-lock-hook): Check font-lock-fontified
+	instead of font-lock-mode before adding keywords.
+	Remove hi-lock-mode off code.  Remove inhibit hack.
+	(hi-lock-set-pattern): Only add keywords if font-lock-fontified
+	non-nil; removed hook inhibit hack.
+
+2010-10-09  Glenn Morris  <rgm@gnu.org>
+
+	* emacs-lisp/shadow.el (find-emacs-lisp-shadows): Rename it...
+	(load-path-shadows-find): ... to this.
+	(list-load-path-shadows): Update for above change.
+
+	* mail/mail-utils.el (mail-mbox-from): Also try return-path.
+
+2010-10-08  Glenn Morris  <rgm@gnu.org>
+
+	* emacs-lisp/cl-compat.el, emacs-lisp/lmenu.el: Move to obsolete/.
+
+	* emacs-lisp/shadow.el (lisp-shadow): Change prefix.
+	(shadows-compare-text-p): Make it an obsolete alias for...
+	(load-path-shadows-compare-text): ... new name.
+	(find-emacs-lisp-shadows): Update for above name change.
+	(load-path-shadows-same-file-or-nonexistent): New name for the old
+	shadow-same-file-or-nonexistent.
+
+2010-10-03  Chong Yidong  <cyd@stupidchicken.com>
+
+	* minibuffer.el (completion--some, completion--do-completion)
+	(minibuffer-complete-and-exit, minibuffer-completion-help)
+	(completion-basic-try-completion)
+	(completion-basic-all-completions)
+	(completion-pcm--find-all-completions): Use lexical-let to
+	avoid some false matches in variable completion (Bug#7056)
+
+2010-10-03  Olof Ohlsson Sax  <olof.ohlsson.sax@gmail.com>  (tiny change)
+
+	* vc-svn.el (vc-svn-merge-news): Use --non-interactive.  (Bug#7152)
+
+2010-10-03  Leo  <sdl.web@gmail.com>
+
+	* dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only
+	return non-nil if the file exists (Bug#7090).
+
+2010-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion--replace):
+	Better preserve markers (bug#7138).
+
+2010-09-29  Juanma Barranquero  <lekktu@gmail.com>
+
+	* server.el (server-process-filter): Doc fix.
+
+2010-09-27  Drew Adams  <drew.adams@oracle.com>
+
+	* dired.el (dired-save-positions): Doc fix.  (Bug#7119)
+
+2010-09-27  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* Makefile.in (ELCFILES): Update.
+
+	* emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
+	Avoid infinite recursion on erroneous lambda form.  (Bug#7114)
+
+2010-09-27  Kenichi Handa  <handa@m17n.org>
+
+	* tar-mode.el (tar-header-block-tokenize): Decode filenames in
+	"ustar" format.
+
+2010-09-27  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule.el (define-coding-system): Docstring fixed.
+
+	* international/mule-diag.el (describe-character-set): Use princ
+	with proper print-length and print-level instead of insert.
+
+2010-09-26  Juanma Barranquero  <lekktu@gmail.com>
+
+	* window.el (walk-windows): Doc fix (bug#7105).
+
+2010-09-23  Glenn Morris  <rgm@gnu.org>
+
+	* isearch.el (isearch-lazy-highlight-cleanup)
+	(isearch-lazy-highlight-initial-delay)
+	(isearch-lazy-highlight-interval)
+	(isearch-lazy-highlight-max-at-a-time, isearch-lazy-highlight-face):
+	* net/net-utils.el (ipconfig-program-options):
+	Move aliases to options before the associated definitions.
+
+2010-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* newcomment.el (comment-normalize-vars): Better test validity of
+	comment-end-skip.
+
+2010-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/float-sup.el (float-pi): New name for `pi'.
+	(float-e): New name for `e'.
+	(degrees-to-radians, radians-to-degrees):
+	* calendar/solar.el (solar-longitude):
+	* calculator.el (calculator-registers, calculator-funcall):
+	* textmodes/artist.el (artist-spray-random-points):
+	* play/bubbles.el (bubbles--initialize-images): Use new names.
+
+2010-09-19  Eric M. Ludlam  <zappo@gnu.org>
+
+	Update to CEDET 1.0's version of EIEIO.
+
+	* emacs-lisp/eieio.el (eieio-specialized-key-to-generic-key):
+	New function.
+	(eieio-defmethod, eieio-generic-form, eieio-generic-call): Use it.
+	(eieio-default-eval-maybe): Eval val instead of unquoting only.
+	(class-precedence-list): If class is nil, return nil.
+	(eieio-generic-call): If class of first input arg is nil, don't
+	look up static methods, and do check for primary methods.
+	(initialize-instance): See if the default needs to be evaluated
+	during the constructor.
+	(eieio-perform-slot-validation-for-default): Don't do the check
+	for values that will eventually be evaluated.
+	(eieio-eval-default-p): New function.
+	(eieio-default-eval-maybe): Use it.
+
+2010-07-03  Jan Moringen  <jan.moringen@uni-bielefeld.de>
+
+	* emacs-lisp/eieio.el (eieio-defclass): Allow :c3
+	method-invocation-order.
+	(eieio-c3-candidate, eieio-c3-merge-lists): New functions.
+	(eieio-class-precedence-dfs): Compute class precedence list using
+	dfs algorithm.
+	(eieio-class-precedence-bfs): Compute class precedence list using
+	bfs algorithm.
+	(eieio-class-precedence-c3): Compute class precedence list using
+	c3 algorithm.
+	(class-precedence-list): New function.
+	(eieiomt-method-list, eieiomt-sym-optimize): Use it.
+	(inconsistent-class-hierarchy): New error symbol.
+	(call-next-method): Stow the replacement argument list for future
+	call-next-method invocations.
+
+2010-09-15  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/appt.el (appt-check): If not displaying the diary,
+	use (diary 1) to only get the entries we need.
+	(appt-make-list): Sort diary-list-entries, if we cannot guarantee
+	that it is in day order.  (Bug#7019)
+
+	* calendar/appt.el (appt-check): Rather than showing the diary,
+	just turn off invisible display, and only if needed.
+
+	* calendar/diary-lib.el (diary-list-entries): Doc fix.  (Bug#7019)
+
+2010-09-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/byte-run.el (set-advertised-calling-convention):
+	Add `when' argument.  Update callers.
+
+	* subr.el (unintern): Declare the obarray arg mandatory.
+
+2010-09-14  Glenn Morris  <rgm@gnu.org>
+
+	* calendar/diary-lib.el (diary-list-entries-hook, diary-sort-entries):
+	Doc fixes.
+
+	* calendar/diary-lib.el (diary-included-files): New variable.
+	(diary-list-entries): Maybe initialize diary-included-files.
+	(diary-include-other-diary-files): Append to diary-included-files.
+	* calendar/appt.el (appt-update-list): Also check the members of
+	diary-included-files.  (Bug#6999)
+	(appt-check): Doc fix.
+
+2010-09-12  David Reitter  <david.reitter@gmail.com>
+
+	* simple.el (line-move-visual): Do not truncate goal column to
+	integer size.  (Bug#7020)
+
+2010-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* repeat.el (repeat): Allow repeating when the last event is a click.
+	Suggested by Drew Adams (bug#6256).
+
+2010-09-11  Sascha Wilde  <wilde@sha-bang.de>
+
+	* vc/vc-hg.el (vc-hg-state,vc-hg-working-revision):
+	Replace setting HGRCPATH to "" by some less invasive --config options.
+
+2010-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* font-lock.el (font-lock-beginning-of-syntax-function):
+	Mark as obsolete.
+
+2010-09-10  Glenn Morris  <rgm@gnu.org>
+
+	* menu-bar.el (menu-bar-options-save): Fix handling of menu-bar
+	and tool-bar modes.  (Bug#6211)
+	(menu-bar-mode): Move setting of standard-value after the
+	minor-mode definition, otherwise it seems to have no effect.
+
+2010-09-08  Masatake YAMATO  <yamato@redhat.com>
+
+	* progmodes/antlr-mode.el (antlr-font-lock-additional-keywords):
+	Fix typo.  (Bug#6976)
+
+2010-09-06  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+	* whitespace.el: Allow cleaning up blanks without blank
+	visualization (Bug#6651).  Adjust help window for
+	whitespace-toggle-options (Bug#6479).  Allow to use fill-column
+	instead of whitespace-line-column (from EmacsWiki).  New version 13.1.
+	(whitespace-style): Add new value 'face.  Adjust docstring.
+	(whitespace-space, whitespace-hspace, whitespace-tab):
+	Adjust foreground property face.
+	(whitespace-line-column): Adjust docstring and type declaration.
+	(whitespace-style-value-list, whitespace-toggle-option-alist)
+	(whitespace-help-text): Adjust const initialization.
+	(whitespace-toggle-options, global-whitespace-toggle-options):
+	Adjust docstring.
+	(whitespace-display-window, whitespace-interactive-char)
+	(whitespace-style-face-p, whitespace-color-on): Adjust code.
+	(whitespace-help-scroll): New fun.
+
+2010-09-05  Alexander Klimov  <alserkli@inbox.ru>  (tiny change)
+
+	* files.el (directory-abbrev-alist): Use \` as default regexp.
+
+	* emacs-lisp/rx.el (rx-any): Don't explode ranges that end in special
+	chars like - or ] (bug#6984).
+	(rx-any-condense-range): Explode 2-char ranges.
+
+2010-09-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/bibtex.el:
+	* proced.el: Update to new email for Roland Winkler <winkler@gnu.org>.
+
+2010-09-02  Glenn Morris  <rgm@gnu.org>
+
+	* desktop.el (desktop-path): Bump :version after 2009-09-15 change.
+
+2010-08-31  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule-cmds.el (standard-display-european-internal):
+	Setup standard-display-table for 8-bit characters by storing 8-bit
+	characters in the element vector.
+
+	* disp-table.el (standard-display-8bit):
+	Setup standard-display-table for 8-bit characters by storing 8-bit
+	characters in the element vector.
+	(standard-display-european): Likewise.
+
 2010-08-26  Michael Albinus  <michael.albinus@gmx.de>
 
 	Sync with Tramp 2.1.19.
@@ -31,8 +313,8 @@
 	(tramp-compat-file-attributes): Handle only
 	`wrong-number-of-arguments' error.
 
-	* net/tramp-fish.el (tramp-fish-handle-copy-file): Add
-	PRESERVE_SELINUX_CONTEXT.
+	* net/tramp-fish.el (tramp-fish-handle-copy-file):
+	Add PRESERVE_SELINUX_CONTEXT.
 	(tramp-fish-handle-delete-file): Add TRASH arg.
 	(tramp-fish-handle-directory-files-and-attributes):
 	Do not use `tramp-fish-handle-file-attributes.
@@ -50,10 +332,10 @@
 	(with-tramp-dbus-call-method): Format trace message.
 	(tramp-gvfs-handle-copy-file): Handle PRESERVE-SELINUX-CONTEXT.
 	(tramp-gvfs-handle-copy-file, tramp-gvfs-handle-rename-file):
-	Implement backup call, when operation on local files fails.  Use
-	progress reporter.  Flush properties of changed files.
-	(tramp-gvfs-handle-delete-file): Add TRASH arg.  Use
-	`tramp-compat-delete-file'.
+	Implement backup call, when operation on local files fails.
+	Use progress reporter.  Flush properties of changed files.
+	(tramp-gvfs-handle-delete-file): Add TRASH arg.
+	Use `tramp-compat-delete-file'.
 	(tramp-gvfs-handle-expand-file-name): Expand "~/".
 	(tramp-gvfs-handle-make-directory): Make more traces.
 	(tramp-gvfs-handle-write-region): Protect deleting tmpfile.
@@ -62,17 +344,17 @@
 	into account for the resulting file name.
 	(tramp-gvfs-handler-askquestion): Preserve current message, in
 	order to let progress reporter continue afterwards.  (Bug#6257)
-	Return dummy mountpoint, when the answer is "no".  See
-	`tramp-gvfs-maybe-open-connection'.
+	Return dummy mountpoint, when the answer is "no".
+	See `tramp-gvfs-maybe-open-connection'.
 	(tramp-gvfs-handler-mounted-unmounted)
 	(tramp-gvfs-connection-mounted-p): Test also for new mountspec
-	attribute "default_location".  Set "prefix" property.  Handle
-	default-location.
+	attribute "default_location".  Set "prefix" property.
+	Handle default-location.
 	(tramp-gvfs-mount-spec): Return both prefix and mountspec.
 	(tramp-gvfs-maybe-open-connection): Test, whether mountpoint
 	exists.  Raise an error, if not (due to a corresponding answer
-	"no" in interactive questions, for example). Use
-	`tramp-compat-funcall'.
+	"no" in interactive questions, for example).
+	Use `tramp-compat-funcall'.
 
 	* net/tramp-imap.el (top): Autoload `epg-make-context'.
 	(tramp-imap-handle-copy-file): Add PRESERVE-SELINUX-CONTEXT.
@@ -81,8 +363,8 @@
 	(tramp-imap-handle-file-local-copy): Use `with-progress-reporter'.
 	(tramp-imap-handle-delete-file): Add TRASH arg.
 
-	* net/tramp-smb.el (tramp-smb-handle-copy-file): Add
-	PRESERVE-SELINUX-CONTEXT.
+	* net/tramp-smb.el (tramp-smb-handle-copy-file):
+	Add PRESERVE-SELINUX-CONTEXT.
 	(tramp-smb-handle-copy-file)
 	(tramp-smb-handle-file-local-copy, tramp-smb-handle-rename-file)
 	(tramp-smb-handle-write-region, tramp-smb-maybe-open-connection):
@@ -149,8 +431,8 @@
 	(tramp-get-remote-path): Use `copy-tree'.
 	(tramp-completion-handle-file-name-all-completions): Ensure, that
 	non remote files are still checked.  Oops.
-	(tramp-handle-copy-file, tramp-do-copy-or-rename-file): Handle
-	PRESERVE-SELINUX-CONTEXT.
+	(tramp-handle-copy-file, tramp-do-copy-or-rename-file):
+	Handle PRESERVE-SELINUX-CONTEXT.
 	(tramp-do-copy-or-rename-file): Add progress reporter.
 	(tramp-do-copy-or-rename-file-directly): Do not use
 	`tramp-handle-file-remote-p'.
@@ -164,8 +446,8 @@
 	cache.
 	(tramp-handle-expand-file-name)
 	(tramp-completion-handle-file-name-all-completions)
-	(tramp-completion-handle-file-name-completion): Use
-	`tramp-connectable-p'.
+	(tramp-completion-handle-file-name-completion):
+	Use `tramp-connectable-p'.
 	(tramp-handle-start-file-process): Set connection property "vec".
 	Use it, in order to invalidate file caches.  Check only for
 	`remote-tty' process property.
@@ -450,10 +732,6 @@
 
 	* help-fns.el (find-lisp-object-file-name): Doc fix (bug#6494).
 
-2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/semantic/db-file.el (object-write): Fix typo in docstring.
-
 2010-07-19  Juanma Barranquero  <lekktu@gmail.com>
 
 	* time.el (display-time-day-and-date): Remove spurious * in docstring.
@@ -527,8 +805,7 @@
 2010-07-03  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/zeroconf.el (zeroconf-resolve-service)
-	(zeroconf-service-resolver-handler): Use
-	`dbus-byte-array-to-string'.
+	(zeroconf-service-resolver-handler): Use `dbus-byte-array-to-string'.
 	(zeroconf-publish-service): Use `dbus-string-to-byte-array'.
 
 2010-07-03  Jan Moringen  <jan.moringen@uni-bielefeld.de>
@@ -632,8 +909,8 @@
 2010-06-21  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	Fix reading file names in Git annotate buffers.
-	* vc-git.el (vc-git-annotate-extract-revision-at-line): Remove
-	trailing whitespace.  Suggested by Eric Hanchrow.  (Bug#6481)
+	* vc-git.el (vc-git-annotate-extract-revision-at-line):
+	Remove trailing whitespace.  Suggested by Eric Hanchrow.  (Bug#6481)
 
 2010-06-20  Alan Mackenzie  <acm@muc.de>
 
@@ -719,12 +996,6 @@
 	* term/common-win.el (x-colors): Add "dark green" and "dark
 	turquoise" (Bug#6332).
 
-2010-06-03  Eric Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/lex-spp.el
-	(semantic-lex-spp-table-write-slot-value): Instead of erroring on
-	invalid values during save, just save a nil (Bug#6324).
-
 2010-06-03  Glenn Morris  <rgm@gnu.org>
 
 	* desktop.el (desktop-clear-preserve-buffers):
@@ -739,11 +1010,6 @@
 	* vc-bzr.el (vc-bzr-revision-completion-table): Apply
 	`file-directory-p' to the filename part rather than to the whole text.
 
-2010-05-31  Jonathan Marchand  <jonathlela@gmail.com>  (tiny change)
-
-	* cedet/ede/cpp-root.el (ede-set-project-variables): Fix feature name
-	(bug#6231).
-
 2010-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* man.el (Man-completion-table): Let the user type "-k " (bug#6319).
@@ -805,7 +1071,7 @@
 
 2010-05-03  Chong Yidong  <cyd@stupidchicken.com>
 
-	* international/mule.el (auto-coding-alist):  Only purecopy
+	* international/mule.el (auto-coding-alist): Only purecopy
 	car of each item, not the whole list (Bug#6083).
 
 2010-05-02  Chong Yidong  <cyd@stupidchicken.com>
@@ -876,15 +1142,15 @@
 2010-04-20  Kenichi Handa  <handa@m17n.org>
 
 	* language/indian.el (oriya-composable-pattern)
-	(tamil-composable-pattern, malayalam-composable-pattern): Add
-	two-part vowels to "v" (vowel sign).
+	(tamil-composable-pattern, malayalam-composable-pattern):
+	Add two-part vowels to "v" (vowel sign).
 
 2010-04-20  Chong Yidong  <cyd@stupidchicken.com>
 
 	* files.el (copy-directory): Handle symlinks (Bug#5982).
 
-	* progmodes/compile.el (compilation-next-error-function): Revert
-	2009-10-12 change (Bug#5983).
+	* progmodes/compile.el (compilation-next-error-function):
+	Revert 2009-10-12 change (Bug#5983).
 
 2010-04-20  Dan Nicolaescu  <dann@ics.uci.edu>
 
@@ -898,11 +1164,6 @@
 
 	* minibuffer.el (completion-at-point): Doc fix.
 
-2010-04-18  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Don't
-	destroy list before using it.
-
 2010-04-17  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	Fix the version number for added files.
@@ -975,12 +1236,6 @@
 	* help.el (help-window-setup-finish): Doc fix (Bug#5830).
 	Reported by monkey@sandpframing.com.
 
-2010-04-02  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/semantic/imenu.el (semantic-imenu-bucketize-type-members)
-	(semantic-create-imenu-directory-index): Fix typos in docstrings.
-	(semantic-imenu-goto-function): Reflow docstring.
-
 2010-03-30  Tomas Abrahamsson  <tab@lysator.liu.se>
 
 	* textmodes/artist.el (artist-mode): Fix typo in docstring.
@@ -1058,8 +1313,6 @@
 	* faces.el (set-face-attribute): Fix typo in docstring.
 	(face-valid-attribute-values): Reflow docstring.
 
-	* cedet/srecode/table.el (srecode-template-table): Fix docstring typo.
-
 2010-03-23  Glenn Morris  <rgm@gnu.org>
 
 	* textmodes/flyspell.el (sgml-lexical-context): Autoload it (Bug#5752).
@@ -1127,11 +1380,6 @@
 	(tramp-open-connection-setup-interactive-shell): Remove workaround
 	for OpenSolaris bug, it is not needed anymore.
 
-2010-03-13  Eric M. Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/imenu.el: New file, from the CEDET repository
-	(Bug#5412).
-
 2010-03-12  Glenn Morris  <rgm@gnu.org>
 
 	* emacs-lisp/cl-macs.el (defsubst*): Add autoload cookie.  (Bug#4427)
@@ -1164,8 +1412,8 @@
 
 2010-03-07  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
 
-	* vc-git.el (vc-git-annotate-extract-revision-at-line): Use
-	vc-git-root as default directory for revision path (Bug#5657).
+	* vc-git.el (vc-git-annotate-extract-revision-at-line):
+	Use vc-git-root as default directory for revision path (Bug#5657).
 
 2010-03-06  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -1180,11 +1428,6 @@
 	(vc-git-show-log-entry): Use prog1.
 	(vc-git-after-dir-status-stage): Remove unused var `remaining'.
 
-2010-03-06  Glenn Morris  <rgm@gnu.org>
-
-	* cedet/semantic/grammar.el (semantic-grammar-header-template):
-	Update template copyright to GPLv3+.
-
 2010-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* man.el (Man-files-regexp): Tighten up the regexp (bug#5686).
@@ -1251,9 +1494,6 @@
 
 	* textmodes/reftex-toc.el (reftex-toc-promote-prepare):
 	* emacs-lisp/elint.el (elint-add-required-env):
-	* cedet/semantic/db-find.el
-	(semanticdb-find-translate-path-brutish-default):
-	* cedet/ede/make.el (ede-make-check-version):
 	* calendar/icalendar.el (icalendar--add-diary-entry):
 	* calc/calcalg2.el (math-tracing-integral):
 	* files.el (recover-session-finish): Use with-current-buffer
@@ -1418,12 +1658,6 @@
 
 	* doc-view.el (doc-view): Add to data custom group.
 
-	* cedet/data-debug.el (data-debug): Move to extensions group.
-
-	* cedet/ede.el (ede):
-	* cedet/srecode.el (srecode):
-	* cedet/semantic.el (semantic): Put in tools and extensions group.
-
 	* nxml/nxml-mode.el (nxml-faces): Remove from font-lock-faces group.
 
 	* textmodes/flyspell.el (flyspell-word): Obey the offset specified
@@ -1460,10 +1694,6 @@
 
 	* outline.el (outline-head-from-level):
 	* simple.el (with-wrapper-hook):
-	* cedet/ede.el (ede-run-target, project-delete-target)
-	(project-dist-files, ede-name, ede-documentation, ede-parent-project)
-	(ede-adebug-project, ede-adebug-project-parent)
-	(ede-adebug-project-root):
 	* emacs-lisp/elint.el (elint-extra-errors, elint-current-buffer)
 	(elint-defun, elint-buffer-env, elint-top-form-logged)
 	(elint-unbound-variable):
@@ -1912,70 +2142,10 @@
 
 2010-01-18  Juanma Barranquero  <lekktu@gmail.com>
 
-	* cedet/ede/locate.el (ede-locate-file-in-project)
-	(ede-locate-file-in-project-impl): Fix typos in docstrings.
-	(ede-enable-locate-on-project): Fix typos in error messages.
-
-	* cedet/semantic/util-modes.el (semantic-unmatched-syntax-face)
-	(semantic-stickyfunc-old-hlf, semantic-stickyfunc-header-line-format)
-	(semantic-stickyfunc-sticky-classes, semantic-highlight-func-mode-setup)
-	(semantic-stickyfunc-fetch-stickyline): Fix typos in docstrings.
-	(semantic-stickyfunc-popup-menu, semantic-highlight-func-popup-menu):
-	Fix typos in menu help.
-
 	* emacs-lisp/chart.el (chart-file-count, chart-rmail-from):
 	Fix typos in chart titles.
 
 	* whitespace.el (whitespace-style, global-whitespace-newline-mode):
-	* cedet/semantic.el (semantic-require-version, semantic--buffer-cache)
-	(semantic-unmatched-syntax-cache-check, semantic-unmatched-syntax-hook)
-	(semantic--before-fetch-tags-hook, semantic-new-buffer-fcn-was-run)
-	(semantic--umatched-syntax-needs-refresh-p, semantic-elapsed-time)
-	(semantic-parse-stream, semantic-parse-region)
-	(semantic-parse-region-default, semantic--set-buffer-cache)
-	(semantic-minimum-working-buffer-size, semantic-refresh-tags-safe)
-	(semantic-bovinate-toplevel, semantic-load-system-cache-loaded)
-	(semantic-default-submodes):
-	* cedet/semantic/db-ebrowse.el (semanticdb-table-ebrowse)
-	(semanticdb-create-ebrowse-database)
-	(semanticdb-find-tags-for-completion-method)
-	(semanticdb-find-tags-by-class-method)
-	(semanticdb-deep-find-tags-by-name-method)
-	(semanticdb-deep-find-tags-for-completion-method):
-	* cedet/semantic/db-el.el (semanticdb-elisp-mapatom-collector)
-	(semanticdb-find-tags-by-name-method, emacs-lisp-mode)
-	(semanticdb-find-tags-for-completion-method)
-	(semanticdb-find-tags-by-class-method)
-	(semanticdb-deep-find-tags-for-completion-method):
-	* cedet/semantic/db-find.el (semanticdb-find-translate-path)
-	(semanticdb-find-need-cache-update-p, semanticdb-find-result-with-nil-p)
-	(semanticdb-find-scanned-include-tags, semanticdb-find-tags-collector)
-	(semanticdb-find-tags-by-name-method)
-	(semanticdb-find-tags-by-name-regexp-method)
-	(semanticdb-find-tags-for-completion-method)
-	(semanticdb-find-tags-by-class-method)
-	(semanticdb-find-tags-external-children-of-type-method)
-	(semanticdb-find-tags-subclasses-of-type-method)
-	(semanticdb-deep-find-tags-by-name-method)
-	(semanticdb-deep-find-tags-by-name-regexp-method)
-	(semanticdb-deep-find-tags-for-completion-method):
-	* cedet/semantic/db-global.el (semanticdb-enable-gnu-global-hook)
-	(semanticdb-enable-gnu-global-in-buffer)
-	(semanticdb-find-tags-for-completion-method)
-	(semanticdb-deep-find-tags-by-name-method)
-	(semanticdb-deep-find-tags-for-completion-method):
-	* cedet/semantic/db-javascript.el (semanticdb-javascript-tags)
-	(javascript-mode, semanticdb-find-translate-path)
-	(semanticdb-find-tags-for-completion-method)
-	(semanticdb-find-tags-by-class-method)
-	(semanticdb-deep-find-tags-by-name-method)
-	(semanticdb-deep-find-tags-for-completion-method)
-	(semanticdb-find-tags-external-children-of-type-method):
-	* cedet/semantic/idle.el (semantic-idle-work-core-handler)
-	(define-semantic-idle-service, semantic-idle-summary-useful-context-p)
-	(global-semantic-idle-scheduler-mode):
-	* cedet/srecode/dictionary.el (srecode-field-value)
-	(srecode-dictionary-add-section-dictionary):
 	* emacs-lisp/eieio.el (eieio-error-unsupported-class-tags)
 	(eieio-generic-form, eieio-help-mode-augmentation-maybee, eieio-browse)
 	(describe-class, eieio-describe-generic, describe-generic):
@@ -2027,13 +2197,8 @@
 
 	* calc/calc.el (calc-command-flags): Give it an initial value.
 
-2010-01-17  Glenn Morris  <rgm@gnu.org>
-
-	* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer): Doc fix.
-
 2010-01-17  Juanma Barranquero  <lekktu@gmail.com>
 
-	* cedet/semantic.el (semantic-mode):
 	* files.el (minibuffer-with-setup-hook):
 	* textmodes/artist.el (artist-mt, artist-key-undraw-continously)
 	(artist-key-draw-continously, artist-key-do-continously-continously)
@@ -2065,17 +2230,6 @@
 
 2010-01-16  Mario Lang  <mlang@delysid.org>
 
-	* cedet/ede/cpp-root.el (ede-cpp-root-project):
-	* cedet/ede/files.el (ede-expand-filename):
-	* cedet/ede/simple.el (ede-simple-project):
-	* cedet/semantic/complete.el (semantic-complete-read-tag-engine)
-	(semantic-complete-inline-tag-engine):
-	* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
-	* cedet/semantic/db-global.el (semanticdb-equivalent-mode):
-	* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
-	* cedet/semantic/db.el (semanticdb-equivalent-mode):
-	* cedet/semantic/decorate/include.el (semantic-decoration-unknown-include-describe):
-	* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
 	* emacs-lisp/chart.el (chart-translate-namezone):
 	* textmodes/artist.el (artist-compute-popup-menu-table):
 	Remove duplicated words in doc-strings.
@@ -2104,13 +2258,6 @@
 	* find-cmd.el (find-constituents):
 	* vc-arch.el (vc-arch-root):
 	* window.el (window-body-height, pop-up-frames):
-	* cedet/semantic/edit.el (semantic-reparse-needed-change-hook)
-	(semantic-no-reparse-needed-change-hook):
-	* cedet/srecode/insert.el (srecode-resolve-argument-list)
-	(srecode-template-inserter-blank, srecode-template-inserter-variable)
-	(srecode-template-inserter-ask, srecode-template-inserter-width)
-	(srecode-template-inserter-section-start)
-	(srecode-template-inserter-section-end, srecode-insert-method):
 	* emacs-lisp/eieio-base.el (eieio-singleton, slot-missing):
 	* progmodes/ada-stmt.el (ada-if):
 	* progmodes/gdb-ui.el (gdb-jsonify-buffer):
@@ -2181,36 +2328,6 @@
 	* mail/emacsbug.el (report-emacs-bug-pretest-address): Set
 	it to bug-gnu-emacs rather than emacs-pretest-bug.
 
-2010-01-12  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/data-debug.el (data-debug): Fix customization group reference.
-
-2010-01-12  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/semantic/analyze.el (semantic-analyze-push-error)
-	(semantic-analyze-context, semantic-analyze-context-assignment)
-	(semantic-analyze-find-tag-sequence, semantic-analyze-find-tag):
-	* cedet/semantic/java.el (java-mode, semantic-tag-include-filename)
-	(semantic-java-doc-keywords-map):
-	* cedet/semantic/bovine/c.el (c-mode, semantic-c-member-of-autocast)
-	(semantic-lex-c-nested-namespace-ignore-second, semantic-parse-region)
-	(semantic-c-parse-lexical-token, semantic-c-debug-mode-init-pch)
-	(semantic-c-classname, semantic-format-tag-uml-prototype)
-	(semantic-c-dereference-namespace, semantic-analyze-type-constants):
-	* cedet/semantic/bovine/el.el (semantic-elisp-form-to-doc-string)
-	(semantic-emacs-lisp-obsoleted-doc, semantic-up-context)
-	(semantic-get-local-variables, semantic-end-of-command)
-	(semantic-beginning-of-command, semantic-ctxt-current-class-list)
-	(lisp-mode):
-	* cedet/semantic/bovine/make.el (makefile-mode):
-	* cedet/semantic/wisent/python.el (wisent-python-string-re)
-	(wisent-python-implicit-line-joining-p, wisent-python-forward-string)
-	(wisent-python-lex-beginning-of-line, wisent-python-lex-end-of-line)
-	(semantic-lex, semantic-get-local-variables, python-mode):
-	* cedet/semantic/wisent/python-wy.el (wisent-python-wy--keyword-table):
-	* cedet/srecode/extract.el (srecode-extract-state-set)
-	(srecode-extract-method): Fix typos in docstrings.
-
 2010-01-11  Sam Steingold  <sds@gnu.org>
 
 	* imenu.el (imenu-default-create-index-function): Detect infinite
@@ -2269,17 +2386,9 @@
 
 2010-01-10  Chong Yidong  <cyd@stupidchicken.com>
 
-	* cedet/semantic.el (semantic-new-buffer-setup-functions):
-	Add python parser.
-
 	* Makefile.in (ELCFILES): Add wisent/python-wy.el and
 	wisent/python.el.
 
-2010-01-10  Richard Kim  <emacs18@gmail.com>
-
-	* cedet/semantic/wisent/python-wy.el:
-	* cedet/semantic/wisent/python.el: New files.
-
 2010-01-09  Chong Yidong  <cyd@stupidchicken.com>
 
 	* man.el (Man-goto-section): Signal error if the section is not
@@ -2463,9 +2572,6 @@
 
 	* mpc.el (mpc-playlist-delete): Fix typo in error messages.
 
-	* cedet/semantic/db-typecache.el (semanticdb-typecache-find-default):
-	Fix typo in docstring.
-
 	* net/imap-hash.el (imap-hash-make): Doc fix.
 	(imap-hash-test): Fix typo in error message; reflow docstring.
 	(imap-hash-p, imap-hash-get, imap-hash-put, imap-hash-make-message)
@@ -2694,14 +2800,6 @@
 	`Info-display-images-node', and not put the `invisible' property
 	in this case.
 
-2009-12-14  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
-	(semantic-mru-bookmark-mode): Doc fixes.
-
-	* cedet/semantic/db.el (semanticdb-cache-get): Use error instead
-	of assert.
-
 2009-12-13  Glenn Morris  <rgm@gnu.org>
 
 	* mail/emacsbug.el (message-sort-headers): Define for compiler.
@@ -3119,9 +3217,6 @@
 	* bindings.el (complete-symbol): Call semantic-ia-complete-symbol
 	if possible.
 
-	* cedet/semantic/ia.el (semantic-ia-complete-symbol):
-	Make argument optional.
-
 	* shell.el (shell): Require ansi-color (Bug#5113).
 
 	* ansi-color.el (ansi-color-for-comint-mode): Default to t.
@@ -3149,24 +3244,6 @@
 	(Info-mode-menu): Add `Info-virtual-index' to the menu.
 	(Info-mode): Add `Info-virtual-index' to the docstring.
 
-2009-12-05  Eric Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
-	Describe project macro symbols.
-
-	* cedet/semantic/complete.el (semantic-complete-do-completion):
-	Don't call semantic-collector-current-exact-match.
-
-	* cedet/ede.el (ede-apply-preprocessor-map): Accept lists of
-	ede-objects as targets.
-
-	* cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Output
-	a target's object list even if compiler vars are already in the
-	Makefile.
-
-	* cedet/ede/emacs.el (ede-preprocessor-map): Add config.h to the
-	list of headers producing necessary macros.
-
 2009-12-05  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
 	* textmodes/bibtex.el (bibtex-map-entries): Use marker to keep
@@ -4049,9 +4126,6 @@
 	* bookmark.el (bookmark-bmenu-hide-filenames): Remove assignment to
 	deleted variable bookmark-bmenu-bookmark-column.
 
-	* cedet/semantic/idle.el (global-semantic-idle-scheduler-mode):
-	Move after definition of global-semantic-idle-tag-highlight-mode.
-
 2009-11-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* bookmark.el (bookmark-bmenu-search): Clear echo area when exiting.
@@ -4116,56 +4190,6 @@
 	* dired-x.el (dired-guess-shell-alist-default):
 	Support xz format.  (Bug#4953)
 
-2009-11-22  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/srecode/map.el (srecode-get-maps):
-	* cedet/semantic/wisent/wisent.el (wisent-parse-toggle-verbose-flag):
-	* cedet/semantic/wisent/comp.el (wisent-toggle-verbose-flag):
-	* cedet/semantic/decorate/mode.el (semantic-decoration-mode)
-	(semantic-toggle-decoration-style):
-	* cedet/semantic/decorate/include.el
-	(semantic-decoration-include-describe)
-	(semantic-decoration-unknown-include-describe)
-	(semantic-decoration-unparsed-include-describe)
-	(semantic-decoration-all-include-summary):
-	* cedet/semantic/bovine/c.el (semantic-c-debug-mode-init):
-	* cedet/semantic/analyze/complete.el
-	(semantic-analyze-possible-completions):
-	* cedet/semantic/util-modes.el (semantic-highlight-edits-mode)
-	(semantic-show-unmatched-syntax-mode)
-	(semantic-show-parser-state-mode, semantic-stickyfunc-mode)
-	(semantic-highlight-func-mode):
-	* cedet/semantic/util.el (semantic-describe-buffer):
-	* cedet/semantic/symref.el (semantic-symref-find-references-by-name)
-	(semantic-symref-find-tags-by-name)
-	(semantic-symref-find-tags-by-regexp)
-	(semantic-symref-find-tags-by-completion)
-	(semantic-symref-find-file-references-by-name)
-	(semantic-symref-find-text):
-	* cedet/semantic/senator.el (senator-copy-tag, senator-kill-tag)
-	(senator-yank-tag):
-	* cedet/semantic/scope.el (semantic-calculate-scope):
-	* cedet/semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
-	* cedet/semantic/idle.el (semantic-idle-scheduler-mode)
-	(define-semantic-idle-service):
-	* cedet/semantic/complete.el (semantic-complete-analyze-inline)
-	(semantic-complete-analyze-inline-idle):
-	* cedet/semantic/analyze.el (semantic-analyze-current-context):
-	* cedet/mode-local.el (describe-mode-local-bindings)
-	(describe-mode-local-bindings-in-mode):
-	* cedet/ede/make.el (ede-make-check-version):
-	* cedet/ede/locate.el (ede-enable-locate-on-project):
-	* cedet/cedet-idutils.el (cedet-idutils-expand-filename)
-	(cedet-idutils-version-check):
-	* cedet/cedet-global.el (cedet-gnu-global-expand-filename)
-	(cedet-gnu-global-version-check):
-	* cedet/cedet-cscope.el (cedet-cscope-expand-filename)
-	(cedet-cscope-version-check): Use called-interactively-p instead
-	of interactive-p.
-
-	* cedet/semantic/ia.el (semantic-ia-completion-format-tag-function):
-	Use semantic-format-tag-prototype.
-
 2009-11-22  Michael Kifer  <kifer@cs.stonybrook.edu>
 
 	* emulation/viper-cmd.el: Use viper-last-command-char instead of
@@ -4192,12 +4216,6 @@
 	* progmodes/subword.el (subword-mode-map): Fix subword-mode-map
 	generation from word-movement command names.
 
-2009-11-21  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/semantic/complete.el (semantic-complete-read-tag-engine)
-	(semantic-complete-jump-local, semantic-complete-jump):
-	Improve prompt string.
-
 2009-11-21  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* cus-start.el (all): Add native condition for font-use-system-font.
@@ -4284,13 +4302,6 @@
 	(bookmark-bmenu-search): New command.
 	(bookmark-bmenu-mode-map): Bind it.
 
-2009-11-20  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/semantic/complete.el (semantic-complete-inline-map): Doc fix.
-
-	* cedet/semantic/idle.el (define-semantic-idle-service)
-	(semantic-idle-summary-mode, semantic-idle-completions): Doc fix.
-
 2009-11-20  Tassilo Horn  <tassilo@member.fsf.org>
 
 	* progmodes/cc-cmds.el: declare-functioned forward-subword and
@@ -4337,17 +4348,6 @@
 
 	* Makefile.in (ELCFILES): Regenerate.
 
-2009-11-20  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/cedet.el (cedet-menu-map): Re-order menu items.
-
-	* cedet/semantic.el: Enable idle-mode menu items only if
-	global-semantic-idle-scheduler-mode is enabled.
-	(semantic-default-submodes): Doc fix.
-
-	* cedet/semantic/idle.el (global-semantic-idle-scheduler-mode):
-	When turning off, disable other idle modes.
-
 2009-11-20  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* calc/calc.el (calc-set-mode-line):
@@ -4654,13 +4654,6 @@
 	* strokes.el (strokes-update-window-configuration): Make strokes
 	buffer current before erasing (Bug#4906).
 
-	* cedet/semantic/idle.el (semantic-idle-summary-mode)
-	(semantic-idle-summary-mode): Define using define-minor-mode
-	instead of define-semantic-idle-service.
-	(semantic-idle-summary-mode): New function.
-	(semantic-idle-summary-mode-setup): Use pre-command-hook to ensure
-	that mouse motion does not reset the echo area.
-
 2009-11-15  Juri Linkov  <juri@jurta.org>
 
 	* simple.el (set-mark-default-inactive): Add :type, :group
@@ -5029,9 +5022,6 @@
 
 2009-11-08  Chong Yidong  <cyd@stupidchicken.com>
 
-	* cedet/semantic/ctxt.el (semantic-get-local-variables): Disable
-	the progress reporter entirely.
-
 	* emulation/cua-base.el: Add CUA property to some CC mode commands
 	(Bug#4100).
 
@@ -5314,79 +5304,6 @@
 
 	* emacs-lisp/autoload.el (generated-autoload-feature): Remove.
 	(autoload-rubric): Don't use any more.
-	* cedet/semantic/fw.el (semantic/loaddefs):
-	* cedet/srecode.el (srecode/loaddefs):
-	* cedet/ede.el (ede/loaddefs): Load rather than require.
-	* cedet/ede/cpp-root.el:
-	* cedet/ede/emacs.el:
-	* cedet/ede/files.el:
-	* cedet/ede/linux.el:
-	* cedet/ede/locate.el:
-	* cedet/ede/make.el:
-	* cedet/ede/shell.el:
-	* cedet/ede/speedbar.el:
-	* cedet/ede/system.el:
-	* cedet/ede/util.el:
-	* cedet/semantic/analyze.el:
-	* cedet/semantic/bovine.el:
-	* cedet/semantic/complete.el:
-	* cedet/semantic/ctxt.el:
-	* cedet/semantic/db-file.el:
-	* cedet/semantic/db-find.el:
-	* cedet/semantic/db-global.el:
-	* cedet/semantic/db-mode.el:
-	* cedet/semantic/db-typecache.el:
-	* cedet/semantic/db.el:
-	* cedet/semantic/debug.el:
-	* cedet/semantic/dep.el:
-	* cedet/semantic/doc.el:
-	* cedet/semantic/edit.el:
-	* cedet/semantic/find.el:
-	* cedet/semantic/format.el:
-	* cedet/semantic/html.el:
-	* cedet/semantic/ia-sb.el:
-	* cedet/semantic/ia.el:
-	* cedet/semantic/idle.el:
-	* cedet/semantic/lex-spp.el:
-	* cedet/semantic/lex.el:
-	* cedet/semantic/mru-bookmark.el:
-	* cedet/semantic/scope.el:
-	* cedet/semantic/senator.el:
-	* cedet/semantic/sort.el:
-	* cedet/semantic/symref.el:
-	* cedet/semantic/tag-file.el:
-	* cedet/semantic/tag-ls.el:
-	* cedet/semantic/tag-write.el:
-	* cedet/semantic/tag.el:
-	* cedet/semantic/util-modes.el:
-	* cedet/semantic/analyze/complete.el:
-	* cedet/semantic/analyze/refs.el:
-	* cedet/semantic/bovine/c.el:
-	* cedet/semantic/bovine/gcc.el:
-	* cedet/semantic/bovine/make.el:
-	* cedet/semantic/bovine/scm.el:
-	* cedet/semantic/decorate/include.el:
-	* cedet/semantic/decorate/mode.el:
-	* cedet/semantic/symref/cscope.el:
-	* cedet/semantic/symref/global.el:
-	* cedet/semantic/symref/grep.el:
-	* cedet/semantic/symref/idutils.el:
-	* cedet/semantic/symref/list.el:
-	* cedet/semantic/wisent/java-tags.el:
-	* cedet/semantic/wisent/javascript.el:
-	* cedet/srecode/compile.el:
-	* cedet/srecode/cpp.el:
-	* cedet/srecode/document.el:
-	* cedet/srecode/el.el:
-	* cedet/srecode/expandproto.el:
-	* cedet/srecode/getset.el:
-	* cedet/srecode/insert.el:
-	* cedet/srecode/java.el:
-	* cedet/srecode/map.el:
-	* cedet/srecode/mode.el:
-	* cedet/srecode/template.el:
-	* cedet/srecode/texi.el: Remove the file-local setting of
-	generated-autoload-feature.
 
 	* emacs-lisp/byte-run.el (define-obsolete-variable-alias): Use dolist,
 	and only put a prop if it is non-nil.
@@ -5403,8 +5320,6 @@
 
 2009-11-03  Glenn Morris  <rgm@gnu.org>
 
-	* cedet/mode-local.el (with-mode-local): Doc fix.
-
 	* emacs-lisp/bytecomp.el (byte-compile-file-form-defvar)
 	(byte-compile-file-form-define-abbrev-table)
 	(byte-compile-file-form-custom-declare-variable)
@@ -5526,12 +5441,6 @@
 	* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
 	items.
 
-	* cedet/cedet.el (cedet-menu-map): Remove Semantic and EDE menu
-	items.
-
-	* cedet/ede.el (ede-minor-mode):
-	* cedet/semantic.el (semantic-mode): Toggle menu separators.
-
 2009-10-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* textmodes/two-column.el (2C-split):
@@ -5685,89 +5594,12 @@
 	(byte-compile-variable-ref, byte-compile-setq-default):
 	Respect `constants' member of byte-compile-warnings.
 
-	* cedet/semantic/tag.el (semantic--tag-link-list-to-buffer):
-	Use mapc rather than mapcar because the return value is never used.
-
-	* cedet/srecode/template.el, cedet/semantic/wisent/javascript.el:
-	* cedet/semantic/wisent/java-tags.el, cedet/semantic/texi.el:
-	* cedet/semantic/html.el:
-	Suppress harmless warnings about setting up semantic-imenu (not
-	part of Emacs) variables.
-
 2009-10-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* vc-bzr.el (vc-bzr-revision-keywords): New var.
 	(vc-bzr-revision-completion-table): Use it to fix completion of "s:"
 	to "submit:".
 
-	* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
-	* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
-	* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
-	* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
-	* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
-	* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
-	(semantic-analyzer-debug-global-symbol)
-	(semantic-analyzer-debug-missing-innertype)
-	(semantic-analyzer-debug-insert-include-summary):
-	* cedet/semantic/util.el (semantic-file-tag-table):
-	(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
-	(semantic-recursive-find-nonterminal-by-name):
-	* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
-	* cedet/semantic/tag-file.el (semantic-prototype-file):
-	* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
-	* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
-	* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
-	* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
-	(semantic-idle-summary-maybe-highlight):
-	* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
-	(semantic-ia-sb-tag-info):
-	* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
-	* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
-	* cedet/semantic/ede-grammar.el (project-compile-target):
-	(ede-proj-makefile-insert-variables):
-	* cedet/semantic/debug.el (semantic-debug-set-parser-location):
-	(semantic-debug-set-source-location, semantic-debug-interface-layout)
-	(semantic-debug-mode, semantic-debug):
-	* cedet/semantic/db.el (semanticdb-needs-refresh-p):
-	* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
-	* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
-	* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
-	(semanticdb-find-translate-path-includes--internal)
-	(semanticdb-reset-log, semanticdb-find-log-activity):
-	* cedet/semantic/db-file.el (object-write):
-	* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
-	* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
-	(semanticdb-create-ebrowse-database):
-	* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
-	* cedet/semantic/complete.el (semantic-displayor-focus-request)
-	(semantic-collector-calculate-completions-raw)
-	(semantic-complete-read-tag-analyzer):
-	* cedet/semantic/analyze.el (semantic-analyze-pulse):
-	* cedet/ede/util.el (ede-update-version-in-source):
-	* cedet/ede/proj.el (project-delete-target):
-	* cedet/ede/proj-elisp.el (ede-update-version-in-source)
-	(ede-proj-flush-autoconf):
-	* cedet/ede/pconf.el (ede-proj-configure-synchronize)
-	(ede-proj-configure-synchronize):
-	* cedet/ede/locate.el (ede-locate-file-in-project-impl):
-	* cedet/ede/linux.el (ede-linux-version):
-	* cedet/ede/emacs.el (ede-emacs-version):
-	* cedet/ede/dired.el (ede-dired-add-to-target):
-	* cedet/ede.el (ede-buffer-header-file, ede-find-target)
-	(ede-buffer-documentation-files, ede-project-buffers, ede-set)
-	(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
-	* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
-	(cedet-idutils-lid-call, cedet-idutils-expand-filename)
-	(cedet-idutils-version-check):
-	* cedet/cedet-global.el (cedet-gnu-global-call):
-	(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
-	(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
-	* cedet/cedet-cscope.el (cedet-cscope-call)
-	(cedet-cscope-expand-filename, cedet-cscope-version-check):
-	Use with-current-buffer.
-	* cedet/ede.el (ede-make-project-local-variable)
-	(ede-set-project-variables, ede-set): Use dolist.
-
 2009-10-30  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* textmodes/ispell.el (ispell-skip-region-alist):
@@ -5811,16 +5643,6 @@
 	(calc-embedded-finish-command, calc-embedded-stack-change):
 	* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
 
-	* cedet/mode-local.el (make-obsolete-overload): Add `when' argument.
-	(overload-docstring-extension): Use that info.
-	* cedet/semantic/fw.el (semantic-alias-obsolete): Pass the `when' info.
-	* cedet/semantic/idle.el (semantic-eldoc-current-symbol-info):
-	* cedet/semantic/tag-ls.el (semantic-nonterminal-protection)
-	(semantic-nonterminal-abstract, semantic-nonterminal-leaf)
-	(semantic-nonterminal-full-name): Add the new `when' info.
-	* cedet/semantic/decorate/mode.el (semantic/decorate): Require CL for
-	`assert'.
-
 	* pcomplete.el (pcomplete-comint-setup): If there's a choice, replace
 	shell-dynamic-complete-filename in preference to
 	comint-dynamic-complete-filename.
@@ -5961,36 +5783,6 @@
 	* bookmark.el (bookmark-bmenu-list): Don't use switch-to-buffer if
 	we're inside a dedicated or minibuffer window.
 
-2009-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
-
-	* cedet/semantic/fw.el (semantic-alias-obsolete)
-	(semantic-varalias-obsolete): Make the `when' arg mandatory.
-	(define-mode-overload-implementation):
-	* cedet/semantic/decorate/mode.el (semantic-decorate-pending-decoration-hooks):
-	* cedet/semantic/wisent.el (wisent-lex-make-token-table):
-	* cedet/semantic/util.el (semantic-file-token-stream)
-	(semantic-something-to-stream):
-	* cedet/semantic/tag.el (semantic-tag-make-assoc-list)
-	(semantic-expand-nonterminal):
-	* cedet/semantic/tag-file.el (semantic-find-nonterminal)
-	(semantic-find-dependency, semantic-find-nonterminal)
-	(semantic-find-dependency):
-	* cedet/semantic/lex.el (semantic-flex-start, semantic-flex-end)
-	(semantic-flex-text, semantic-flex-make-keyword-table)
-	(semantic-flex-keyword-p, semantic-flex-keyword-put)
-	(semantic-flex-keyword-get, semantic-flex-map-keywords)
-	(semantic-flex-keywords, semantic-flex-buffer, semantic-flex-list):
-	* cedet/semantic/java.el (semantic-java-prototype-nonterminal):
-	* cedet/semantic/idle.el (semantic-before-idle-scheduler-reparse-hooks)
-	(semantic-after-idle-scheduler-reparse-hooks):
-	* cedet/semantic/edit.el (semantic-edits-incremental-reparse-failed-hooks):
-	* cedet/semantic/db-mode.el (semanticdb-mode-hooks):
-	* cedet/semantic.el (semantic-toplevel-bovine-table)
-	(semantic-toplevel-bovine-cache)
-	(semantic-before-toplevel-bovination-hook, semantic-init-hooks)
-	(semantic-init-mode-hooks, semantic-init-db-hooks)
-	(semantic-bovination-working-type): Provide the `when' arg.
-
 2009-10-24  Karl Fogel  <kfogel@red-bean.com>
 
 	* bookmark.el: Update documentation, especially documentation
@@ -6019,15 +5811,6 @@
 	* files.el (delete-directory): Delete symlinks to directories with
 	delete-file (Bug#4739).
 
-2009-10-24  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/semantic/util.el (semantic-recursive-find-nonterminal-by-name):
-	* cedet/semantic/tag.el (semantic-token-type-parent): Add WHEN
-	argument to make-obsolete.
-
-	* cedet/semantic/fw.el (semantic-alias-obsolete)
-	(semantic-varalias-obsolete): Add optional WHEN argument.
-
 2009-10-24  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc.el (vc-backend-for-registration): Rename from
@@ -6229,16 +6012,6 @@
 
 	* help-fns.el: Don't require help-mode (to avoid bootstrap issues).
 
-2009-10-21  Eric Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/bovine/c.el (semantic-c-debug-mode-init)
-	(semantic-c-debug-mode-init-pch): New functions.
-	(semantic-c-debug-mode-init-last-mode): New var.
-	(semantic-c-parse-lexical-token): Use them.
-
-	* cedet/semantic/lex-spp.el (semantic-lex-spp-anlyzer-do-replace):
-	When extracting the argument list, limit only by point-max.
-
 2009-10-21  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp-smb.el (tramp-smb-get-stat-capability): New defun.
@@ -6353,81 +6126,6 @@
 	(tar-header-block-tokenize): Decode the username and groupname.
 	(tar-chown-entry, tar-chgrp-entry): Encode the names (bug#4730).
 
-2009-10-17  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/srecode/srt.el:
-	* cedet/srecode/compile.el:
-	* cedet/semantic/mru-bookmark.el:
-	* cedet/semantic/debug.el:
-	* cedet/semantic/complete.el:
-	* cedet/semantic/analyze.el: Require CL when compiling.
-
-2009-10-17  Eric Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/scope.el
-	(semantic-analyze-scoped-inherited-tag-map): Wrap calculation of
-	tmpscope so that the regular scope will continue to work.
-
-	* cedet/semantic/idle.el (semantic-idle-tag-highlight):
-	Use semantic-idle-summary-highlight-face as the highlighting.
-
-	* emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer
-	contains multibyte characters, choose first applicable coding
-	system automatically.
-
-	* cedet/ede/project-am.el (project-run-target): New method.
-	(project-run-target): New method.
-
-	* cedet/ede.el (ede-target): Add run target menu item.
-	(ede-project, ede-minor-keymap): Add ede-run-target binding.
-	(ede-run-target): New function.
-	(ede-target::project-run-target): New method.
-
-	* cedet/ede/proj.el (project-run-target): New method.
-
-	* cedet/ede/proj-shared.el (ede-gcc-libtool-shared-compiler)
-	(ede-g++-libtool-shared-compiler): Remove SHELL.  Remove COMMANDS.
-	Add :rules.
-	(ede-proj-target-makefile-shared-object): Only libtool compilers
-	now available.  Add linkers for libtool.
-	(ede-cc-linker-libtool, ede-g++-linker-libtool): New.
-	(ede-proj-makefile-target-name): Always use .la extension.
-
-	* cedet/ede/proj-prog.el (project-run-target): New method.
-
-	* cedet/ede/proj-obj.el (ede-cc-linker): Rename from ede-gcc-linker.
-	(ede-g++-linker): Change Change link lines.
-
-	* cedet/ede/pmake.el (ede-pmake-insert-variable-shared):
-	When searching for old variables, go to the end of the buffer and
-	search backward from there.
-	(ede-proj-makefile-automake-insert-subdirs)
-	(ede-proj-makefile-automake-insert-extradist): New methods.
-	(ede-proj-makefile-create): Use them.
-
-	* cedet/ede/pconf.el (ede-proj-configure-test-required-file):
-	Force FILE to expand to the current target.  Use file-exists-p to
-	check that it exists.
-
-	* cedet/ede/linux.el (ede-linux-version): Don't call "head".
-	(ede-linux-load): Wrap dir in file-name-as-directory.
-	Set :version slot.
-
-	* cedet/ede/files.el (ede-get-locator-object): When enabling
-	locate, do so on "top".
-
-	* cedet/ede/emacs.el (ede-emacs-file-existing): Wrap "dir" in
-	file-name-as-directory during compare.
-	(ede-emacs-version): Return Emacs/XEmacs differentiator.
-	Get version number from different places.  Don't call egrep.
-	(ede-emacs-load): Set :version slot.  Call file-name-as-directory
-	to set the directory.
-
-	* cedet/ede/shell.el: New file.
-
-	* cedet/inversion.el (inversion-decoders): Allow for stray . in
-	alpha/beta variants.
-
 2009-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* international/mule-cmds.el (select-safe-coding-system): If the file
@@ -6435,9 +6133,6 @@
 
 2009-10-17  Glenn Morris  <rgm@gnu.org>
 
-	* cedet/semantic/grammar.el (semantic-grammar--lex-delim-spec):
-	All errors should have messages.
-
 	* foldout.el (foldout-mouse-swallow-events):
 	* gs.el (gs-load-image): Replace obsolete forms of sit-for, sleep-for.
 
@@ -6736,16 +6431,6 @@
 	* calendar/calendar.el (calendar-split-width-threshold): New option.
 	(calendar-basic-setup): Use calendar-split-width-threshold.
 
-2009-10-10  Sascha Wilde  <wilde@sha-bang.de>
-
-	* cedet/ede/proj-shared.el (ede-proj-makefile-target-name):
-	Use .la for Automake.
-
-2009-10-09  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede/pconf.el (ede-proj-configure-synchronize):
-	Use "autoreconf -i".  Suggested by Andreas Schwab.
-
 2009-10-09  Juanma Barranquero  <lekktu@gmail.com>
 
 	* international/mule-cmds.el (ucs-names): Exclude new "Enclosed
@@ -6774,13 +6459,6 @@
 	(bookmark-jump-other-window): Just invoke bookmark-jump with new
 	argument now, so the two function's behaviors will match.  (Bug#3645)
 
-2009-10-08  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede/proj.el (project-make-dist, project-compile-project):
-	Fix filename test.
-	(ede-proj-dist-makefile): Use expand-file-name instead of concat
-	to expand file names.
-
 2009-10-08  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (tramp-file-name-real-user, tramp-file-name-domain)
@@ -6792,15 +6470,6 @@
 	(tramp-smb-handle-expand-file-name): Implement "~" expansion.
 	(tramp-smb-maybe-open-connection): Flush the cache only if necessary.
 
-2009-10-08  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede/proj-obj.el (ede-gcc-linker): New var.
-	(ede-proj-target-makefile-objectcode): Use it.
-
-	* cedet/ede/source.el (ede-want-any-source-files-p)
-	(ede-want-any-auxiliary-files-p, ede-want-any-files-p):
-	Return search result.  This error was introduced while merging.
-
 2009-10-07  Juanma Barranquero  <lekktu@gmail.com>
 
 	* makefile.w32-in (WINS_UPDATES): Fix typo in previous change.
@@ -7075,26 +6744,6 @@
 	(Info-bookmark-jump): Document with a doc string, not just a comment.
 	(Bug#4203)
 
-2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/semantic.el (semantic-new-buffer-setup-functions): New option.
-	(semantic-new-buffer-fcn): Call parser setup functions here.
-	(semantic-mode): Don't call parser setup functions here, it's done
-	in semantic-new-buffer-fcn now.
-	(semantic-mode): Parse all existing buffers when enabled.
-
-	* cedet/srecode/compile.el (srecode-compile-file):
-	Call semantic-new-buffer-fcn if the buffer has not been parsed.
-
-2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede/pmake.el (ede-pmake-insert-variable-once): Delete.
-
-	* cedet/ede/proj-comp.el: Don't require ede/pmake at toplevel.
-	(proj-comp-insert-variable-once): New macro, renamed from
-	ede-pmake-insert-variable-once in ede/pmake.edl.
-	(ede-proj-makefile-insert-variables): Use it.
-
 2009-10-04  Michael Albinus  <michael.albinus@gmx.de>
 
 	* files.el (copy-directory): New defun.
@@ -7103,35 +6752,12 @@
 
 2009-10-04  Juanma Barranquero  <lekktu@gmail.com>
 
-	* cedet/ede/makefile-edit.el (makefile-beginning-of-command)
-	(makefile-end-of-command):
-	* cedet/srecode/srt-mode.el (semantic-beginning-of-context)
-	(semantic-end-of-context): Fix previous change.  Doc fixes.
-
-2009-10-04  Juanma Barranquero  <lekktu@gmail.com>
-
 	* files-x.el (modify-dir-local-variable)
-	(copy-dir-locals-to-file-locals-prop-line):
-	* cedet/ede/makefile-edit.el (makefile-beginning-of-command)
-	(makefile-end-of-command):
-	* cedet/semantic/lex.el (semantic-lex-token):
-	* cedet/semantic/analyze/fcn.el
-	(semantic-analyze-dereference-metatype-1):
-	* cedet/semantic/bovine/c.el (semantic-lex-cpp-define)
-	(semantic-lex-cpp-undef):
-	* cedet/semantic/wisent/wisent.el (wisent-skip-block):
-	* cedet/srecode/srt-mode.el (semantic-beginning-of-context)
-	(semantic-end-of-context): Fix typos in docstrings.
+	(copy-dir-locals-to-file-locals-prop-line): Fix typos in
+	docstrings.
 
 	* recentf.el (recentf-unload-function): New function.
 
-2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/ede.el (ede-project-placeholder-cache-file):
-	* cedet/semantic/db-file.el (semanticdb-default-save-directory):
-	* cedet/srecode/map.el (srecode-map-save-file):
-	Use locate-user-emacs-file.  Suggested by Juanma Barranquero.
-
 2009-10-04  Glenn Morris  <rgm@gnu.org>
 
 	* window.el (window-full-height-p): Add doc string.
@@ -7140,51 +6766,6 @@
 
 	* window.el (window-full-height-p): New function.  (Bug#4543)
 
-2009-10-03  Chong Yidong  <cyd@stupidchicken.com>
-
-	* cedet/srecode/insert.el: Require srecode/args.
-
-	* cedet/srecode/args.el: Require srecode/dictionary instead of
-	srecode/insert.
-
-	* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
-
-	* files.el (auto-mode-alist): Add .srt and Project.ede.
-
-	* cedet/semantic.el (semantic-mode):
-	Handle srecode-template-mode-hook as well.
-	(semantic-mode): Use js-mode-hook for Javascript hook.
-
-	* cedet/srecode/template.el: Remove hook variable.
-
-	* cedet/ede/proj-comp.el: Require ede/pmake when compiling.
-
-	* cedet/ede.el (ede-target-forms-menu): Don't enable if no
-	projects exist.
-	(ede-project-placeholder-cache-file): Default to a file in
-	user-emacs-directory.
-
-	* cedet/srecode/map.el (srecode-map-base-template-dir): Look for
-	templates in data-directory.
-	(srecode-map-save-file): Default to a file in user-emacs-directory.
-
-	* cedet/ede/srecode.el (ede-srecode-setup): Use default templates
-	directory.
-
-2009-09-30  Eric Ludlam  <zappo@gnu.org>
-
-	* cedet/semantic/util-modes.el (semantic-highlight-func-mode):
-	Doc fix.
-
-	* cedet/ede/proj-comp.el (ede-proj-makefile-insert-variables):
-	Only insert each variable once.
-
-	* cedet/ede/pmake.el (ede-pmake-insert-variable-once): New macro.
-	(ede-pmake-insert-variable-shared): Use it.
-
-	* cedet/ede/cpp-root.el (ede-preprocessor-map): Do not deref table
-	for lexical table iff table is nil.
-
 2009-10-03  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc.el: Remove commented out code.
@@ -7204,9 +6785,6 @@
 	the frame is wide.
 	(calendar-generate-window): Test for shrinkability rather than width.
 
-	* cedet/semantic/db-find.el (data-debug-insert-tag-list): Comment out
-	declaration, currently false.
-
 	* mail/rmail.el (rmail-generate-viewer-buffer): Be more careful about
 	reusing existing buffers, in case we happen to visit two files with the
 	same basename.  (Bug#4593)
@@ -7476,142 +7054,10 @@
 	* emacs-lisp/eieio.el (defclass, eieio-defclass-autoload)
 	(eieio-copy-parents-into-subclass, make-instance, class-children)
 	(eieio-generic-form):
-	* cedet/cedet-files.el (cedet-directory-name-to-file-name):
-	* cedet/cedet-idutils.el (cedet-idutils-search)
-	(cedet-idutils-expand-filename, cedet-idutils-support-for-directory)
-	(cedet-idutils-version-check):
-	* cedet/cedet.el (cedet-version):
-	* cedet/data-debug.el (data-debug-insert-overlay-button)
-	(data-debug-insert-overlay-list-button)
-	(data-debug-insert-buffer-button)
-	(data-debug-insert-buffer-list-button)
-	(data-debug-insert-process-button, data-debug-insert-ring-button)
-	(data-debug-insert-widget, data-debug-insert-stuff-list-button)
-	(data-debug-insert-stuff-vector-button)
-	(data-debug-insert-symbol-button, data-debug-insert-string)
-	(data-debug-insert-number, data-debug-insert-lambda-expression)
-	(data-debug-insert-nil, data-debug-insert-simple-thing)
-	(data-debug-insert-custom, data-debug-edebug-expr):
-	* cedet/ede.el (ede-auto-add-method, ede-project-class-files)
-	(global-ede-mode-map, ede-new, ede-debug-target)
-	(ede-customize-current-target, ede-buffers, ede-map-buffers, ede-set):
-	* cedet/semantic.el (semantic-minimum-working-buffer-size)
-	(semantic-fetch-tags, semantic-submode-list)
-	(semantic-default-submodes):
-	* cedet/ede/source.el (ede-source-match):
-	* cedet/ede/project-am.el (project-am-type-alist, project-add-file)
-	(project-am-package-info):
-	* cedet/ede/proj.el (ede-proj-target, project-new-target):
-	* cedet/ede/proj-elisp.el (ede-proj-tweak-autoconf):
-	* cedet/ede/proj-comp.el (ede-current-build-list):
-	* cedet/ede/makefile-edit.el (makefile-move-to-macro):
-	* cedet/ede/files.el (ede-toplevel-project-or-nil):
-	* cedet/ede/cpp-root.el (initialize-instance):
-	* cedet/ede/autoconf-edit.el (autoconf-find-last-macro)
-	(autoconf-parameter-strip, autoconf-insert-new-macro):
-	* cedet/semantic/wisent.el (wisent-lex-eoi):
-	* cedet/semantic/util-modes.el (global-semantic-show-parser-state-mode)
-	(semantic-show-parser-state-mode):
-	* cedet/semantic/texi.el (semantic-texi-environment-regexp):
-	* cedet/semantic/tag.el (semantic-tag-new-variable)
-	(semantic-tag-class, semantic-tag-new-variable, semantic-tag-copy)
-	(semantic--tag-deep-copy-attributes, semantic--tag-deep-copy-value)
-	(semantic--tag-deep-copy-tag-list)
-	(semantic-tag-components-with-overlays-default):
-	* cedet/semantic/symref.el (semantic-symref-find-text):
-	* cedet/semantic/senator.el (senator-yank-tag)
-	(senator-transpose-tags-up):
-	* cedet/semantic/scope.el (semantic-analyze-scoped-tags-default)
-	(semantic-analyze-scoped-inherited-tags, semantic-scope-find):
-	* cedet/semantic/sb.el (semantic-sb-autoexpand-length):
-	* cedet/semantic/lex.el (semantic-lex-comment-regex)
-	(semantic-lex-maximum-depth, define-lex, semantic-lex-token)
-	(semantic-lex-unterminated-syntax-protection, define-lex-analyzer):
-	* cedet/semantic/lex-spp.el
-	(semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
-	(semantic-lex-spp-symbol, semantic-lex-spp-one-token-to-txt):
-	* cedet/semantic/idle.el
-	(semantic-idle-summary-current-symbol-info-brutish)
-	(semantic-idle-summary-current-symbol-info-default):
-	* cedet/semantic/grammar.el (semantic-grammar-recreate-package)
-	(semantic--grammar-macro-compl-dict):
-	* cedet/semantic/grammar-wy.el (semantic-grammar-wy--parse-table):
-	* cedet/semantic/format.el (semantic-format-tag-custom-list)
-	(semantic-format-tag-canonical-name-default):
-	* cedet/semantic/find.el (semantic-find-tag-by-overlay-in-region)
-	(semantic-find-tags-for-completion)
-	(semantic-find-tags-by-scope-protection-default)
-	(semantic-deep-find-tags-for-completion):
-	* cedet/semantic/edit.el
-	(semantic-edits-incremental-reparse-failed-hook)
-	(semantic-edits-verbose-flag, semantic-edits-assert-valid-region)
-	(semantic-edits-splice-remove, semantic-edits-splice-replace):
-	* cedet/semantic/doc.el (semantic-documentation-comment-preceeding-tag):
-	* cedet/semantic/dep.el (semantic-dependency-include-path):
-	* cedet/semantic/db.el (semanticdb-default-find-index-class)
-	(semanticdb-match-any-mode, semanticdb-with-match-any-mode)
-	(semanticdb-project-roots):
-	* cedet/semantic/db-find.el (semanticdb-implied-include-tags)
-	(semanticdb-find-adebug-insert-scanned-tag-cons)
-	(semanticdb-find-log-buffer-name, semanticdb-find-result-mapc)
-	(semanticdb-brute-deep-find-tags-for-completion):
-	* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-add-tree-to-table):
-	* cedet/semantic/ctxt.el (semantic-beginning-of-context-default)
-	(semantic-end-of-context-default)
-	(semantic-ctxt-current-function-default)
-	(semantic-ctxt-scoped-types-default):
-	* cedet/semantic/complete.el (semantic-complete-read-tag-engine)
-	(semantic-complete-inline-tag-engine)
-	(semantic-complete-inline-custom-type)
-	(semantic-complete-read-tag-analyzer):
-	* cedet/semantic/chart.el (semantic-chart-tags-by-class)
-	(semantic-chart-database-size):
-	* cedet/semantic/analyze.el (semantic-analyze-current-symbol)
-	(semantic-analyze-current-context):
-	* cedet/semantic/symref/list.el (semantic-symref)
-	(semantic-symref-hide-buffer, semantic-symref-symbol):
-	* cedet/semantic/symref/grep.el (semantic-symref-grep-use-template):
-	* cedet/semantic/symref/filter.el (semantic-symref-hits-in-region):
-	* cedet/semantic/bovine/el.el (semantic-elisp-form-to-doc-string):
-	* cedet/semantic/bovine/c.el (semantic-lex-c-preprocessor-symbol-map)
-	(semantic-c-parse-token-hack-depth, semantic-c--template-name-1)
-	(semantic-c-dereference-template):
-	* cedet/semantic/analyze/refs.el (semantic--analyze-refs-full-lookup)
-	(semantic--analyze-refs-full-lookup-with-parents)
-	(semantic--analyze-refs-full-lookup-simple):
-	* cedet/semantic/analyze/complete.el
-	(semantic-analyze-possible-completions):
-	* cedet/srecode/table.el (srecode-mode-table-new):
-	* cedet/srecode/srt.el (srecode-read-variable-name):
-	* cedet/srecode/srt-mode.el (srecode-macro-help, srecode-in-macro-p):
-	* cedet/srecode/semantic.el (srecode-semantic-handle-:tag)
-	(srecode-semantic-handle-:tagtype, srecode-semantic-insert-tag):
-	* cedet/srecode/map.el (srecode-current-map):
-	* cedet/srecode/insert.el (srecode-insert)
-	(srecode-insert-variable-secondname-handler, srecode-insert-method)
-	(srecode-template-inserter-point-override)
-	(srecode-insert-include-lookup):
-	* cedet/srecode/getset.el (srecode-auto-choose-class):
-	* cedet/srecode/extract.el (srecode-inserter-extract):
-	* cedet/srecode/document.el
-	(srecode-document-autocomment-return-last-alist)
-	(srecode-document-autocomment-param-type-alist)
-	(srecode-document-insert-function-comment)
-	(srecode-document-insert-variable-one-line-comment)
-	(srecode-document-function-name-comment):
-	* cedet/srecode/dictionary.el (srecode-create-dictionary)
-	(srecode-compound-toString):
-	* cedet/srecode/compile.el (srecode-flush-active-templates):
-	* cedet/srecode/args.el (srecode-semantic-handle-:blank):
-	Doc/message fixes.
 
 	* vc-cvs.el (vc-cvs-parse-entry): Be more careful with the
 	match-data.  (Bug#4555).
 
-	* cedet/semantic/bovine/gcc.el
-	(semantic-c-reset-preprocessor-symbol-map): Fix declaration.
-	(semantic-gcc-get-include-paths, semantic-gcc-setup-data): Doc fixes.
-
 	* emacs-lisp/check-declare.el (check-declare-scan): Read the declaration
 	rather than parsing it as a regexp.  This relaxes the layout
 	requirements and makes errors easier to detect.
@@ -7626,41 +7072,8 @@
 	* term/w32-win.el (setup-default-fontset, set-fontset-font):
 	Remove unused declarations.
 
-2009-10-01  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/semantic/wisent/javat-wy.el
-	(wisent-java-tags-wy--keyword-table): Use \000 instead of literal ^@.
-
-2009-09-30  Juanma Barranquero  <lekktu@gmail.com>
-
-	* cedet/srecode/expandproto.el: Fix provide statement.
-
-2009-09-30  Eric Ludlam  <zappo@gnu.org>
-
-	* emacs-lisp/eieio.el (boolean-p): Delete.
-
-2009-09-30  Sascha Wilde  <wilde@sha-bang.de>
-
-	* cedet/ede/srecode.el: Fix provide statement.
-
 2009-09-30  Glenn Morris  <rgm@gnu.org>
 
-	* cedet/ede/proj.el (ede-proj-target-makefile-miscelaneous):
-	* cedet/ede/proj-aux.el (ede-aux-source):
-	* cedet/ede/proj-misc.el (ede-proj-target-makefile-miscelaneous)
-	(ede-misc-source):
-	* cedet/semantic/mru-bookmark.el (semantic-mrub-completing-read)
-	(semantic-mrub-switch-tags): Fix doc typos.
-
-	* cedet/semantic/db-global.el (data-debug-new-buffer)
-	(data-debug-insert-thing): Remove unneeded declarations (one broken).
-	(semanticdb-enable-gnu-global-databases): Fix prompt typo.
-
-	* cedet/semantic/analyze/fcn.el (semantic-scope-find): Fix declaration.
-
-	* cedet/semantic/bovine/gcc.el (semantic-gcc-setup): Replace runtime
-	use of CL function `remove-if-not'.
-
 	* emacs-lisp/authors.el (authors-ignored-files): Add "js2-mode.el".
 
 	* emacs-lisp/elint.el (elint-init-form): Report declarations where the
@@ -7698,16 +7111,6 @@
 
 2009-09-29  Glenn Morris  <rgm@gnu.org>
 
-	* cedet/semantic/symref/idutils.el:
-	* cedet/semantic/symref/list.el: Relicense under GPLv3+.
-
-	* cedet/ede/srecode.el (srecode-resolve-arguments): Fix declaration.
-
-	* cedet/semantic/complete.el (semantic-displayor-focus-abstract-child-p):
-	* cedet/semantic/tag-file.el (semanticdb-table-child-p):
-	* cedet/srecode/compile.el (srecode-template-inserter-newline-child-p):
-	Mark declarations not understood by check-declare.
-
 	* emacs-lisp/check-declare.el (check-declare-locate): Remove pointless
 	file-name-nondirectory call preventing location of cedet files.
 	(check-declare-verify): Use literal search rather than re-search.
@@ -7745,15 +7148,6 @@
 
 	* Makefile.in (ELCFILES): Add CEDET files.
 
-2009-09-28  Eric Ludlam  <zappo@gnu.org>
-
-	CEDET (development tools) package merged.
-
-	* cedet/*.el:
-	* cedet/ede/*.el:
-	* cedet/semantic/*.el:
-	* cedet/srecode/*.el: New files.
-
 2009-09-28  Michael Albinus  <michael.albinus@gmx.de>
 
 	* Makefile.in (ELCFILES): Add net/tramp-imap.elc.
@@ -7767,26 +7161,6 @@
 
 	* net/tramp-imap.el: New package.
 
-2009-09-28  Eric Ludlam  <zappo@gnu.org>
-
-	* emacs-lisp/chart.el:
-	* emacs-lisp/eieio-base.el:
-	* emacs-lisp/eieio-comp.el:
-	* emacs-lisp/eieio-custom.el:
-	* emacs-lisp/eieio-datadebug.el:
-	* emacs-lisp/eieio-opt.el:
-	* emacs-lisp/eieio-speedbar.el:
-	* emacs-lisp/eieio.el: New files.
-
-	* cedet/cedet-cscope.el:
-	* cedet/cedet-files.el:
-	* cedet/cedet-global.el:
-	* cedet/cedet-idutils.el:
-	* cedet/data-debug.el:
-	* cedet/inversion.el:
-	* cedet/mode-local.el:
-	* cedet/pulse.el: New files.
-
 2009-09-27  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
 	* whitespace.el (whitespace-trailing-regexp)
--- a/lisp/ChangeLog.1	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.1	Wed Oct 13 22:40:51 2010 +0900
@@ -570,11 +570,11 @@
 
 1986-01-18  Richard M. Stallman  (rms@prep)
 
-	* doctor.el:  Fix typo "symtoms".
+	* doctor.el: Fix typo "symtoms".
 
 1986-01-10  Richard Mlynarik  (mly@prep)
 
-	* mail-utils.el (mail-fetch-field)
+	* mail-utils.el (mail-fetch-field):
 	regexp-quote the argument.
 
 1986-01-10  Richard M. Stallman  (rms@prep)
@@ -917,7 +917,7 @@
 	* files.el (normal-mode):
 	New command to choose major mode automatically.
 
-	* inc-vers.el:  Renamed from inc-version.el
+	* inc-vers.el: Renamed from inc-version.el
 	for file name length reasons.
 
 	* term/*.el: terminal-specific files found here now.
@@ -2523,10 +2523,10 @@
 	No, this directory is added automatically to the path
 	used by call-process.  It should have worked before. - RMS
 
-	* loaddefs.el:  C-z -> C-c in documentation for mail.
+	* loaddefs.el: C-z -> C-c in documentation for mail.
 	autoload report-emacs-bug from emacsbug.el.
 
-	* emacsbug.el:  New file.  Reports bugs with version info.
+	* emacsbug.el: New file.  Reports bugs with version info.
 
 	* helper.el (Helper-describe-bindings):
 	Make it describe local bindings faster by binding global map to
@@ -2587,7 +2587,7 @@
 
 1985-06-11  K. Shane Hartman  (shane@mit-prep)
 
-	* ebuff-menu.el:  Make M-C-v scroll-other-window instead of
+	* ebuff-menu.el: Make M-C-v scroll-other-window instead of
 	scroll-down.  Make M-v scroll-down.
 
 	* ebuff-menu.el, echistory.el:	Made them use electric.
@@ -2602,7 +2602,7 @@
 	Made it use helper.el.  Remove kill-ring-save stuff pending use of
 	new winning prin1-to-string for minibuffer hacking.
 
-	* view.el:  Made it use helper.el.
+	* view.el: Made it use helper.el.
 
 	* helper.el:
 	New module for packages which want to do help without giving up
@@ -2804,7 +2804,7 @@
 
 1985-06-01  K. Shane Hartman  (shane@mit-prep)
 
-	* loaddefs.el:  Update documentation for rmail.
+	* loaddefs.el: Update documentation for rmail.
 
 	* lisp-mode.el (calculate-lisp-indent):
 	Asked (fboundp 'lisp-indent-hook).  Right question is boundp.
@@ -2858,7 +2858,7 @@
 	Skip strings, comments, char constants.
 	Find symbols even if they have no letters in them.
 
-	* mlsupport.el:  Insert symbol-value call in use-local-map.
+	* mlsupport.el: Insert symbol-value call in use-local-map.
 	Handle key codes > 127 in local-bind-to-key.
 	Write ml-modify-syntax-entry.
 
--- a/lisp/ChangeLog.12	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.12	Wed Oct 13 22:40:51 2010 +0900
@@ -1140,7 +1140,7 @@
 	(rcirc-keepalive-seconds): Remove variable.
 	(rcirc-server-name, rcirc-timeout-timer, rcirc-connecting)
 	(rcirc-process, rcirc-user-disconnect): New variables.
-	(rcirc-connect): Initalize new variables.
+	(rcirc-connect): Initialize new variables.
 	(rcirc-keepalive): Don't send keepalive pings before connection
 	is completed.
 	(rcirc-sentinel): Do mark all channels with activity when
--- a/lisp/ChangeLog.13	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.13	Wed Oct 13 22:40:51 2010 +0900
@@ -7567,7 +7567,7 @@
 	(ediff-setup-windows-plain-merge)
 	(ediff-setup-windows-plain-compare, ediff-setup-control-frame)
 	(ediff-refresh-control-frame, ediff-get-visible-buffer-window):
-	* ediff-util.el (ediff-setup-keymap, )
+	* ediff-util.el (ediff-setup-keymap)
 	(ediff-toggle-wide-display, ediff-toggle-multiframe)
 	(ediff-toggle-use-toolbar, ediff-really-quit)
 	(ediff-good-frame-under-mouse)
--- a/lisp/ChangeLog.14	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.14	Wed Oct 13 22:40:51 2010 +0900
@@ -640,7 +640,7 @@
 
 2009-04-11  Chong Yidong  <cyd@stupidchicken.com>
 
-	* files.el (dir-locals-directory-cache):  Rename from
+	* files.el (dir-locals-directory-cache): Rename from
 	dir-locals-directory-alist.  Change format to include
 	the mtime of the directory-local variables file (Bug#2833).
 	(dir-locals-set-directory-class): New arg mtime.  Store it in
--- a/lisp/ChangeLog.7	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.7	Wed Oct 13 22:40:51 2010 +0900
@@ -1043,10 +1043,10 @@
 	(quail-prev-translation-block): Likewise.
 	(quail-conversion-backward-char): Call quail-error instead of
 	error.  Set quail-translating to nil.
-	(quail-conversion-forward-char): Likewize.
+	(quail-conversion-forward-char): Likewise.
 	(quail-conversion-delete-char): Call quail-error instead of error.
 	If conversion region gets vacant, set quail-converting to nil.
-	(quail-conversion-backward-delete-char): Likewize.
+	(quail-conversion-backward-delete-char): Likewise.
 	(quail-no-conversion): Just set quail-converting to nil.
 	(quail-mouse-choose-completion): Call quai-error instead of error.
 	(quail-choose-completion-string): Likewise.
--- a/lisp/ChangeLog.8	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.8	Wed Oct 13 22:40:51 2010 +0900
@@ -1172,7 +1172,7 @@
 
 1999-12-03  Kenichi Handa  <handa@mule.m17n.org>
 
-	* international/mule-util.el (truncate-string-to-width): Docsting
+	* international/mule-util.el (truncate-string-to-width): Docstring
 	fixed.
 
 1999-12-02  Stefan Monnier  <monnier@cs.yale.edu>
@@ -4926,7 +4926,7 @@
 
 	* language/ethio-util.el (setup-ethiopic-environment-internal):
 	Use quail-activate-hook instead of obsolete hook quail-mode-hook.
-	(exit-ethiopic-environment): Likewize.
+	(exit-ethiopic-environment): Likewise.
 
 1999-06-12  Richard M. Stallman  <rms@gnu.org>
 
--- a/lisp/ChangeLog.9	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ChangeLog.9	Wed Oct 13 22:40:51 2010 +0900
@@ -1667,7 +1667,7 @@
 	* Makefile.in (finder_setwins): Renamed from nonobsolete_setwins.
 	Don't include term/.
 
-	* mail/sc.el:  Moved to obsolete/.
+	* mail/sc.el: Moved to obsolete/.
 
 2001-08-14  Vinicius Jose Latorre  <vinicius@cpqd.com.br>
 
@@ -5547,7 +5547,7 @@
 
 2001-02-12  Dave Love  <d.love@dl.ac.uk>
 
-	* international/latin1-disp.el:  Doc fixes.
+	* international/latin1-disp.el: Doc fixes.
 	(latin1-display) <defgroup>: Add :link.
 	(latin1-display) <function>: Set variable latin1-display.
 
@@ -5773,7 +5773,7 @@
 2001-02-05  Kenichi Handa  <handa@etl.go.jp>
 
 	* isearch.el (isearch-forward): Add description about input method
-	in the docsting.
+	in the docstring.
 
 2001-02-04  Stefan Monnier  <monnier@cs.yale.edu>
 
@@ -8121,7 +8121,7 @@
 	* dired.el (dired-get-filename): Return filename verbatim if
 	LOCALP is `verbatim'.
 	* dired-aux.el (dired-add-entry): Call `dired-get-filename' with
-	`verbatim' so that we don't inadvertently delete a non-existant
+	`verbatim' so that we don't inadvertently delete a non-existent
 	directory name.
 
 2000-11-27  Kenichi Handa  <handa@etl.go.jp>
@@ -8747,7 +8747,7 @@
 2000-11-13  Miles Bader  <miles@gnu.org>
 
 	* textmodes/fill.el (skip-line-prefix): New function.
-	(fill-region-as-paragraph, fill-region):  Return the fill-prefix.
+	(fill-region-as-paragraph, fill-region): Return the fill-prefix.
 	(fill-paragraph): Don't leave point inside the fill-prefix.
 	* textmodes/refill.el (refill-fill-paragraph-at): Don't leave
 	point inside the fill-prefix.
@@ -10795,7 +10795,7 @@
 2000-10-06  Dave Love  <fx@gnu.org>
 
 	* textmodes/fill.el (sentence-end-double-space)
-	(sentence-end-without-period):  Doc fix.
+	(sentence-end-without-period): Doc fix.
 	(adaptive-fill-regexp): Purecopy.
 	(unjustify-current-line): Use line-end-position.
 	(fill-individual-paragraphs-prefix): Use line-beginning-position.
@@ -11871,7 +11871,7 @@
 
 	* strokes.el: Sync with maintainer's current version with changes
 	for Emacs, but avoid runtime cl and levents.
-	(toplevel):  Change autoloads and compilation requires.
+	(toplevel): Change autoloads and compilation requires.
 	(strokes-version, strokes-bug-address, strokes-lift): Values
 	changed.
 	(strokes-xpm-header, strokes-insinuated): New variable.
@@ -11934,12 +11934,12 @@
 2000-09-14  Dave Love  <fx@gnu.org>
 
 	* toolbar/cancel.xpm, toolbar/close.xpm, toolbar/copy.xpm,
-	toolbar/cut.xpm, toolbar/exit.xpm, toolbar/fld_open.xpm,
-	toolbar/help.xpm, toolbar/info.xpm, toolbar/mail.xpm,
-	toolbar/mail_compose.xpm, toolbar/new.xpm, toolbar/open.xpm,
-	toolbar/paste.xpm, toolbar/preferences.xpm, toolbar/print.xpm,
-	toolbar/save.xpm, toolbar/saveas.xpm, toolbar/search-replace.xpm,
-	toolbar/search.xpm, toolbar/spell.xpm, toolbar/undo.xpm:  New.
+	* toolbar/cut.xpm, toolbar/exit.xpm, toolbar/fld_open.xpm,
+	* toolbar/help.xpm, toolbar/info.xpm, toolbar/mail.xpm,
+	* toolbar/mail_compose.xpm, toolbar/new.xpm, toolbar/open.xpm,
+	* toolbar/paste.xpm, toolbar/preferences.xpm, toolbar/print.xpm,
+	* toolbar/save.xpm, toolbar/saveas.xpm, toolbar/search-replace.xpm,
+	* toolbar/search.xpm, toolbar/spell.xpm, toolbar/undo.xpm: New.
 	From Tuomas Kuosmanen <tigert@gimp.org>.  (Gnome icons fetched
 	from <URL:http://tigert.gimp.org/gnome/gnome-stock/>.)
 
@@ -14832,7 +14832,7 @@
 	(comint-replace-by-expanded-history)
 	(comint-get-old-input-default, comint-show-output)
 	(comint-backward-matching-input, comint-forward-matching-input)
-	(comint-next-prompt, comint-previous-prompt):  Use field
+	(comint-next-prompt, comint-previous-prompt): Use field
 	properties if comint-use-prompt-regexp-instead-of-fields is nil.
 	(comint-line-beginning-position): New function.
 	(comint-bol): Use comint-line-beginning-position.  Make ARG optional.
@@ -16606,7 +16606,7 @@
 	0.  Give correct argument to set-auto-coding-function.
 	(tar-expunge): For goto-char, use (point-min), not 0.
 	(tar-clear-modification-flags): For goto-char, use (point-min), not 1.
-	(tar-subfile-save-buffer): Likewize.
+	(tar-subfile-save-buffer): Likewise.
 
 	* international/mule.el
 	(after-insert-file-set-buffer-file-coding-system): Call
@@ -16910,7 +16910,7 @@
 	(ccl-decode-viscii): Use translate-character.
 	(ccl-encode-viscii, ccl-encode-viscii-font)
 	(ccl-decode-vscii, ccl-encode-vscii, ccl-encode-vscii-font):
-	Likewize.
+	Likewise.
 
 	* language/cyrillic.el: Remove eval-when-compile.
 	(cyrillic-koi8-r-nonascii-translation-table): Define it as a
@@ -16918,14 +16918,14 @@
 	(cyrillic-koi8-r-encode-table): Define it as a translation table
 	made from the reverse map of above.
 	(ccl-decode-koi8): Use translate-character.
-	(ccl-encode-koi8, ccl-encode-koi8-font): Likewize
+	(ccl-encode-koi8, ccl-encode-koi8-font): Likewise.
 	(cyrillic-alternativnyj-nonascii-translation-table): Define it as
 	a translation table made from cyrillic-alternativnyj-decode-table.
 	(cyrillic-alternativnyj-encode-table): Define it as a translation
 	table made from the reverse map of above.
 	(ccl-decode-alternativnyj): Use translate-character.
 	(ccl-encode-alternativnyj, ccl-encode-alternativnyj-font):
-	Likewize
+	Likewise.
 
 	* international/mule-diag.el (non-iso-charset-alist): Specify
 	translation table symbol instead of translation table itself.
@@ -18040,7 +18040,7 @@
 	(help-xref-interned): Maybe insert face doc too.  Separate
 	sections with a line of hyphens.
 
-	* faces.el:  Some doc fixes.  Declare some functions obsolete.
+	* faces.el: Some doc fixes.  Declare some functions obsolete.
 	(describe-face): Add customize button.  Return the help
 	text.  Fix prompt.
 
@@ -18071,8 +18071,8 @@
 
 	* emacs-lisp/cl-macs.el: Doc fixes; mainly avoid duplicating arg
 	list in doc string.  Don't quote keyword symbols.
-	* emacs-lisp/cl.el: Likewise
-	* emacs-lisp/cl-seq.el: Likewise
+	* emacs-lisp/cl.el: Likewise.
+	* emacs-lisp/cl-seq.el: Likewise.
 
 2000-05-05  Gerd Moellmann  <gerd@gnu.org>
 
@@ -19040,7 +19040,7 @@
 	(fontset-default-styles): Likewise.
 	(x-modify-font-name): Function removed.
 	(create-fontset-from-fontset-spec): Ignore the argument STYLE-VARIANT.
-	(create-fontset-from-ascii-font): Docsting adjusted for the above
+	(create-fontset-from-ascii-font): Docstring adjusted for the above
 	change.
 	(instantiate-fontset, resolve-fontset-name): Functions removed.
 	(fontset-list): Now implemented by C code.
@@ -20406,7 +20406,7 @@
 
 2000-01-10  Ken Stevens  <k.stevens@ieee.org>
 
-	* ispell.el:  Only define dictionaries in menus when they exist.
+	* ispell.el: Only define dictionaries in menus when they exist.
 	(version18p): New variable.
 	(version20p): New variable.
 	(xemacsp): New variable.
--- a/lisp/Makefile.in	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/Makefile.in	Wed Oct 13 22:40:51 2010 +0900
@@ -311,11 +311,15 @@
 	$(lisp)/cedet/cedet.elc \
 	$(lisp)/cedet/data-debug.elc \
 	$(lisp)/cedet/ede.elc \
+	$(lisp)/cedet/ede/auto.elc \
 	$(lisp)/cedet/ede/autoconf-edit.elc \
+	$(lisp)/cedet/ede/base.elc \
 	$(lisp)/cedet/ede/cpp-root.elc \
+	$(lisp)/cedet/ede/custom.elc \
 	$(lisp)/cedet/ede/dired.elc \
 	$(lisp)/cedet/ede/emacs.elc \
 	$(lisp)/cedet/ede/files.elc \
+	$(lisp)/cedet/ede/generic.elc \
 	$(lisp)/cedet/ede/linux.elc \
 	$(lisp)/cedet/ede/locate.elc \
 	$(lisp)/cedet/ede/make.elc \
@@ -512,7 +516,6 @@
 	$(lisp)/emacs-lisp/chart.elc \
 	$(lisp)/emacs-lisp/check-declare.elc \
 	$(lisp)/emacs-lisp/checkdoc.elc \
-	$(lisp)/emacs-lisp/cl-compat.elc \
 	$(lisp)/emacs-lisp/cl-extra.elc \
 	$(lisp)/emacs-lisp/cl-indent.elc \
 	$(lisp)/emacs-lisp/cl-macs.elc \
@@ -547,7 +550,6 @@
 	$(lisp)/emacs-lisp/lisp-mnt.elc \
 	$(lisp)/emacs-lisp/lisp-mode.elc \
 	$(lisp)/emacs-lisp/lisp.elc \
-	$(lisp)/emacs-lisp/lmenu.elc \
 	$(lisp)/emacs-lisp/macroexp.elc \
 	$(lisp)/emacs-lisp/map-ynp.elc \
 	$(lisp)/emacs-lisp/pp.elc \
@@ -1077,12 +1079,14 @@
 	$(lisp)/nxml/xmltok.elc \
 	$(lisp)/nxml/xsd-regexp.elc \
 	$(lisp)/obsolete/awk-mode.elc \
+	$(lisp)/obsolete/cl-compat.elc \
 	$(lisp)/obsolete/fast-lock.elc \
 	$(lisp)/obsolete/iso-acc.elc \
 	$(lisp)/obsolete/iso-insert.elc \
 	$(lisp)/obsolete/iso-swed.elc \
 	$(lisp)/obsolete/lazy-lock.elc \
 	$(lisp)/obsolete/levents.elc \
+	$(lisp)/obsolete/lmenu.elc \
 	$(lisp)/obsolete/lucid.elc \
 	$(lisp)/obsolete/old-whitespace.elc \
 	$(lisp)/obsolete/options.elc \
--- a/lisp/calculator.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/calculator.el	Wed Oct 13 22:40:51 2010 +0900
@@ -369,7 +369,8 @@
 Used for repeating operations in calculator-repR/L.")
 
 (defvar calculator-registers ; use user-bindings first
-  (append calculator-user-registers (list (cons ?e e) (cons ?p pi)))
+  (append calculator-user-registers
+          (list (cons ?e float-e) (cons ?p float-pi)))
   "The association list of calculator register values.")
 
 (defvar calculator-saved-global-map nil
@@ -1300,7 +1301,7 @@
                       (calculator-funcall __f__ x y))))
           (fset 'D (function
                     (lambda (x)
-                      (if calculator-deg (/ (* x 180) pi) x))))
+                      (if calculator-deg (/ (* x 180) float-pi) x))))
           (unwind-protect (eval f)
             (if Fbound (fset 'F Fsave) (fmakunbound 'F))
             (if Dbound (fset 'D Dsave) (fmakunbound 'D)))))
--- a/lisp/calendar/appt.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/calendar/appt.el	Wed Oct 13 22:40:51 2010 +0900
@@ -47,8 +47,9 @@
 ;; package is activated.  Additionally, the appointments list is
 ;; recreated automatically at 12:01am for those who do not logout
 ;; every day or are programming late.  It is also updated when the
-;; `diary-file' is saved.  Calling `appt-check' with an argument (or
-;; re-enabling the package) forces a re-initialization at any time.
+;; `diary-file' (or a file it includes) is saved.  Calling
+;; `appt-check' with an argument (or re-enabling the package) forces a
+;; re-initialization at any time.
 ;;
 ;; In order to add or delete items from today's list, without
 ;; changing the diary file, use `appt-add' and `appt-delete'.
@@ -261,7 +262,7 @@
   "Check for an appointment and update any reminder display.
 If optional argument FORCE is non-nil, reparse the diary file for
 appointments.  Otherwise the diary file is only parsed once per day,
-and when saved.
+or when it (or a file it includes) is saved.
 
 Note: the time must be the first thing in the line in the diary
 for a warning to be issued.  The format of the time can be either
@@ -332,28 +333,42 @@
         (if (or force                      ; eg initialize, diary save
                 (null appt-prev-comp-time) ; first check
                 (< cur-comp-time appt-prev-comp-time)) ; new day
-            (condition-case nil
-                (if appt-display-diary
-                    (let ((diary-hook
-                           (if (assoc 'appt-make-list diary-hook)
-                               diary-hook
-                             (cons 'appt-make-list diary-hook))))
-                      (diary))
-                  (let* ((diary-display-function 'appt-make-list)
-                         (d-buff (find-buffer-visiting diary-file))
-                         (selective
-                          (if d-buff    ; diary buffer exists
-                              (with-current-buffer d-buff
-                                diary-selective-display))))
-                    (diary)
-                    ;; If the diary buffer existed before this command,
-                    ;; restore its display state.  Otherwise, kill it.
-                    (if d-buff
-                        ;; Displays the diary buffer.
-                        (or selective (diary-show-all-entries))
-                      (and (setq d-buff (find-buffer-visiting diary-file))
-                           (kill-buffer d-buff)))))
-              (error nil)))
+            (ignore-errors
+              (if appt-display-diary
+                  (let ((diary-hook
+                         (if (assoc 'appt-make-list diary-hook)
+                             diary-hook
+                           (cons 'appt-make-list diary-hook))))
+                    (diary))
+                (let* ((diary-display-function 'appt-make-list)
+                       (d-buff (find-buffer-visiting diary-file))
+                       (selective
+                        (if d-buff    ; diary buffer exists
+                            (with-current-buffer d-buff
+                              diary-selective-display)))
+                       d-buff2)
+                  ;; Not displaying the diary, so we can ignore
+                  ;; diary-number-of-entries.  Since appt.el only
+                  ;; works on a daily basis, no need for more entries.
+                  ;; FIXME why not using diary-list-entries with
+                  ;; non-nil LIST-ONLY?
+                  (diary 1)
+                  ;; If the diary buffer existed before this command,
+                  ;; restore its display state.  Otherwise, kill it.
+                  (and (setq d-buff2 (find-buffer-visiting diary-file))
+                       (if d-buff
+                           (or selective
+                               (with-current-buffer d-buff2
+                                 (if diary-selective-display
+                                     ;; diary-show-all-entries displays
+                                     ;; the diary buffer.
+                                     (diary-unhide-everything))))
+                         ;; FIXME does not kill any included diary files.
+                         ;; The real issue is that (diary) should not
+                         ;; have the side effect of visiting all the
+                         ;; diary files.  It is not really appt.el's job to
+                         ;; clean up this mess...
+                         (kill-buffer d-buff2)))))))
         (setq appt-prev-comp-time cur-comp-time
               appt-mode-string nil
               appt-display-count nil)
@@ -569,6 +584,17 @@
               (let ((entry-list diary-entries-list)
                     (new-time-string "")
                     time-string)
+                ;; Below, we assume diary-entries-list was in date
+                ;; order.  It is, unless something on
+                ;; diary-list-entries-hook has changed it, eg
+                ;; diary-include-other-files (bug#7019).  It must be
+                ;; in date order if number = 1.
+                (and diary-list-entries-hook
+                     appt-display-diary
+                     (not (eq diary-number-of-entries 1))
+                     (not (memq (car (last diary-list-entries-hook))
+                                '(diary-sort-entries sort-diary-entries)))
+                     (setq entry-list (sort entry-list 'diary-entry-compare)))
                 ;; Skip diary entries for dates before today.
                 (while (and entry-list
                             (calendar-date-compare
@@ -642,8 +668,10 @@
 
 (defun appt-update-list ()
   "If the current buffer is visiting the diary, update appointments.
-This function is intended for use with `write-file-functions'."
-  (and (string-equal buffer-file-name (expand-file-name diary-file))
+This function also acts on any file listed in `diary-included-files'.
+It is intended for use with `write-file-functions'."
+  (and (member buffer-file-name (append diary-included-files
+                                        (list (expand-file-name diary-file))))
        appt-timer
        (let ((appt-display-diary nil))
          (appt-check t)))
--- a/lisp/calendar/diary-lib.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/calendar/diary-lib.el	Wed Oct 13 22:40:51 2010 +0900
@@ -187,11 +187,12 @@
 
      (setq diary-display-function 'diary-fancy-display)
      (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
-     (add-hook 'diary-list-entries-hook 'diary-sort-entries)
+     (add-hook 'diary-list-entries-hook 'diary-sort-entries t)
 
 in your `.emacs' file to cause the fancy diary buffer to be displayed with
 diary entries from various included files, each day's entries sorted into
-lexicographic order."
+lexicographic order.  Note how the sort function is placed last,
+so that it can sort the entries included from other files."
   :type 'hook
   :options '(diary-include-other-diary-files diary-sort-entries)
   :group 'diary)
@@ -699,6 +700,10 @@
              (1+ (calendar-absolute-from-gregorian gdate))))))
   (goto-char (point-min)))
 
+(defvar diary-including) ; dynamically bound in diary-include-other-diary-files
+(defvar diary-included-files nil
+  "List of any diary files included in the last call to `diary-list-entries'.")
+
 ;; FIXME non-greg and list hooks run same number of times?
 (defun diary-list-entries (date number &optional list-only)
   "Create and display a buffer containing the relevant lines in `diary-file'.
@@ -706,14 +711,26 @@
 for NUMBER days starting with date DATE.  The other entries are hidden
 using overlays.  If NUMBER is less than 1, this function does nothing.
 
-Returns a list of all relevant diary entries found, if any, in order by date.
+Returns a list of all relevant diary entries found.
 The list entries have the form ((MONTH DAY YEAR) STRING SPECIFIER) where
 \(MONTH DAY YEAR) is the date of the entry, STRING is the entry text, and
 SPECIFIER is the applicability.  If the variable `diary-list-include-blanks'
 is non-nil, this list includes a dummy diary entry consisting of the empty
 string for a date with no diary entries.
 
-After the list is prepared, the following hooks are run:
+If entries are being produced for multiple dates (i.e., NUMBER > 1),
+then this function normally returns the entries from any given
+diary file in date order.  The entries for any given day are in
+the order in which they were found in the file, not necessarily
+in time-of-day order.  Note that any functions present on the
+hooks (see below) may add entries, or change the order.  For
+example, `diary-include-other-diary-files' adds entries from any
+include files that it finds to the end of the original list.  The
+entries from each file will be in date order, but the overall
+list will not be.  If you want the entire list to be in time order,
+add `diary-sort-entries' to the end of `diary-list-entries-hook'.
+
+After the initial list is prepared, the following hooks are run:
 
   `diary-nongregorian-listing-hook' can cull dates from the diary
       and each included file, for example to process Islamic diary
@@ -743,6 +760,8 @@
            (date-string (calendar-date-string date))
            (diary-buffer (find-buffer-visiting diary-file))
            diary-entries-list file-glob-attrs)
+      (or (bound-and-true-p diary-including)
+          (setq diary-included-files nil))
       (message "Preparing diary...")
       (save-current-buffer
         (if (not diary-buffer)
@@ -828,11 +847,15 @@
     (let ((diary-file (match-string-no-properties 1))
           (diary-list-entries-hook 'diary-include-other-diary-files)
           (diary-display-function 'ignore)
+          (diary-including t)
           diary-hook diary-list-include-blanks)
       (if (file-exists-p diary-file)
           (if (file-readable-p diary-file)
               (unwind-protect
-                  (setq diary-entries-list
+                  (setq diary-included-files
+                        (append diary-included-files
+                                (list (expand-file-name diary-file)))
+                        diary-entries-list
                         (append diary-entries-list
                                 (diary-list-entries original-date number)))
                 (with-current-buffer (find-buffer-visiting diary-file)
@@ -1574,7 +1597,10 @@
                       (string-lessp ts1 ts2)))))))
 
 (defun diary-sort-entries ()
-  "Sort the list of diary entries by time of day."
+  "Sort the list of diary entries by time of day.
+If you add this function to `diary-list-entries-hook', it should
+be the last item in the hook, in case earlier items add diary
+entries, or change the order."
   (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare)))
 
 (define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1")
--- a/lisp/calendar/solar.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/calendar/solar.el	Wed Oct 13 22:40:51 2010 +0900
@@ -752,12 +752,12 @@
                                     (sin (mod
                                           (+ (cadr x)
                                              (* (nth 2 x) U))
-                                          (* 2 pi)))))
+                                          (* 2 float-pi)))))
                                solar-data-list)))))
          (aberration
           (* 0.0000001 (- (* 17 (cos (+ 3.10 (* 62830.14 U)))) 973)))
-         (A1 (mod (+ 2.18 (* U (+ -3375.70 (* 0.36 U)))) (* 2 pi)))
-         (A2 (mod (+ 3.51 (* U (+ 125666.39 (* 0.10 U)))) (* 2 pi)))
+         (A1 (mod (+ 2.18 (* U (+ -3375.70 (* 0.36 U)))) (* 2 float-pi)))
+         (A2 (mod (+ 3.51 (* U (+ 125666.39 (* 0.10 U)))) (* 2 float-pi)))
          (nutation (* -0.0000001 (+ (* 834 (sin A1)) (* 64 (sin A2))))))
     (mod (radians-to-degrees (+ longitude aberration nutation)) 360.0)))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cedet/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,1389 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/symref/list.el (semantic-symref-list-rename-open-hits):
+	Fix typo in message.
+	(semantic-symref-list-map-open-hits): Fix typo in docstring.
+
+2010-09-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/bovine/el.el:
+	* semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode):
+	Fix require statements.
+
+2010-09-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/tag.el (semantic-tag-version): Bump to 2.0.
+
+	* semantic/db-typecache.el (semanticdb-typecache-find-default):
+	* semantic/imenu.el (semantic-create-imenu-index):
+	* semantic/grammar.el (semantic--grammar-macro-function-tag):
+	* semantic/fw.el (semanticdb-without-unloaded-file-searches):
+	Fix require.  Suggested by David Engster.
+
+	* semantic/bovine/c-by.el: Regenerate.
+
+2010-09-29  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/lex-spp.el (semantic-lex-spp-debug-symbol): New var.
+	(semantic-lex-spp-enable-debug-symbol): New command
+	(semantic-lex-spp-value-valid-p)
+	(semantic-lex-spp-validate-value): New functions
+	(semantic-lex-spp-symbol-set)
+	(semantic-lex-spp-symbol-push): Add call to validate value.
+	(semantic-lex-spp-table-write-slot-value): Instead of erroring on
+	invalid values during save, just save a nil.
+
+2010-09-25  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/linux.el (ede-project-class-files):
+	* ede/generic.el (ede-generic-new-autoloader):
+	* ede/emacs.el (ede-project-class-files):
+	* ede/simple.el (ede-project-class-files):
+	* ede/cpp-root.el (ede-project-class-files): Fix require name.
+
+2010-09-21  Eric Ludlam  <zappo@gnu.org>
+
+	Synch SRecode to CEDET 1.0.
+
+	* pulse.el (pulse-momentary-highlight-overlay): If pulse-flag is
+	'never, disable all pulsing.
+
+	* cedet.el (cedet-version):
+	* srecode.el (srecode-version): Bump version to 1.0.
+
+	* srecode/texi.el (srecode-texi-insert-tag-as-doc): New function.
+	(semantic-insert-foreign-tag): Use it.
+
+	* srecode/mode.el (srecode-bind-insert): Call
+	srecode-load-tables-for-mode.
+	(srecode-minor-mode-templates-menu): Do not list templates that
+	are not in the current project.
+	(srecode-menu-bar): Add binding for srecode-macro-help.
+
+	* srecode/table.el (srecode-template-table): Add :project slot.
+	(srecode-dump): Dump it.
+
+	* srecode/map.el (srecode-map-update-map): Make map loading more
+	robust.
+
+	* srecode/insert.el (srecode-insert-fcn): Merge template
+	dictionary before resolving arguments.
+	(srecode-insert-method-helper): Add error checking to make sure
+	that we only have dictionaries.
+	(srecode-insert-method): Check template nesting depth when using
+	point inserter override.
+	(srecode-insert-method): Install override with depth limit.
+
+	* srecode/getset.el (srecode-insert-getset): Force tag table
+	update.  Don't query the class if it is empty.
+
+	* srecode/find.el (srecode-template-get-table)
+	(srecode-template-get-table-for-binding)
+	(srecode-all-template-hash): Skip if not in current project.
+	(srecode-template-table-in-project-p): New method.
+
+	* srecode/fields.el (srecode-fields-exit-confirmation): New option.
+	(srecode-field-exit-ask): Use it.
+
+	* srecode/dictionary.el (srecode-dictionary-add-template-table):
+	Do not add variables in tables not for the current project.
+	(srecode-compound-toString): Handle cases where the default value
+	is another compound value.
+	(srecode-dictionary-lookup-name): New optional argument
+	NON-RECURSIVE, which inhibits visiting dictionary parents.
+	(srecode-dictionary-add-section-dictionary)
+	(srecode-dictionary-merge): New optional argument FORCE adds
+	values even if an identically named entry exists.
+	(srecode-dictionary-add-entries): New method.
+	(srecode-create-dictionaries-from-tags): New function.
+
+	* srecode/cpp.el (srecode-cpp): New defgroup.
+	(srecode-cpp-namespaces): New option.
+	(srecode-semantic-handle-:using-namespaces)
+	(srecode-cpp-apply-templates): New functions.
+	(srecode-semantic-apply-tag-to-dict): Handle template parameters
+	by calling `srecode-cpp-apply-templates'.
+
+	* srecode/compile.el (srecode-compile-templates): Fix directory
+	compare of built-in templates.  Give built-ins lower piority.
+	Support special variable "project".
+	(srecode-compile-template-table): Set :project slot of new tables.
+	(srecode-compile-one-template-tag): Use
+	srecode-create-dictionaries-from-tags.
+
+2010-09-21  Eric Ludlam  <zappo@gnu.org>
+
+	Synch EDE to CEDET 1.0.
+
+	* cedet-idutils.el (cedet-idutils-make-command): New option.
+	(cedet-idutils-mkid-call):
+	(cedet-idutils-create/update-database): New functions.
+
+	* cedet-cscope.el (cedet-cscope-create):
+	(cedet-cscope-create/update-database): New functions.
+	(cedet-cscope-support-for-directory): Make interactive.
+
+	* cedet-global.el (cedet-global-gtags-command): New option.
+	(cedet-gnu-global-gtags-call)
+	(cedet-gnu-global-create/update-database): New functions.
+
+	* ede.el (ede-save-cache): Fix recentf-exclude expression.
+	(ede-make-dist): Always use toplevel project.
+	(ede-buffer-object): If we fail to find an object in the current
+	project, loop upward looking for a match.  If no target is found,
+	use most local project.
+	(ede-buffer-belongs-to-target-p)
+	(ede-buffer-belongs-to-project-p): New functions.
+	(ede-initialize-state-current-buffer): New function.
+	(ede-target-forms-menu, ede-project-buffers): Use them.
+	(ede-minor-mode, ede-reset-all-buffers): Use it.
+	(project-interactive-select-target, project-add-file): Don't use
+	ede-project-force-load.
+	(ede-buffer-object): New arg PROJSYM.
+	(ede-minor-mode): Remove ede-directory-project-p test.
+	(ede-initialize-state-current-buffer): Don't test for
+	ede-directory-project-p if there is a matching open project.
+	(ede-customize-forms-menu): Prevent error if there is no project.
+	(ede-load-project-file): Set ede-constructing to the thing being
+	constructed, instead of t.
+	(ede-project-force-load): Deleted.
+
+	* ede/base.el:
+	* ede/auto.el:
+	* ede/custom.el: New files.
+
+	* ede/autoconf-edit.el (autoconf-find-last-macro)
+	(autoconf-parameters-for-macro): Parse multiline parameters of
+	macros.  Optionally ignore case and at bol for macro.
+	(autoconf-parameter-strip): Use greedy match for newlines.
+	(autoconf-new-automake-string): Deleted.
+	(autoconf-new-program): Use SRecode to fill an empty file.
+
+	* ede/cpp-root.el (ede-create-lots-of-projects-under-dir): New
+	function.
+
+	* ede/files.el (ede-flush-project-hash): New command.
+	(ede-convert-path): Add optional PROJECT arg.
+	(ede-directory-project-p): Obey ".ede-ignore".
+	(ede-expand-filename-local)
+	(ede-expand-filename-impl-via-subproj): New methods.
+	(ede-expand-filename-impl): Use them.
+	(ede-project-root, ede-project-root-directory): Move to
+	ede/auto.el.
+
+	* ede/locate.el (ede-locate-flush-hash):
+	(ede-locate-create/update-root-database): New methods.
+	(initialize-instance): Use ede-locate-flush-hash.
+
+	* ede/pmake.el (ede-proj-makefile-insert-variables): If this is
+	the top project and not a metasubproject, set TOP to CURDIR.
+	(ede-proj-makefile-insert-variables): Output a target's object
+	list whether or not the vars are already in the Makefile.
+	(ede-pmake-insert-variable-once): New macro.
+
+	* ede/project-am.el (project-am-with-makefile-current): Add
+	recentf-exclude.
+	(project-am-load-makefile): Obey an optional suggested name.
+	(project-am-expand-subdirlist): New function.
+	(project-am-makefile::project-rescan): Use it.  Combine SUBDIRS
+	and DIST_SUBDIRS.
+	(project-am-meta-type-alist): A list to scan better Makefile.am
+	(project-am-scan-for-targets): Scan also over
+	project-am-meta-type-alist.
+	(ede-system-include-path): Simple implementation.
+	(ede-find-target): Deleted.  EDE core takes care of this.
+	(ede-buffer-mine): Create the searched filename as relative.
+	(project-am-load): Simplify, using autoconf-edit.
+	(project-am-extract-package-info): Fix separators.
+
+	* ede/proj.el (project-run-target): New method.
+	(project-make-dist, project-compile-project): Use
+	ede-proj-automake-p to determine which kind of compile to use.
+	(project-rescan): Call ede-load-project-file.
+	(ede-buffer-mine): Add more file names that belong to the project.
+	(ede-proj-compilers): Improve error message.
+
+	* ede/proj-obj.el (ede-ld-linker): Use the LDDEPS variable.
+	(ede-source-c++): Add more C++ extensions.
+	(ede-proj-target-makefile-objectcode): Quote initforms.  Support
+	lex and yacc.
+
+	* ede/proj-prog.el (ede-proj-makefile-insert-rules): Removed.
+	(ede-proj-makefile-insert-variables): New, add LDDEPS.
+	(ede-proj-makefile-insert-automake-post-variables): Add LDADD
+	variable.  Use ldlibs-local slot.  Add a -l to ldlibs strings.
+	(ede-proj-target-makefile-program): Swap order of two slots so
+	they show up in the same order as in the command line.
+	(ede-proj-target-makefile-program): Add ldlibs-local slot.
+
+	* ede/proj-shared.el (ede-g++-libtool-shared-compiler): Fix
+	inference rule to use cpp files.
+	(ede-proj-target-makefile-shared-object): Quote initforms.
+
+	* ede/proj-misc.el (ede-proj-target-makefile-miscelaneous):
+	* ede/proj-info.el (ede-proj-target-makefile-info):
+	* ede/proj-aux.el (ede-proj-target-aux):
+	* ede/proj-archive.el (ede-proj-target-makefile-archive):
+	* ede/proj-elisp.el (ede-proj-target-elisp)
+	(ede-proj-target-elisp-autoloads): Quote initforms.
+
+	* ede/srecode.el (ede-srecode-setup): Load autoconf templates.
+
+	* ede/shell.el (ede-shell-buffer): Fix buffer name.
+
+	* ede/pconf.el (ede-proj-configure-synchronize): If user events
+	occur while waiting for the compile process to finish, pull them
+	in and discard those events.
+
+2010-09-19  Eric Ludlam  <zappo@gnu.org>
+
+	Synch Semantic to CEDET 1.0.
+
+	* semantic.el (semantic-version): Update to 2.0.
+	(semantic-mode-map): Add "," and "m" bindings.
+	(navigate-menu): Update.
+
+	* semantic/symref.el (semantic-symref-calculate-rootdir):
+	New function.
+	(semantic-symref-detect-symref-tool): Use it.
+
+	* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
+	(semantic-symref-perform-search): Use it.  Calculate root dir with
+	semantic-symref-calculate-rootdir.
+	(semantic-symref-derive-find-filepatterns): Improve error message.
+
+	* semantic/symref/list.el
+	(semantic-symref-results-mode-map): New bindings.
+	(semantic-symref-auto-expand-results): New option.
+	(semantic-symref-results-dump): Obey auto-expand.
+	(semantic-symref-list-expand-all, semantic-symref-regexp)
+	(semantic-symref-list-contract-all)
+	(semantic-symref-list-map-open-hits)
+	(semantic-symref-list-update-open-hits)
+	(semantic-symref-list-create-macro-on-open-hit)
+	(semantic-symref-list-call-macro-on-open-hits): New functions.
+	(semantic-symref-list-menu-entries)
+	(semantic-symref-list-menu): New vars.
+	(semantic-symref-list-map-open-hits): Move cursor to beginning of
+	match before calling the mapped function.
+
+	* semantic/doc.el
+	(semantic-documentation-comment-preceeding-tag): Do nothing if the
+	mode doesn't provide comment-start-skip.
+
+	* semantic/scope.el
+	(semantic-analyze-scope-nested-tags-default): Strip duplicates.
+	(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
+	looking for as part of the scoped tags list.
+
+	* semantic/html.el (semantic-default-html-setup): Add
+	senator-step-at-tag-classes.
+
+	* semantic/decorate/include.el
+	(semantic-decoration-on-unknown-includes): Change light bgcolor.
+	(semantic-decoration-on-includes-highlight-default): Check that
+	the include tag has a postion.
+
+	* semantic/complete.el (semantic-collector-local-members):
+	(semantic-complete-read-tag-local-members)
+	(semantic-complete-jump-local-members): New class and functions.
+	(semantic-complete-self-insert): Save excursion before completing.
+
+	* semantic/analyze/complete.el
+	(semantic-analyze-possible-completions-default): If no completions
+	are found, return the raw by-name-only completion list.  Add FLAGS
+	arguments.  Add support for 'no-tc (type constraint) and
+	'no-unique, or no stripping duplicates.
+	(semantic-analyze-possible-completions-default): Add FLAGS arg.
+
+	* semantic/util-modes.el
+	(semantic-stickyfunc-show-only-functions-p): New option.
+	(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
+	the very first line in a buffer.
+
+	* semantic/util.el (semantic-hack-search)
+	(semantic-recursive-find-nonterminal-by-name)
+	(semantic-current-tag-interactive): Deleted.
+	(semantic-describe-buffer): Fix expand-nonterminal.  Add
+	lex-syntax-mods, type relation separator char, and command
+	separation char.
+	(semantic-sanity-check): Only message if called interactively.
+
+	* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
+	:filename property and the tag position.
+
+	* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
+	Add recursion limit.
+
+	* semantic/imenu.el (semantic-imenu-bucketize-type-members):
+	Make this buffer local, not the obsoleted variable.
+
+	* semantic/idle.el: Add breadcrumbs support.
+	(semantic-idle-summary-current-symbol-info-default)
+	(semantic-idle-tag-highlight)
+	(semantic-idle-completion-list-default): Use
+	semanticdb-without-unloaded-file-searches for speed, and to
+	conform to the controls that specify if the idle timer is supposed
+	to be parsing unparsed includes.
+	(semantic-idle-symbol-highlight-face)
+	(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
+	Callers changed.
+	(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
+	(semantic-idle-work-update-headers-flag): New var.
+	(semantic-idle-work-for-one-buffer): Use it.
+	(semantic-idle-local-symbol-highlight): Rename from
+	semantic-idle-tag-highlight.
+	(semantic-idle-truncate-long-summaries): New option.
+
+	* semantic/ia.el (semantic-ia-cache)
+	(semantic-ia-get-completions): Deleted.  Callers changed.
+	(semantic-ia-show-variants): New command.
+	(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
+	(semantic-ia-show-summary): If there isn't anything to show, say so.
+
+	* semantic/grammar.el (semantic-grammar-create-package):
+	Save the buffer even in batch mode.
+
+	* semantic/fw.el
+	(semanticdb-without-unloaded-file-searches): New macro.
+
+	* semantic/dep.el (semantic-dependency-find-file-on-path):
+	Fix case dereferencing ede-object when it is a list.
+
+	* semantic/db-typecache.el (semanticdb-expand-nested-tag)
+	(semanticdb-typecache-faux-namespace): New functions.
+	(semanticdb-typecache-file-tags)
+	(semanticdb-typecache-merge-streams): Use them.
+	(semanticdb-typecache-file-tags): When deriving tags from a file,
+	give the mode a chance to monkey with the tag copy.
+	(semanticdb-typecache-find-default): Wrap find in save-excursion.
+	(semanticdb-typecache-find-by-name-helper): Merge found names down.
+
+	* semantic/db-global.el
+	(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
+	GNU Global is not available and we don't want to throw an error.
+
+	* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
+	When trying to normalize the tag to a buffer, don't error if
+	set-buffer method doesn't exist.
+
+	* semantic/db-file.el (semanticdb-save-db): Simplify msg.
+
+	* semantic/db.el (semanticdb-refresh-table): If forcing a
+	refresh on a file not in a buffer, use semantic-find-file-noselect
+	and delete the buffer after use.
+	(semanticdb-current-database-list): When calculating root via
+	hooks, force it through true-filename and skip the list of
+	possible roots.
+
+	* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
+
+	* semantic/analyze/debug.el
+	(semantic-analyzer-debug-insert-tag): Reset standard output to
+	current buffer.
+	(semantic-analyzer-debug-global-symbol)
+	(semantic-analyzer-debug-missing-innertype): Change "prefix" to
+	"symbol" in messages.
+
+	* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
+	(semantic-analyze-refs-proto): When calculating value, make sure
+	the found tag is 'similar' to the originating tag.
+	(semantic--analyze-refs-find-tags-with-parent): Attempt to
+	identify matches via imported symbols of parents.
+	(semantic--analyze-refs-full-lookup-with-parents): Do a deep
+	search during the brute search.
+
+	* semantic/analyze.el
+	(semantic-analyze-find-tag-sequence-default): Be robust to
+	calculated scopes being nil.
+
+	* semantic/bovine/c.el (semantic-c-describe-environment): Add
+	project macro symbol array.
+	(semantic-c-parse-lexical-token): Add recursion limit.
+	(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
+	New overrides.
+	(semantic-expand-c-tag-namelist): Split a full type from a typedef
+	out to its own tag.
+	(semantic-expand-c-tag-namelist): Do not split out a typedef'd
+	inline type if it is an anonymous type.
+	(semantic-c-reconstitute-token): Use the optional initializers as
+	a clue that some function is probably a constructor.  When
+	defining the type of these constructors, split the parent name,
+	and use only the class part, if applicable.
+
+	* semantic/bovine/c-by.el:
+	* semantic/wisent/python-wy.el: Regenerate.
+
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/db-file.el (object-write): Fix typo in docstring.
+
+2010-06-03  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/lex-spp.el
+	(semantic-lex-spp-table-write-slot-value): Instead of erroring on
+	invalid values during save, just save a nil (Bug#6324).
+
+2010-05-31  Jonathan Marchand  <jonathlela@gmail.com>  (tiny change)
+
+	* ede/cpp-root.el (ede-set-project-variables): Fix feature name
+	(bug#6231).
+
+2010-04-18  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/pmake.el (ede-proj-makefile-insert-variables):
+	Don't destroy list before using it.
+
+2010-04-02  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/imenu.el (semantic-imenu-bucketize-type-members)
+	(semantic-create-imenu-directory-index): Fix typos in docstrings.
+	(semantic-imenu-goto-function): Reflow docstring.
+
+2010-03-24  Juanma Barranquero  <lekktu@gmail.com>
+
+	* srecode/table.el (srecode-template-table): Fix docstring typo.
+
+2010-03-13  Eric M. Ludlam  <zappo@gnu.org>
+
+	* semantic/imenu.el: New file, from the CEDET repository
+	(Bug#5412).
+
+2010-03-06  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/grammar.el (semantic-grammar-header-template):
+	Update template copyright to GPLv3+.
+
+2010-02-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/db-find.el
+	(semanticdb-find-translate-path-brutish-default):
+	* ede/make.el (ede-make-check-version): Use
+	with-current-buffer instead of save-excursion.
+
+2010-02-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* data-debug.el (data-debug): Move to extensions group.
+
+	* ede.el (ede):
+	* srecode.el (srecode):
+	* semantic.el (semantic): Put in tools and extensions group.
+
+2010-02-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* ede.el (ede-run-target, project-delete-target)
+	(project-dist-files, ede-name, ede-documentation, ede-parent-project)
+	(ede-adebug-project, ede-adebug-project-parent)
+	(ede-adebug-project-root): Fix typos in docstrings.
+
+2010-01-18  Juanma Barranquero  <lekktu@gmail.com>
+
+	* ede/locate.el (ede-locate-file-in-project)
+	(ede-locate-file-in-project-impl): Fix typos in docstrings.
+	(ede-enable-locate-on-project): Fix typos in error messages.
+
+	* semantic/util-modes.el (semantic-unmatched-syntax-face)
+	(semantic-stickyfunc-old-hlf, semantic-stickyfunc-header-line-format)
+	(semantic-stickyfunc-sticky-classes, semantic-highlight-func-mode-setup)
+	(semantic-stickyfunc-fetch-stickyline): Fix typos in docstrings.
+	(semantic-stickyfunc-popup-menu, semantic-highlight-func-popup-menu):
+	Fix typos in menu help.
+
+	* semantic.el (semantic-require-version, semantic--buffer-cache)
+	(semantic-unmatched-syntax-cache-check, semantic-unmatched-syntax-hook)
+	(semantic--before-fetch-tags-hook, semantic-new-buffer-fcn-was-run)
+	(semantic--umatched-syntax-needs-refresh-p, semantic-elapsed-time)
+	(semantic-parse-stream, semantic-parse-region)
+	(semantic-parse-region-default, semantic--set-buffer-cache)
+	(semantic-minimum-working-buffer-size, semantic-refresh-tags-safe)
+	(semantic-bovinate-toplevel, semantic-load-system-cache-loaded)
+	(semantic-default-submodes):
+	* semantic/db-ebrowse.el (semanticdb-table-ebrowse)
+	(semanticdb-create-ebrowse-database)
+	(semanticdb-find-tags-for-completion-method)
+	(semanticdb-find-tags-by-class-method)
+	(semanticdb-deep-find-tags-by-name-method)
+	(semanticdb-deep-find-tags-for-completion-method):
+	* semantic/db-el.el (semanticdb-elisp-mapatom-collector)
+	(semanticdb-find-tags-by-name-method, emacs-lisp-mode)
+	(semanticdb-find-tags-for-completion-method)
+	(semanticdb-find-tags-by-class-method)
+	(semanticdb-deep-find-tags-for-completion-method):
+	* semantic/db-find.el (semanticdb-find-translate-path)
+	(semanticdb-find-need-cache-update-p, semanticdb-find-result-with-nil-p)
+	(semanticdb-find-scanned-include-tags, semanticdb-find-tags-collector)
+	(semanticdb-find-tags-by-name-method)
+	(semanticdb-find-tags-by-name-regexp-method)
+	(semanticdb-find-tags-for-completion-method)
+	(semanticdb-find-tags-by-class-method)
+	(semanticdb-find-tags-external-children-of-type-method)
+	(semanticdb-find-tags-subclasses-of-type-method)
+	(semanticdb-deep-find-tags-by-name-method)
+	(semanticdb-deep-find-tags-by-name-regexp-method)
+	(semanticdb-deep-find-tags-for-completion-method):
+	* semantic/db-global.el (semanticdb-enable-gnu-global-hook)
+	(semanticdb-enable-gnu-global-in-buffer)
+	(semanticdb-find-tags-for-completion-method)
+	(semanticdb-deep-find-tags-by-name-method)
+	(semanticdb-deep-find-tags-for-completion-method):
+	* semantic/db-javascript.el (semanticdb-javascript-tags)
+	(javascript-mode, semanticdb-find-translate-path)
+	(semanticdb-find-tags-for-completion-method)
+	(semanticdb-find-tags-by-class-method)
+	(semanticdb-deep-find-tags-by-name-method)
+	(semanticdb-deep-find-tags-for-completion-method)
+	(semanticdb-find-tags-external-children-of-type-method):
+	* semantic/idle.el (semantic-idle-work-core-handler)
+	(define-semantic-idle-service, semantic-idle-summary-useful-context-p)
+	(global-semantic-idle-scheduler-mode):
+	* srecode/dictionary.el (srecode-field-value)
+	(srecode-dictionary-add-section-dictionary):
+	Fix typos in docstrings.
+
+2010-01-17  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/idle.el (semantic-idle-work-for-one-buffer): Doc fix.
+
+2010-01-17  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic.el (semantic-mode): Fix typos in docstrings.
+
+2010-01-16  Mario Lang  <mlang@delysid.org>
+
+	* ede/cpp-root.el (ede-cpp-root-project):
+	* ede/files.el (ede-expand-filename):
+	* ede/simple.el (ede-simple-project):
+	* semantic/complete.el (semantic-complete-read-tag-engine)
+	(semantic-complete-inline-tag-engine):
+	* semantic/db-el.el (semanticdb-equivalent-mode):
+	* semantic/db-global.el (semanticdb-equivalent-mode):
+	* semantic/db-javascript.el (semanticdb-equivalent-mode):
+	* semantic/db.el (semanticdb-equivalent-mode):
+	* semantic/decorate/include.el (semantic-decoration-unknown-include-describe):
+	* semantic/idle.el (semantic-idle-work-for-one-buffer):
+	Remove duplicated words in doc-strings.
+
+2010-01-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/edit.el (semantic-reparse-needed-change-hook)
+	(semantic-no-reparse-needed-change-hook):
+	* srecode/insert.el (srecode-resolve-argument-list)
+	(srecode-template-inserter-blank, srecode-template-inserter-variable)
+	(srecode-template-inserter-ask, srecode-template-inserter-width)
+	(srecode-template-inserter-section-start)
+	(srecode-template-inserter-section-end, srecode-insert-method):
+
+2010-01-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* data-debug.el (data-debug): Fix customization group reference.
+
+2010-01-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/analyze.el (semantic-analyze-push-error)
+	(semantic-analyze-context, semantic-analyze-context-assignment)
+	(semantic-analyze-find-tag-sequence, semantic-analyze-find-tag):
+	* semantic/java.el (java-mode, semantic-tag-include-filename)
+	(semantic-java-doc-keywords-map):
+	* semantic/bovine/c.el (c-mode, semantic-c-member-of-autocast)
+	(semantic-lex-c-nested-namespace-ignore-second, semantic-parse-region)
+	(semantic-c-parse-lexical-token, semantic-c-debug-mode-init-pch)
+	(semantic-c-classname, semantic-format-tag-uml-prototype)
+	(semantic-c-dereference-namespace, semantic-analyze-type-constants):
+	* semantic/bovine/el.el (semantic-elisp-form-to-doc-string)
+	(semantic-emacs-lisp-obsoleted-doc, semantic-up-context)
+	(semantic-get-local-variables, semantic-end-of-command)
+	(semantic-beginning-of-command, semantic-ctxt-current-class-list)
+	(lisp-mode):
+	* semantic/bovine/make.el (makefile-mode):
+	* semantic/wisent/python.el (wisent-python-string-re)
+	(wisent-python-implicit-line-joining-p, wisent-python-forward-string)
+	(wisent-python-lex-beginning-of-line, wisent-python-lex-end-of-line)
+	(semantic-lex, semantic-get-local-variables, python-mode):
+	* semantic/wisent/python-wy.el (wisent-python-wy--keyword-table):
+	* srecode/extract.el (srecode-extract-state-set)
+	(srecode-extract-method): Fix typos in docstrings.
+
+2010-01-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic.el (semantic-new-buffer-setup-functions):
+	Add python parser.
+
+2010-01-10  Richard Kim  <emacs18@gmail.com>
+
+	* semantic/wisent/python-wy.el:
+	* semantic/wisent/python.el: New files.
+
+2010-01-02  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/db-typecache.el (semanticdb-typecache-find-default):
+	Fix typo in docstring.
+
+2009-12-14  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/mru-bookmark.el (global-semantic-mru-bookmark-mode)
+	(semantic-mru-bookmark-mode): Doc fixes.
+
+	* semantic/db.el (semanticdb-cache-get): Use error instead
+	of assert.
+
+2009-12-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/ia.el (semantic-ia-complete-symbol):
+	Make argument optional.
+
+2009-12-05  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/bovine/c.el (semantic-c-describe-environment):
+	Describe project macro symbols.
+
+	* semantic/complete.el (semantic-complete-do-completion):
+	Don't call semantic-collector-current-exact-match.
+
+	* ede.el (ede-apply-preprocessor-map): Accept lists of
+	ede-objects as targets.
+
+	* ede/pmake.el (ede-proj-makefile-insert-variables): Output
+	a target's object list even if compiler vars are already in the
+	Makefile.
+
+	* ede/emacs.el (ede-preprocessor-map): Add config.h to the
+	list of headers producing necessary macros.
+
+2009-11-24  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/idle.el (global-semantic-idle-scheduler-mode):
+	Move after definition of global-semantic-idle-tag-highlight-mode.
+
+2009-11-22  Chong Yidong  <cyd@stupidchicken.com>
+
+	* srecode/map.el (srecode-get-maps):
+	* semantic/wisent/wisent.el (wisent-parse-toggle-verbose-flag):
+	* semantic/wisent/comp.el (wisent-toggle-verbose-flag):
+	* semantic/decorate/mode.el (semantic-decoration-mode)
+	(semantic-toggle-decoration-style):
+	* semantic/decorate/include.el
+	(semantic-decoration-include-describe)
+	(semantic-decoration-unknown-include-describe)
+	(semantic-decoration-unparsed-include-describe)
+	(semantic-decoration-all-include-summary):
+	* semantic/bovine/c.el (semantic-c-debug-mode-init):
+	* semantic/analyze/complete.el
+	(semantic-analyze-possible-completions):
+	* semantic/util-modes.el (semantic-highlight-edits-mode)
+	(semantic-show-unmatched-syntax-mode)
+	(semantic-show-parser-state-mode, semantic-stickyfunc-mode)
+	(semantic-highlight-func-mode):
+	* semantic/util.el (semantic-describe-buffer):
+	* semantic/symref.el (semantic-symref-find-references-by-name)
+	(semantic-symref-find-tags-by-name)
+	(semantic-symref-find-tags-by-regexp)
+	(semantic-symref-find-tags-by-completion)
+	(semantic-symref-find-file-references-by-name)
+	(semantic-symref-find-text):
+	* semantic/senator.el (senator-copy-tag, senator-kill-tag)
+	(senator-yank-tag):
+	* semantic/scope.el (semantic-calculate-scope):
+	* semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
+	* semantic/idle.el (semantic-idle-scheduler-mode)
+	(define-semantic-idle-service):
+	* semantic/complete.el (semantic-complete-analyze-inline)
+	(semantic-complete-analyze-inline-idle):
+	* semantic/analyze.el (semantic-analyze-current-context):
+	* mode-local.el (describe-mode-local-bindings)
+	(describe-mode-local-bindings-in-mode):
+	* ede/make.el (ede-make-check-version):
+	* ede/locate.el (ede-enable-locate-on-project):
+	* cedet-idutils.el (cedet-idutils-expand-filename)
+	(cedet-idutils-version-check):
+	* cedet-global.el (cedet-gnu-global-expand-filename)
+	(cedet-gnu-global-version-check):
+	* cedet-cscope.el (cedet-cscope-expand-filename)
+	(cedet-cscope-version-check): Use called-interactively-p instead
+	of interactive-p.
+
+	* semantic/ia.el (semantic-ia-completion-format-tag-function):
+	Use semantic-format-tag-prototype.
+
+2009-11-21  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/complete.el (semantic-complete-read-tag-engine)
+	(semantic-complete-jump-local, semantic-complete-jump):
+	Improve prompt string.
+
+2009-11-20  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/complete.el (semantic-complete-inline-map): Doc fix.
+
+	* semantic/idle.el (define-semantic-idle-service)
+	(semantic-idle-summary-mode, semantic-idle-completions): Doc fix.
+
+2009-11-20  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cedet.el (cedet-menu-map): Re-order menu items.
+
+	* semantic.el: Enable idle-mode menu items only if
+	global-semantic-idle-scheduler-mode is enabled.
+	(semantic-default-submodes): Doc fix.
+
+	* semantic/idle.el (global-semantic-idle-scheduler-mode):
+	When turning off, disable other idle modes.
+
+2009-11-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/idle.el (semantic-idle-summary-mode)
+	(semantic-idle-summary-mode): Define using define-minor-mode
+	instead of define-semantic-idle-service.
+	(semantic-idle-summary-mode): New function.
+	(semantic-idle-summary-mode-setup): Use pre-command-hook to ensure
+	that mouse motion does not reset the echo area.
+
+2009-11-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/ctxt.el (semantic-get-local-variables): Disable
+	the progress reporter entirely.
+
+2009-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* semantic/fw.el (semantic/loaddefs):
+	* srecode.el (srecode/loaddefs):
+	* ede.el (ede/loaddefs): Load rather than require.
+	* ede/cpp-root.el:
+	* ede/emacs.el:
+	* ede/files.el:
+	* ede/linux.el:
+	* ede/locate.el:
+	* ede/make.el:
+	* ede/shell.el:
+	* ede/speedbar.el:
+	* ede/system.el:
+	* ede/util.el:
+	* semantic/analyze.el:
+	* semantic/bovine.el:
+	* semantic/complete.el:
+	* semantic/ctxt.el:
+	* semantic/db-file.el:
+	* semantic/db-find.el:
+	* semantic/db-global.el:
+	* semantic/db-mode.el:
+	* semantic/db-typecache.el:
+	* semantic/db.el:
+	* semantic/debug.el:
+	* semantic/dep.el:
+	* semantic/doc.el:
+	* semantic/edit.el:
+	* semantic/find.el:
+	* semantic/format.el:
+	* semantic/html.el:
+	* semantic/ia-sb.el:
+	* semantic/ia.el:
+	* semantic/idle.el:
+	* semantic/lex-spp.el:
+	* semantic/lex.el:
+	* semantic/mru-bookmark.el:
+	* semantic/scope.el:
+	* semantic/senator.el:
+	* semantic/sort.el:
+	* semantic/symref.el:
+	* semantic/tag-file.el:
+	* semantic/tag-ls.el:
+	* semantic/tag-write.el:
+	* semantic/tag.el:
+	* semantic/util-modes.el:
+	* semantic/analyze/complete.el:
+	* semantic/analyze/refs.el:
+	* semantic/bovine/c.el:
+	* semantic/bovine/gcc.el:
+	* semantic/bovine/make.el:
+	* semantic/bovine/scm.el:
+	* semantic/decorate/include.el:
+	* semantic/decorate/mode.el:
+	* semantic/symref/cscope.el:
+	* semantic/symref/global.el:
+	* semantic/symref/grep.el:
+	* semantic/symref/idutils.el:
+	* semantic/symref/list.el:
+	* semantic/wisent/java-tags.el:
+	* semantic/wisent/javascript.el:
+	* srecode/compile.el:
+	* srecode/cpp.el:
+	* srecode/document.el:
+	* srecode/el.el:
+	* srecode/expandproto.el:
+	* srecode/getset.el:
+	* srecode/insert.el:
+	* srecode/java.el:
+	* srecode/map.el:
+	* srecode/mode.el:
+	* srecode/template.el:
+	* srecode/texi.el: Remove the file-local setting of
+	generated-autoload-feature.
+
+2009-11-03  Glenn Morris  <rgm@gnu.org>
+
+	* mode-local.el (with-mode-local): Doc fix.
+
+2009-10-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cedet.el (cedet-menu-map): Remove Semantic and EDE menu
+	items.
+
+	* ede.el (ede-minor-mode):
+	* semantic.el (semantic-mode): Toggle menu separators.
+
+2009-10-31  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/tag.el (semantic--tag-link-list-to-buffer):
+	Use mapc rather than mapcar because the return value is never used.
+
+	* srecode/template.el, cedet/semantic/wisent/javascript.el:
+	* semantic/wisent/java-tags.el, cedet/semantic/texi.el:
+	* semantic/html.el:
+	Suppress harmless warnings about setting up semantic-imenu (not
+	part of Emacs) variables.
+
+2009-10-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* srecode/srt-mode.el (semantic-analyze-possible-completions):
+	* semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
+	* semantic/symref/grep.el (semantic-symref-perform-search):
+	* semantic/bovine/gcc.el (semantic-gcc-query):
+	* semantic/bovine/c.el (semantic-c-parse-lexical-token):
+	* semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
+	(semantic-analyzer-debug-global-symbol)
+	(semantic-analyzer-debug-missing-innertype)
+	(semantic-analyzer-debug-insert-include-summary):
+	* semantic/util.el (semantic-file-tag-table):
+	(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
+	(semantic-recursive-find-nonterminal-by-name):
+	* semantic/tag-ls.el (semantic-tag-calculate-parent-default):
+	* semantic/tag-file.el (semantic-prototype-file):
+	* semantic/symref.el (semantic-symref-parse-tool-output):
+	* semantic/sb.el (semantic-sb-fetch-tag-table):
+	* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
+	* semantic/idle.el (semantic-idle-work-for-one-buffer):
+	(semantic-idle-summary-maybe-highlight):
+	* semantic/ia-sb.el (semantic-ia-speedbar)
+	(semantic-ia-sb-tag-info):
+	* semantic/grammar.el (semantic-analyze-possible-completions):
+	* semantic/find.el (semantic-brute-find-tag-by-position):
+	* semantic/ede-grammar.el (project-compile-target):
+	(ede-proj-makefile-insert-variables):
+	* semantic/debug.el (semantic-debug-set-parser-location):
+	(semantic-debug-set-source-location, semantic-debug-interface-layout)
+	(semantic-debug-mode, semantic-debug):
+	* semantic/db.el (semanticdb-needs-refresh-p):
+	* semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
+	* semantic/db-javascript.el (semanticdb-equivalent-mode):
+	* semantic/db-find.el (semanticdb-find-log-new-search)
+	(semanticdb-find-translate-path-includes--internal)
+	(semanticdb-reset-log, semanticdb-find-log-activity):
+	* semantic/db-file.el (object-write):
+	* semantic/db-el.el (semanticdb-equivalent-mode):
+	* semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
+	(semanticdb-create-ebrowse-database):
+	* semantic/db-debug.el (semanticdb-table-sanity-check):
+	* semantic/complete.el (semantic-displayor-focus-request)
+	(semantic-collector-calculate-completions-raw)
+	(semantic-complete-read-tag-analyzer):
+	* semantic/analyze.el (semantic-analyze-pulse):
+	* ede/util.el (ede-update-version-in-source):
+	* ede/proj.el (project-delete-target):
+	* ede/proj-elisp.el (ede-update-version-in-source)
+	(ede-proj-flush-autoconf):
+	* ede/pconf.el (ede-proj-configure-synchronize)
+	(ede-proj-configure-synchronize):
+	* ede/locate.el (ede-locate-file-in-project-impl):
+	* ede/linux.el (ede-linux-version):
+	* ede/emacs.el (ede-emacs-version):
+	* ede/dired.el (ede-dired-add-to-target):
+	* ede.el (ede-buffer-header-file, ede-find-target)
+	(ede-buffer-documentation-files, ede-project-buffers, ede-set)
+	(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
+	* cedet-idutils.el (cedet-idutils-fnid-call):
+	(cedet-idutils-lid-call, cedet-idutils-expand-filename)
+	(cedet-idutils-version-check):
+	* cedet-global.el (cedet-gnu-global-call):
+	(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
+	(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
+	* cedet-cscope.el (cedet-cscope-call)
+	(cedet-cscope-expand-filename, cedet-cscope-version-check):
+	Use with-current-buffer.
+	* ede.el (ede-make-project-local-variable)
+	(ede-set-project-variables, ede-set): Use dolist.
+
+2009-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mode-local.el (make-obsolete-overload): Add `when' argument.
+	(overload-docstring-extension): Use that info.
+	* semantic/fw.el (semantic-alias-obsolete): Pass the `when' info.
+	* semantic/idle.el (semantic-eldoc-current-symbol-info):
+	* semantic/tag-ls.el (semantic-nonterminal-protection)
+	(semantic-nonterminal-abstract, semantic-nonterminal-leaf)
+	(semantic-nonterminal-full-name): Add the new `when' info.
+	* semantic/decorate/mode.el (semantic/decorate): Require CL for
+	`assert'.
+
+2009-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* semantic/fw.el (semantic-alias-obsolete)
+	(semantic-varalias-obsolete): Make the `when' arg mandatory.
+	(define-mode-overload-implementation):
+	* semantic/decorate/mode.el (semantic-decorate-pending-decoration-hooks):
+	* semantic/wisent.el (wisent-lex-make-token-table):
+	* semantic/util.el (semantic-file-token-stream)
+	(semantic-something-to-stream):
+	* semantic/tag.el (semantic-tag-make-assoc-list)
+	(semantic-expand-nonterminal):
+	* semantic/tag-file.el (semantic-find-nonterminal)
+	(semantic-find-dependency, semantic-find-nonterminal)
+	(semantic-find-dependency):
+	* semantic/lex.el (semantic-flex-start, semantic-flex-end)
+	(semantic-flex-text, semantic-flex-make-keyword-table)
+	(semantic-flex-keyword-p, semantic-flex-keyword-put)
+	(semantic-flex-keyword-get, semantic-flex-map-keywords)
+	(semantic-flex-keywords, semantic-flex-buffer, semantic-flex-list):
+	* semantic/java.el (semantic-java-prototype-nonterminal):
+	* semantic/idle.el (semantic-before-idle-scheduler-reparse-hooks)
+	(semantic-after-idle-scheduler-reparse-hooks):
+	* semantic/edit.el (semantic-edits-incremental-reparse-failed-hooks):
+	* semantic/db-mode.el (semanticdb-mode-hooks):
+	* semantic.el (semantic-toplevel-bovine-table)
+	(semantic-toplevel-bovine-cache)
+	(semantic-before-toplevel-bovination-hook, semantic-init-hooks)
+	(semantic-init-mode-hooks, semantic-init-db-hooks)
+	(semantic-bovination-working-type): Provide the `when' arg.
+
+2009-10-24  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic/util.el (semantic-recursive-find-nonterminal-by-name):
+	* semantic/tag.el (semantic-token-type-parent): Add WHEN
+	argument to make-obsolete.
+
+	* semantic/fw.el (semantic-alias-obsolete)
+	(semantic-varalias-obsolete): Add optional WHEN argument.
+
+2009-10-21  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/bovine/c.el (semantic-c-debug-mode-init)
+	(semantic-c-debug-mode-init-pch): New functions.
+	(semantic-c-debug-mode-init-last-mode): New var.
+	(semantic-c-parse-lexical-token): Use them.
+
+	* semantic/lex-spp.el (semantic-lex-spp-anlyzer-do-replace):
+	When extracting the argument list, limit only by point-max.
+
+2009-10-17  Chong Yidong  <cyd@stupidchicken.com>
+
+	* srecode/srt.el:
+	* srecode/compile.el:
+	* semantic/mru-bookmark.el:
+	* semantic/debug.el:
+	* semantic/complete.el:
+	* semantic/analyze.el: Require CL when compiling.
+
+2009-10-17  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/scope.el
+	(semantic-analyze-scoped-inherited-tag-map): Wrap calculation of
+	tmpscope so that the regular scope will continue to work.
+
+	* semantic/idle.el (semantic-idle-tag-highlight):
+	Use semantic-idle-summary-highlight-face as the highlighting.
+
+	* emacs-lisp/eieio-base.el (eieio-persistent-save): If buffer
+	contains multibyte characters, choose first applicable coding
+	system automatically.
+
+	* ede/project-am.el (project-run-target): New method.
+	(project-run-target): New method.
+
+	* ede.el (ede-target): Add run target menu item.
+	(ede-project, ede-minor-keymap): Add ede-run-target binding.
+	(ede-run-target): New function.
+	(ede-target::project-run-target): New method.
+
+	* ede/proj.el (project-run-target): New method.
+
+	* ede/proj-shared.el (ede-gcc-libtool-shared-compiler)
+	(ede-g++-libtool-shared-compiler): Remove SHELL.  Remove COMMANDS.
+	Add :rules.
+	(ede-proj-target-makefile-shared-object): Only libtool compilers
+	now available.  Add linkers for libtool.
+	(ede-cc-linker-libtool, ede-g++-linker-libtool): New.
+	(ede-proj-makefile-target-name): Always use .la extension.
+
+	* ede/proj-prog.el (project-run-target): New method.
+
+	* ede/proj-obj.el (ede-cc-linker): Rename from ede-gcc-linker.
+	(ede-g++-linker): Change Change link lines.
+
+	* ede/pmake.el (ede-pmake-insert-variable-shared):
+	When searching for old variables, go to the end of the buffer and
+	search backward from there.
+	(ede-proj-makefile-automake-insert-subdirs)
+	(ede-proj-makefile-automake-insert-extradist): New methods.
+	(ede-proj-makefile-create): Use them.
+
+	* ede/pconf.el (ede-proj-configure-test-required-file):
+	Force FILE to expand to the current target.  Use file-exists-p to
+	check that it exists.
+
+	* ede/linux.el (ede-linux-version): Don't call "head".
+	(ede-linux-load): Wrap dir in file-name-as-directory.
+	Set :version slot.
+
+	* ede/files.el (ede-get-locator-object): When enabling
+	locate, do so on "top".
+
+	* ede/emacs.el (ede-emacs-file-existing): Wrap "dir" in
+	file-name-as-directory during compare.
+	(ede-emacs-version): Return Emacs/XEmacs differentiator.
+	Get version number from different places.  Don't call egrep.
+	(ede-emacs-load): Set :version slot.  Call file-name-as-directory
+	to set the directory.
+
+	* ede/shell.el: New file.
+
+	* inversion.el (inversion-decoders): Allow for stray . in
+	alpha/beta variants.
+
+2009-10-17  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/grammar.el (semantic-grammar--lex-delim-spec):
+	All errors should have messages.
+
+2009-10-10  Sascha Wilde  <wilde@sha-bang.de>
+
+	* ede/proj-shared.el (ede-proj-makefile-target-name):
+	Use .la for Automake.
+
+2009-10-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/pconf.el (ede-proj-configure-synchronize):
+	Use "autoreconf -i".  Suggested by Andreas Schwab.
+
+2009-10-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/proj.el (project-make-dist, project-compile-project):
+	Fix filename test.
+	(ede-proj-dist-makefile): Use expand-file-name instead of concat
+	to expand file names.
+
+2009-10-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/proj-obj.el (ede-gcc-linker): New var.
+	(ede-proj-target-makefile-objectcode): Use it.
+
+	* ede/source.el (ede-want-any-source-files-p)
+	(ede-want-any-auxiliary-files-p, ede-want-any-files-p):
+	Return search result.  This error was introduced while merging.
+
+2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* semantic.el (semantic-new-buffer-setup-functions): New option.
+	(semantic-new-buffer-fcn): Call parser setup functions here.
+	(semantic-mode): Don't call parser setup functions here, it's done
+	in semantic-new-buffer-fcn now.
+	(semantic-mode): Parse all existing buffers when enabled.
+
+	* srecode/compile.el (srecode-compile-file):
+	Call semantic-new-buffer-fcn if the buffer has not been parsed.
+
+2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede/pmake.el (ede-pmake-insert-variable-once): Delete.
+
+	* ede/proj-comp.el: Don't require ede/pmake at toplevel.
+	(proj-comp-insert-variable-once): New macro, renamed from
+	ede-pmake-insert-variable-once in ede/pmake.edl.
+	(ede-proj-makefile-insert-variables): Use it.
+
+2009-10-04  Juanma Barranquero  <lekktu@gmail.com>
+
+	* ede/makefile-edit.el (makefile-beginning-of-command)
+	(makefile-end-of-command):
+	* srecode/srt-mode.el (semantic-beginning-of-context)
+	(semantic-end-of-context): Fix previous change.  Doc fixes.
+
+2009-10-04  Juanma Barranquero  <lekktu@gmail.com>
+
+	* ede/makefile-edit.el (makefile-beginning-of-command)
+	(makefile-end-of-command):
+	* semantic/lex.el (semantic-lex-token):
+	* semantic/analyze/fcn.el
+	(semantic-analyze-dereference-metatype-1):
+	* semantic/bovine/c.el (semantic-lex-cpp-define)
+	(semantic-lex-cpp-undef):
+	* semantic/wisent/wisent.el (wisent-skip-block):
+	* srecode/srt-mode.el (semantic-beginning-of-context)
+	(semantic-end-of-context): Fix typos in docstrings.
+
+2009-10-04  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede.el (ede-project-placeholder-cache-file):
+	* semantic/db-file.el (semanticdb-default-save-directory):
+	* srecode/map.el (srecode-map-save-file):
+	Use locate-user-emacs-file.  Suggested by Juanma Barranquero.
+
+2009-10-03  Chong Yidong  <cyd@stupidchicken.com>
+
+	* srecode/insert.el: Require srecode/args.
+
+	* srecode/args.el: Require srecode/dictionary instead of
+	srecode/insert.
+
+	* srecode/srt-mode.el (srecode-template-mode): Doc fix.
+
+	* files.el (auto-mode-alist): Add .srt and Project.ede.
+
+	* semantic.el (semantic-mode):
+	Handle srecode-template-mode-hook as well.
+	(semantic-mode): Use js-mode-hook for Javascript hook.
+
+	* srecode/template.el: Remove hook variable.
+
+	* ede/proj-comp.el: Require ede/pmake when compiling.
+
+	* ede.el (ede-target-forms-menu): Don't enable if no
+	projects exist.
+	(ede-project-placeholder-cache-file): Default to a file in
+	user-emacs-directory.
+
+	* srecode/map.el (srecode-map-base-template-dir): Look for
+	templates in data-directory.
+	(srecode-map-save-file): Default to a file in user-emacs-directory.
+
+	* ede/srecode.el (ede-srecode-setup): Use default templates
+	directory.
+
+2009-09-30  Eric Ludlam  <zappo@gnu.org>
+
+	* semantic/util-modes.el (semantic-highlight-func-mode):
+	Doc fix.
+
+	* ede/proj-comp.el (ede-proj-makefile-insert-variables):
+	Only insert each variable once.
+
+	* ede/pmake.el (ede-pmake-insert-variable-once): New macro.
+	(ede-pmake-insert-variable-shared): Use it.
+
+	* ede/cpp-root.el (ede-preprocessor-map): Do not deref table
+	for lexical table iff table is nil.
+
+2009-10-01  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/bovine/gcc.el
+	(semantic-c-reset-preprocessor-symbol-map): Fix declaration.
+	(semantic-gcc-get-include-paths, semantic-gcc-setup-data): Doc fixes.
+
+2009-10-03  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/db-find.el (data-debug-insert-tag-list): Comment out
+	declaration, currently false.
+
+2009-10-01  Glenn Morris  <rgm@gnu.org>
+
+	* cedet-files.el (cedet-directory-name-to-file-name):
+	* cedet-idutils.el (cedet-idutils-search)
+	(cedet-idutils-expand-filename, cedet-idutils-support-for-directory)
+	(cedet-idutils-version-check):
+	* cedet.el (cedet-version):
+	* data-debug.el (data-debug-insert-overlay-button)
+	(data-debug-insert-overlay-list-button)
+	(data-debug-insert-buffer-button)
+	(data-debug-insert-buffer-list-button)
+	(data-debug-insert-process-button, data-debug-insert-ring-button)
+	(data-debug-insert-widget, data-debug-insert-stuff-list-button)
+	(data-debug-insert-stuff-vector-button)
+	(data-debug-insert-symbol-button, data-debug-insert-string)
+	(data-debug-insert-number, data-debug-insert-lambda-expression)
+	(data-debug-insert-nil, data-debug-insert-simple-thing)
+	(data-debug-insert-custom, data-debug-edebug-expr):
+	* ede.el (ede-auto-add-method, ede-project-class-files)
+	(global-ede-mode-map, ede-new, ede-debug-target)
+	(ede-customize-current-target, ede-buffers, ede-map-buffers, ede-set):
+	* semantic.el (semantic-minimum-working-buffer-size)
+	(semantic-fetch-tags, semantic-submode-list)
+	(semantic-default-submodes):
+	* ede/source.el (ede-source-match):
+	* ede/project-am.el (project-am-type-alist, project-add-file)
+	(project-am-package-info):
+	* ede/proj.el (ede-proj-target, project-new-target):
+	* ede/proj-elisp.el (ede-proj-tweak-autoconf):
+	* ede/proj-comp.el (ede-current-build-list):
+	* ede/makefile-edit.el (makefile-move-to-macro):
+	* ede/files.el (ede-toplevel-project-or-nil):
+	* ede/cpp-root.el (initialize-instance):
+	* ede/autoconf-edit.el (autoconf-find-last-macro)
+	(autoconf-parameter-strip, autoconf-insert-new-macro):
+	* semantic/wisent.el (wisent-lex-eoi):
+	* semantic/util-modes.el (global-semantic-show-parser-state-mode)
+	(semantic-show-parser-state-mode):
+	* semantic/texi.el (semantic-texi-environment-regexp):
+	* semantic/tag.el (semantic-tag-new-variable)
+	(semantic-tag-class, semantic-tag-new-variable, semantic-tag-copy)
+	(semantic--tag-deep-copy-attributes, semantic--tag-deep-copy-value)
+	(semantic--tag-deep-copy-tag-list)
+	(semantic-tag-components-with-overlays-default):
+	* semantic/symref.el (semantic-symref-find-text):
+	* semantic/senator.el (senator-yank-tag)
+	(senator-transpose-tags-up):
+	* semantic/scope.el (semantic-analyze-scoped-tags-default)
+	(semantic-analyze-scoped-inherited-tags, semantic-scope-find):
+	* semantic/sb.el (semantic-sb-autoexpand-length):
+	* semantic/lex.el (semantic-lex-comment-regex)
+	(semantic-lex-maximum-depth, define-lex, semantic-lex-token)
+	(semantic-lex-unterminated-syntax-protection, define-lex-analyzer):
+	* semantic/lex-spp.el
+	(semantic-lex-spp-dynamic-macro-symbol-obarray-stack)
+	(semantic-lex-spp-symbol, semantic-lex-spp-one-token-to-txt):
+	* semantic/idle.el
+	(semantic-idle-summary-current-symbol-info-brutish)
+	(semantic-idle-summary-current-symbol-info-default):
+	* semantic/grammar.el (semantic-grammar-recreate-package)
+	(semantic--grammar-macro-compl-dict):
+	* semantic/grammar-wy.el (semantic-grammar-wy--parse-table):
+	* semantic/format.el (semantic-format-tag-custom-list)
+	(semantic-format-tag-canonical-name-default):
+	* semantic/find.el (semantic-find-tag-by-overlay-in-region)
+	(semantic-find-tags-for-completion)
+	(semantic-find-tags-by-scope-protection-default)
+	(semantic-deep-find-tags-for-completion):
+	* semantic/edit.el
+	(semantic-edits-incremental-reparse-failed-hook)
+	(semantic-edits-verbose-flag, semantic-edits-assert-valid-region)
+	(semantic-edits-splice-remove, semantic-edits-splice-replace):
+	* semantic/doc.el (semantic-documentation-comment-preceeding-tag):
+	* semantic/dep.el (semantic-dependency-include-path):
+	* semantic/db.el (semanticdb-default-find-index-class)
+	(semanticdb-match-any-mode, semanticdb-with-match-any-mode)
+	(semanticdb-project-roots):
+	* semantic/db-find.el (semanticdb-implied-include-tags)
+	(semanticdb-find-adebug-insert-scanned-tag-cons)
+	(semanticdb-find-log-buffer-name, semanticdb-find-result-mapc)
+	(semanticdb-brute-deep-find-tags-for-completion):
+	* semantic/db-ebrowse.el (semanticdb-ebrowse-add-tree-to-table):
+	* semantic/ctxt.el (semantic-beginning-of-context-default)
+	(semantic-end-of-context-default)
+	(semantic-ctxt-current-function-default)
+	(semantic-ctxt-scoped-types-default):
+	* semantic/complete.el (semantic-complete-read-tag-engine)
+	(semantic-complete-inline-tag-engine)
+	(semantic-complete-inline-custom-type)
+	(semantic-complete-read-tag-analyzer):
+	* semantic/chart.el (semantic-chart-tags-by-class)
+	(semantic-chart-database-size):
+	* semantic/analyze.el (semantic-analyze-current-symbol)
+	(semantic-analyze-current-context):
+	* semantic/symref/list.el (semantic-symref)
+	(semantic-symref-hide-buffer, semantic-symref-symbol):
+	* semantic/symref/grep.el (semantic-symref-grep-use-template):
+	* semantic/symref/filter.el (semantic-symref-hits-in-region):
+	* semantic/bovine/el.el (semantic-elisp-form-to-doc-string):
+	* semantic/bovine/c.el (semantic-lex-c-preprocessor-symbol-map)
+	(semantic-c-parse-token-hack-depth, semantic-c--template-name-1)
+	(semantic-c-dereference-template):
+	* semantic/analyze/refs.el (semantic--analyze-refs-full-lookup)
+	(semantic--analyze-refs-full-lookup-with-parents)
+	(semantic--analyze-refs-full-lookup-simple):
+	* semantic/analyze/complete.el
+	(semantic-analyze-possible-completions):
+	* srecode/table.el (srecode-mode-table-new):
+	* srecode/srt.el (srecode-read-variable-name):
+	* srecode/srt-mode.el (srecode-macro-help, srecode-in-macro-p):
+	* srecode/semantic.el (srecode-semantic-handle-:tag)
+	(srecode-semantic-handle-:tagtype, srecode-semantic-insert-tag):
+	* srecode/map.el (srecode-current-map):
+	* srecode/insert.el (srecode-insert)
+	(srecode-insert-variable-secondname-handler, srecode-insert-method)
+	(srecode-template-inserter-point-override)
+	(srecode-insert-include-lookup):
+	* srecode/getset.el (srecode-auto-choose-class):
+	* srecode/extract.el (srecode-inserter-extract):
+	* srecode/document.el
+	(srecode-document-autocomment-return-last-alist)
+	(srecode-document-autocomment-param-type-alist)
+	(srecode-document-insert-function-comment)
+	(srecode-document-insert-variable-one-line-comment)
+	(srecode-document-function-name-comment):
+	* srecode/dictionary.el (srecode-create-dictionary)
+	(srecode-compound-toString):
+	* srecode/compile.el (srecode-flush-active-templates):
+	* srecode/args.el (srecode-semantic-handle-:blank):
+	Doc/message fixes.
+
+2009-10-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* semantic/wisent/javat-wy.el
+	(wisent-java-tags-wy--keyword-table): Use \000 instead of literal ^@.
+
+2009-09-30  Juanma Barranquero  <lekktu@gmail.com>
+
+	* srecode/expandproto.el: Fix provide statement.
+
+2009-09-30  Eric Ludlam  <zappo@gnu.org>
+
+	* emacs-lisp/eieio.el (boolean-p): Delete.
+
+2009-09-30  Sascha Wilde  <wilde@sha-bang.de>
+
+	* ede/srecode.el: Fix provide statement.
+
+2009-09-30  Glenn Morris  <rgm@gnu.org>
+
+	* ede/proj.el (ede-proj-target-makefile-miscelaneous):
+	* ede/proj-aux.el (ede-aux-source):
+	* ede/proj-misc.el (ede-proj-target-makefile-miscelaneous)
+	(ede-misc-source):
+	* semantic/mru-bookmark.el (semantic-mrub-completing-read)
+	(semantic-mrub-switch-tags): Fix doc typos.
+
+	* semantic/db-global.el (data-debug-new-buffer)
+	(data-debug-insert-thing): Remove unneeded declarations (one broken).
+	(semanticdb-enable-gnu-global-databases): Fix prompt typo.
+
+	* semantic/analyze/fcn.el (semantic-scope-find): Fix declaration.
+
+	* semantic/bovine/gcc.el (semantic-gcc-setup): Replace runtime
+	use of CL function `remove-if-not'.
+
+2009-09-29  Glenn Morris  <rgm@gnu.org>
+
+	* semantic/symref/idutils.el:
+	* semantic/symref/list.el: Relicense under GPLv3+.
+
+	* ede/srecode.el (srecode-resolve-arguments): Fix declaration.
+
+	* semantic/complete.el (semantic-displayor-focus-abstract-child-p):
+	* semantic/tag-file.el (semanticdb-table-child-p):
+	* srecode/compile.el (srecode-template-inserter-newline-child-p):
+	Mark declarations not understood by check-declare.
+
+2009-09-28  Eric Ludlam  <zappo@gnu.org>
+
+	CEDET (development tools) package merged.
+
+	* *.el:
+	* ede/*.el:
+	* semantic/*.el:
+	* srecode/*.el: New files.
+
+2009-09-28  Eric Ludlam  <zappo@gnu.org>
+
+	* emacs-lisp/chart.el:
+	* emacs-lisp/eieio-base.el:
+	* emacs-lisp/eieio-comp.el:
+	* emacs-lisp/eieio-custom.el:
+	* emacs-lisp/eieio-datadebug.el:
+	* emacs-lisp/eieio-opt.el:
+	* emacs-lisp/eieio-speedbar.el:
+	* emacs-lisp/eieio.el: New files.
+
+	* cedet-cscope.el:
+	* cedet-files.el:
+	* cedet-global.el:
+	* cedet-idutils.el:
+	* data-debug.el:
+	* inversion.el:
+	* mode-local.el:
+	* pulse.el: New files.
--- a/lisp/cedet/cedet-cscope.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/cedet-cscope.el	Wed Oct 13 22:40:51 2010 +0900
@@ -72,6 +72,12 @@
 	)
     (cedet-cscope-call (list "-d" "-L" idx searchtext))))
 
+(defun cedet-cscope-create (flags)
+  "Create a CScope database at the current directory.
+FLAGS are additional flags to pass to cscope beyond the
+options -cR."
+  (cedet-cscope-call (append (list "-cR") flags)))
+
 (defun cedet-cscope-call (flags)
   "Call CScope with the list of FLAGS."
   (let ((b (get-buffer-create "*CEDET CScope*"))
@@ -112,13 +118,19 @@
 If DIR is not supplied, use the current default directory.
 This works by running cscope on a bogus symbol, and looking for
 the error code."
+  (interactive "DDirectory: ")
   (save-excursion
     (let ((default-directory (or dir default-directory)))
       (set-buffer (cedet-cscope-call (list "-d" "-L" "-7" "moose")))
       (goto-char (point-min))
-      (if (looking-at "[^ \n]*cscope: ")
-	  nil
-	t))))
+      (let ((ans (looking-at "[^ \n]*cscope: ")))
+	(if (called-interactively-p 'interactive)
+	    (if ans
+		(message "No support for CScope in %s" default-directory)
+	      (message "CScope is supported in %s" default-directory))
+	  (if ans
+	      nil
+	    t))))))
 
 (defun cedet-cscope-version-check (&optional noerror)
   "Check the version of the installed CScope command.
@@ -150,6 +162,14 @@
 	    (message "CScope %s  - Good enough for CEDET." rev))
 	  t)))))
 
+(defun cedet-cscope-create/update-database (&optional dir)
+  "Create a CScope database in DIR.
+CScope will automatically choose incremental rebuild if
+there is already a database in DIR."
+  (interactive "DDirectory: ")
+  (let ((default-directory dir))
+    (cedet-cscope-create nil)))
+
 (provide 'cedet-cscope)
 
 ;; arch-tag: 9973f1ad-f13b-4399-bc67-7f488478d78d
--- a/lisp/cedet/cedet-global.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/cedet-global.el	Wed Oct 13 22:40:51 2010 +0900
@@ -33,6 +33,12 @@
   :type 'string
   :group 'cedet)
 
+(defcustom cedet-global-gtags-command "gtags"
+  "Command name for the GNU Global gtags executable.
+GTAGS is used to create the tags table queried by the 'global' command."
+  :type 'string
+  :group 'cedet)
+
 ;;; Code:
 (defun cedet-gnu-global-search (searchtext texttype type scope)
   "Perform a search with GNU Global, return the created buffer.
@@ -75,6 +81,19 @@
 	   flags)
     b))
 
+(defun cedet-gnu-global-gtags-call (flags)
+  "Create GNU Global TAGS using gtags with FLAGS."
+  (let ((b (get-buffer-create "*CEDET Global gtags*"))
+	(cd default-directory)
+	)
+    (with-current-buffer b
+      (setq default-directory cd)
+      (erase-buffer))
+    (apply 'call-process cedet-global-gtags-command
+	   nil b nil
+	   flags)
+    b))
+
 (defun cedet-gnu-global-expand-filename (filename)
   "Expand the FILENAME with GNU Global.
 Return a fully qualified filename."
@@ -152,6 +171,18 @@
       ;; Return the results
       (nreverse hits))))
 
+(defun cedet-gnu-global-create/update-database (&optional dir)
+  "Create a GNU Global database in DIR.
+If a database already exists, then just update it."
+  (interactive "DDirectory: ")
+  (let ((root (cedet-gnu-global-root dir)))
+    (if root (setq dir root))
+    (let ((default-directory dir))
+      (cedet-gnu-global-gtags-call
+       (when root
+	 '("-i");; Incremental update flag.
+	 )))))
+
 (provide 'cedet-global)
 
 ;; arch-tag: 0d0d3ac2-91ef-4820-bb2b-1d59ccf38392
--- a/lisp/cedet/cedet-idutils.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/cedet-idutils.el	Wed Oct 13 22:40:51 2010 +0900
@@ -43,6 +43,11 @@
   :type 'string
   :group 'cedet)
 
+(defcustom cedet-idutils-make-command "mkid"
+  "Command name for the ID Utils executable for creating token databases."
+  :type 'string
+  :group 'cedet)
+
 (defun cedet-idutils-search (searchtext texttype type scope)
   "Perform a search with ID Utils, return the created buffer.
 SEARCHTEXT is text to find.
@@ -104,6 +109,20 @@
 	   flags)
     b))
 
+(defun cedet-idutils-mkid-call (flags)
+  "Call ID Utils mkid with the list of FLAGS.
+Return the created buffer with with program output."
+  (let ((b (get-buffer-create "*CEDET mkid*"))
+	(cd default-directory)
+	)
+    (with-current-buffer b
+      (setq default-directory cd)
+      (erase-buffer))
+    (apply 'call-process cedet-idutils-make-command
+	   nil b nil
+	   flags)
+    b))
+
 ;;; UTIL CALLS
 ;;
 (defun cedet-idutils-expand-filename (filename)
@@ -171,6 +190,12 @@
 	    (message "ID Utils %s  - Good enough for CEDET." rev))
 	  t)))))
 
+(defun cedet-idutils-create/update-database (&optional dir)
+  "Create an IDUtils database in DIR.
+IDUtils must start from scratch when updating a database."
+  (interactive "DDirectory: ")
+  (let ((default-directory dir))
+    (cedet-idutils-mkid-call nil)))
 
 (provide 'cedet-idutils)
 
--- a/lisp/cedet/cedet.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/cedet.el	Wed Oct 13 22:40:51 2010 +0900
@@ -36,19 +36,19 @@
 
 (declare-function inversion-find-version "inversion")
 
-(defconst cedet-version "1.0pre7"
+(defconst cedet-version "1.0"
   "Current version of CEDET.")
 
 (defconst cedet-packages
   `(
     ;;PACKAGE   MIN-VERSION
     (cedet         ,cedet-version)
-    (eieio         "1.2")
-    (semantic      "2.0pre7")
-    (srecode       "1.0pre7")
-    (ede           "1.0pre7")
-    (speedbar      "1.0.3"))
-  "Table of CEDET packages to install.")
+    (eieio         "1.3")
+    (semantic      "2.0")
+    (srecode       "1.0")
+    (ede           "1.0")
+    (speedbar      "1.0"))
+  "Table of CEDET packages installed.")
 
 (defvar cedet-menu-map ;(make-sparse-keymap "CEDET menu")
   (let ((map (make-sparse-keymap "CEDET menu")))
--- a/lisp/cedet/ede.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede.el	Wed Oct 13 22:40:51 2010 +0900
@@ -43,24 +43,24 @@
 (require 'eieio)
 (require 'eieio-speedbar)
 (require 'ede/source)
+(require 'ede/base)
+(require 'ede/auto)
+
 (load "ede/loaddefs" nil 'nomessage)
 
+(declare-function ede-commit-project "ede/custom")
 (declare-function ede-convert-path "ede/files")
 (declare-function ede-directory-get-open-project "ede/files")
 (declare-function ede-directory-get-toplevel-open-project "ede/files")
 (declare-function ede-directory-project-p "ede/files")
 (declare-function ede-find-subproject-for-directory "ede/files")
 (declare-function ede-project-directory-remove-hash "ede/files")
-(declare-function ede-project-root "ede/files")
-(declare-function ede-project-root-directory "ede/files")
 (declare-function ede-toplevel "ede/files")
 (declare-function ede-toplevel-project "ede/files")
 (declare-function ede-up-directory "ede/files")
-(declare-function data-debug-new-buffer "data-debug")
-(declare-function data-debug-insert-object-slots "eieio-datadebug")
 (declare-function semantic-lex-make-spp-table "semantic/lex-spp")
 
-(defconst ede-version "1.0pre7"
+(defconst ede-version "1.0"
   "Current version of the Emacs EDE.")
 
 ;;; Code:
@@ -94,314 +94,6 @@
   :group 'ede
   :type 'sexp) ; make this be a list of options some day
 
-
-;;; Top level classes for projects and targets
-
-(defclass ede-project-autoload ()
-  ((name :initarg :name
-	 :documentation "Name of this project type")
-   (file :initarg :file
-	 :documentation "The lisp file belonging to this class.")
-   (proj-file :initarg :proj-file
-	      :documentation "Name of a project file of this type.")
-   (proj-root :initarg :proj-root
-	      :type function
-	      :documentation "A function symbol to call for the project root.
-This function takes no arguments, and returns the current directories
-root, if available.  Leave blank to use the EDE directory walking
-routine instead.")
-   (initializers :initarg :initializers
-		 :initform nil
-		 :documentation
-		 "Initializers passed to the project object.
-These are used so there can be multiple types of projects
-associated with a single object class, based on the initilizeres used.")
-   (load-type :initarg :load-type
-	      :documentation "Fn symbol used to load this project file.")
-   (class-sym :initarg :class-sym
-	      :documentation "Symbol representing the project class to use.")
-   (new-p :initarg :new-p
-	  :initform t
-	  :documentation
-	  "Non-nil if this is an option when a user creates a project.")
-   )
-  "Class representing minimal knowledge set to run preliminary EDE functions.
-When more advanced functionality is needed from a project type, that projects
-type is required and the load function used.")
-
-(defvar ede-project-class-files
-  (list
-   (ede-project-autoload "edeproject-makefile"
-			 :name "Make" :file 'ede/proj
-			 :proj-file "Project.ede"
-			 :load-type 'ede-proj-load
-			 :class-sym 'ede-proj-project)
-   (ede-project-autoload "edeproject-automake"
-			 :name "Automake" :file 'ede/proj
-			 :proj-file "Project.ede"
-			 :initializers '(:makefile-type Makefile.am)
-			 :load-type 'ede-proj-load
-			 :class-sym 'ede-proj-project)
-   (ede-project-autoload "automake"
-			 :name "automake" :file 'ede/project-am
-			 :proj-file "Makefile.am"
-			 :load-type 'project-am-load
-			 :class-sym 'project-am-makefile
-			 :new-p nil)
-   (ede-project-autoload "cpp-root"
-			 :name "CPP ROOT" :file 'ede/cpp-root
-			 :proj-file 'ede-cpp-root-project-file-for-dir
-			 :proj-root 'ede-cpp-root-project-root
-			 :load-type 'ede-cpp-root-load
-			 :class-sym 'ede-cpp-root
-			 :new-p nil)
-   (ede-project-autoload "emacs"
-			 :name "EMACS ROOT" :file 'ede/emacs
-			 :proj-file "src/emacs.c"
-			 :proj-root 'ede-emacs-project-root
-			 :load-type 'ede-emacs-load
-			 :class-sym 'ede-emacs-project
-			 :new-p nil)
-   (ede-project-autoload "linux"
-			 :name "LINUX ROOT" :file 'ede/linux
-			 :proj-file "scripts/ver_linux"
-			 :proj-root 'ede-linux-project-root
-			 :load-type 'ede-linux-load
-			 :class-sym 'ede-linux-project
-			 :new-p nil)
-   (ede-project-autoload "simple-overlay"
-			 :name "Simple" :file 'ede/simple
-			 :proj-file 'ede-simple-projectfile-for-dir
-			 :load-type 'ede-simple-load
-			 :class-sym 'ede-simple-project))
-  "List of vectors defining how to determine what type of projects exist.")
-
-;;; Generic project information manager objects
-
-(defclass ede-target (eieio-speedbar-directory-button)
-  ((buttonface :initform speedbar-file-face) ;override for superclass
-   (name :initarg :name
-	 :type string
-	 :custom string
-	 :label "Name"
-	 :group (default name)
-	 :documentation "Name of this target.")
-   ;; @todo - I think this should be "dir", and not "path".
-   (path :initarg :path
-	 :type string
-	 ;:custom string
-	 ;:label "Path to target"
-	 ;:group (default name)
-	 :documentation "The path to the sources of this target.
-Relative to the path of the project it belongs to.")
-   (source :initarg :source
-	   :initform nil
-	   ;; I'd prefer a list of strings.
-	   :type list
-	   :custom (repeat (string :tag "File"))
-	   :label "Source Files"
-	   :group (default source)
-	   :documentation "Source files in this target.")
-   (versionsource :initarg :versionsource
-		  :initform nil
-		  :type list
-		  :custom (repeat (string :tag "File"))
-		  :label "Source Files with Version String"
-		  :group (source)
-		  :documentation
-		  "Source files with a version string in them.
-These files are checked for a version string whenever the EDE version
-of the master project is changed.  When strings are found, the version
-previously there is updated.")
-   ;; Class level slots
-   ;;
-;   (takes-compile-command :allocation :class
-;			  :initarg :takes-compile-command
-;			  :type boolean
-;			  :initform nil
-;			  :documentation
-;     "Non-nil if this target requires a user approved command.")
-   (sourcetype :allocation :class
-	       :type list ;; list of symbols
-	       :documentation
-	       "A list of `ede-sourcecode' objects this class will handle.
-This is used to match target objects with the compilers they can use, and
-which files this object is interested in."
-	       :accessor ede-object-sourcecode)
-   (keybindings :allocation :class
-		:initform (("D" . ede-debug-target))
-		:documentation
-"Keybindings specialized to this type of target."
-		:accessor ede-object-keybindings)
-   (menu :allocation :class
-	 :initform ( [ "Debug target" ede-debug-target
-		       (and ede-object
-			    (obj-of-class-p ede-object ede-target)) ]
-		     )
-		     [ "Run target" ede-run-target
-		       (and ede-object
-			    (obj-of-class-p ede-object ede-target)) ]
-	 :documentation "Menu specialized to this type of target."
-	 :accessor ede-object-menu)
-   )
-  "A top level target to build.")
-
-(defclass ede-project-placeholder (eieio-speedbar-directory-button)
-  ((name :initarg :name
-	 :initform "Untitled"
-	 :type string
-	 :custom string
-	 :label "Name"
-	 :group (default name)
-	 :documentation "The name used when generating distribution files.")
-   (version :initarg :version
-	    :initform "1.0"
-	    :type string
-	    :custom string
-	    :label "Version"
-	    :group (default name)
-	    :documentation "The version number used when distributing files.")
-   (directory :type string
-	      :initarg :directory
-	      :documentation "Directory this project is associated with.")
-   (dirinode :documentation "The inode id for :directory.")
-   (file :type string
-	 :initarg :file
-	 :documentation "File name where this project is stored.")
-   (rootproject ; :initarg - no initarg, don't save this slot!
-    :initform nil
-    :type (or null ede-project-placeholder-child)
-    :documentation "Pointer to our root project.")
-   )
-  "Placeholder object for projects not loaded into memory.
-Projects placeholders will be stored in a user specific location
-and querying them will cause the actual project to get loaded.")
-
-(defclass ede-project (ede-project-placeholder)
-  ((subproj :initform nil
-	    :type list
-	    :documentation "Sub projects controlled by this project.
-For Automake based projects, each directory is treated as a project.")
-   (targets :initarg :targets
-	    :type list
-	    :custom (repeat (object :objectcreatefcn ede-new-target-custom))
-	    :label "Local Targets"
-	    :group (targets)
-	    :documentation "List of top level targets in this project.")
-   (locate-obj :type (or null ede-locate-base-child)
-	       :documentation
-	       "A locate object to use as a backup to `ede-expand-filename'.")
-   (tool-cache :initarg :tool-cache
-	       :type list
-	       :custom (repeat object)
-	       :label "Tool: "
-	       :group tools
-	       :documentation "List of tool cache configurations in this project.
-This allows any tool to create, manage, and persist project-specific settings.")
-   (mailinglist :initarg :mailinglist
-		:initform ""
-		:type string
-		:custom string
-		:label "Mailing List Address"
-		:group name
-		:documentation
-		"An email address where users might send email for help.")
-   (web-site-url :initarg :web-site-url
-		 :initform ""
-		 :type string
-		 :custom string
-		 :label "Web Site URL"
-		 :group name
-		 :documentation "URL to this projects web site.
-This is a URL to be sent to a web site for documentation.")
-   (web-site-directory :initarg :web-site-directory
-		       :initform ""
-		       :custom string
-		       :label "Web Page Directory"
-		       :group name
-		       :documentation
-		       "A directory where web pages can be found by Emacs.
-For remote locations use a path compatible with ange-ftp or EFS.
-You can also use TRAMP for use with rcp & scp.")
-   (web-site-file :initarg :web-site-file
-		  :initform ""
-		  :custom string
-		  :label "Web Page File"
-		  :group name
-		  :documentation
-		  "A file which contains the home page for this project.
-This file can be relative to slot `web-site-directory'.
-This can be a local file, use ange-ftp, EFS, or TRAMP.")
-   (ftp-site :initarg :ftp-site
-	     :initform ""
-	     :type string
-	     :custom string
-	     :label "FTP site"
-	     :group name
-	     :documentation
-	     "FTP site where this project's distribution can be found.
-This FTP site should be in Emacs form, as needed by `ange-ftp', but can
-also be of a form used by TRAMP for use with scp, or rcp.")
-   (ftp-upload-site :initarg :ftp-upload-site
-		    :initform ""
-		    :type string
-		    :custom string
-		    :label "FTP Upload site"
-		    :group name
-		    :documentation
-		    "FTP Site to upload new distributions to.
-This FTP site should be in Emacs form as needed by `ange-ftp'.
-If this slot is nil, then use `ftp-site' instead.")
-   (configurations :initarg :configurations
-		   :initform ("debug" "release")
-		   :type list
-		   :custom (repeat string)
-		   :label "Configuration Options"
-		   :group (settings)
-		   :documentation "List of available configuration types.
-Individual target/project types can form associations between a configuration,
-and target specific elements such as build variables.")
-   (configuration-default :initarg :configuration-default
-			  :initform "debug"
-			  :custom string
-			  :label "Current Configuration"
-			  :group (settings)
-			  :documentation "The default configuration.")
-   (local-variables :initarg :local-variables
-		    :initform nil
-		    :custom (repeat (cons (sexp :tag "Variable")
-					  (sexp :tag "Value")))
-		    :label "Project Local Variables"
-		    :group (settings)
-		    :documentation "Project local variables")
-   (keybindings :allocation :class
-		:initform (("D" . ede-debug-target)
-			   ("R" . ede-run-target))
-		:documentation "Keybindings specialized to this type of target."
-		:accessor ede-object-keybindings)
-   (menu :allocation :class
-	 :initform
-	 (
-	  [ "Update Version" ede-update-version ede-object ]
-	  [ "Version Control Status" ede-vc-project-directory ede-object ]
-	  [ "Edit Project Homepage" ede-edit-web-page
-	    (and ede-object (oref (ede-toplevel) web-site-file)) ]
-	  [ "Browse Project URL" ede-web-browse-home
-	    (and ede-object
-		 (not (string= "" (oref (ede-toplevel) web-site-url)))) ]
-	  "--"
-	  [ "Rescan Project Files" ede-rescan-toplevel t ]
-	  [ "Edit Projectfile" ede-edit-file-target
-	    (and ede-object
-		 (or (listp ede-object)
-		     (not (obj-of-class-p ede-object ede-project)))) ]
-	  )
-	 :documentation "Menu specialized to this type of target."
-	 :accessor ede-object-menu)
-   )
-  "Top level EDE project specification.
-All specific project types must derive from this project."
-  :method-invocation-order :depth-first)
 
 ;;; Management variables
 
@@ -430,109 +122,13 @@
 If `ede-object' is nil, then commands will operate on this object.")
 
 (defvar ede-constructing nil
-  "Non nil when constructing a project hierarchy.")
+  "Non nil when constructing a project hierarchy.
+If the project is being constructed from an autoload, then the
+value is the autoload object being used.")
 
 (defvar ede-deep-rescan nil
   "Non nil means scan down a tree, otherwise rescans are top level only.
 Do not set this to non-nil globally.  It is used internally.")
-
-;;; The EDE persistent cache.
-;;
-(defcustom ede-project-placeholder-cache-file
-  (locate-user-emacs-file "ede-projects.el" ".projects.ede")
-  "File containing the list of projects EDE has viewed."
-  :group 'ede
-  :type 'file)
-
-(defvar ede-project-cache-files nil
-  "List of project files EDE has seen before.")
-
-(defun ede-save-cache ()
-  "Save a cache of EDE objects that Emacs has seen before."
-  (interactive)
-  (let ((p ede-projects)
-	(c ede-project-cache-files)
-	(recentf-exclude '(ignore))
-	)
-    (condition-case nil
-	(progn
-	  (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
-	  (erase-buffer)
-	  (insert ";; EDE project cache file.
-;; This contains a list of projects you have visited.\n(")
-	  (while p
-	    (when (and (car p) (ede-project-p p))
-	      (let ((f (oref (car p) file)))
-		(when (file-exists-p f)
-		  (insert "\n  \"" f "\""))))
-	    (setq p (cdr p)))
-	  (while c
-	    (insert "\n \"" (car c) "\"")
-	    (setq c (cdr c)))
-	  (insert "\n)\n")
-	  (condition-case nil
-	      (save-buffer 0)
-	    (error
-	     (message "File %s could not be saved."
-		      ede-project-placeholder-cache-file)))
-	  (kill-buffer (current-buffer))
-	  )
-      (error
-       (message "File %s could not be read."
-	       	ede-project-placeholder-cache-file))
-
-      )))
-
-(defun ede-load-cache ()
-  "Load the cache of EDE projects."
-  (save-excursion
-    (let ((cachebuffer nil))
-      (condition-case nil
-	  (progn
-	    (setq cachebuffer
-		  (find-file-noselect ede-project-placeholder-cache-file t))
-	    (set-buffer cachebuffer)
-	    (goto-char (point-min))
-	    (let ((c (read (current-buffer)))
-		  (new nil)
-		  (p ede-projects))
-	      ;; Remove loaded projects from the cache.
-	      (while p
-		(setq c (delete (oref (car p) file) c))
-		(setq p (cdr p)))
-	      ;; Remove projects that aren't on the filesystem
-	      ;; anymore.
-	      (while c
-		(when (file-exists-p (car c))
-		  (setq new (cons (car c) new)))
-		(setq c (cdr c)))
-	      ;; Save it
-	      (setq ede-project-cache-files (nreverse new))))
-	(error nil))
-      (when cachebuffer (kill-buffer cachebuffer))
-      )))
-
-;;; Important macros for doing commands.
-;;
-(defmacro ede-with-projectfile (obj &rest forms)
-  "For the project in which OBJ resides, execute FORMS."
-  (list 'save-window-excursion
-	(list 'let* (list
-		     (list 'pf
-			   (list 'if (list 'obj-of-class-p
-					   obj 'ede-target)
-				 ;; @todo -I think I can change
-				 ;; this to not need ede-load-project-file
-				 ;; but I'm not sure how to test well.
-				 (list 'ede-load-project-file
-				       (list 'oref obj 'path))
-				 obj))
-		     '(dbka (get-file-buffer (oref pf file))))
-	      '(if (not dbka) (find-file (oref pf file))
-		 (switch-to-buffer dbka))
-	      (cons 'progn forms)
-	      '(if (not dbka) (kill-buffer (current-buffer))))))
-(put 'ede-with-projectfile 'lisp-indent-function 1)
 
 
 ;;; Prompting
@@ -610,6 +206,18 @@
 	      :enable ede-object
 	      :visible global-ede-mode))
 
+(defun ede-buffer-belongs-to-target-p ()
+  "Return non-nil if this buffer belongs to at least one target."
+  (let ((obj ede-object))
+    (if (consp obj)
+	(setq obj (car obj)))
+    (and obj (obj-of-class-p obj ede-target))))
+
+(defun ede-buffer-belongs-to-project-p ()
+  "Return non-nil if this buffer belongs to at least one target."
+  (if (or (null ede-object) (consp ede-object)) nil
+    (obj-of-class-p ede-object ede-project)))
+
 (defun ede-menu-obj-of-class-p (class)
   "Return non-nil if some member of `ede-object' is a child of CLASS."
   (if (listp ede-object)
@@ -671,9 +279,7 @@
 	   (and (ede-current-project)
 		(oref (ede-current-project) targets)) ]
 	 [ "Remove File" ede-remove-file
-	   (and ede-object
-		(or (listp ede-object)
-		    (not (obj-of-class-p ede-object ede-project)))) ]
+	   (ede-buffer-belongs-to-project-p) ]
 	 "-")
        (if (not obj)
 	   nil
@@ -717,7 +323,7 @@
     (let* ((obj (ede-current-project))
 	   targ)
       (when obj
-	(setq targ (when (slot-boundp obj 'targets)
+	(setq targ (when (and obj (slot-boundp obj 'targets))
 		     (oref obj targets)))
 	;; Make custom menus for everything here.
 	(append (list
@@ -803,31 +409,49 @@
 	     (eq major-mode 'vc-dired-mode))
 	 (ede-dired-minor-mode (if ede-minor-mode 1 -1)))
 	(ede-minor-mode
-	 (if (and (not ede-constructing)
-		  (ede-directory-project-p default-directory t))
-	     (let* ((ROOT nil)
-		    (proj (ede-directory-get-open-project default-directory
-							  'ROOT)))
-	       (when (not proj)
-		 ;; @todo - this could be wasteful.
-		 (setq proj (ede-load-project-file default-directory 'ROOT)))
-	       (setq ede-object-project proj)
-	       (setq ede-object-root-project
-		     (or ROOT (ede-project-root proj)))
-	       (setq ede-object (ede-buffer-object))
-	       (if (and (not ede-object) ede-object-project)
-		   (ede-auto-add-to-target))
-	       (ede-apply-target-options))
+	 (if (not ede-constructing)
+	     (ede-initialize-state-current-buffer)
 	   ;; If we fail to have a project here, turn it back off.
 	   (ede-minor-mode -1)))))
 
+(defun ede-initialize-state-current-buffer ()
+  "Initialize the current buffer's state for EDE.
+Sets buffer local variables for EDE."
+  (let* ((ROOT nil)
+	 (proj (ede-directory-get-open-project default-directory
+					       'ROOT)))
+    (when (or proj ROOT
+	      (ede-directory-project-p default-directory t))
+
+      (when (not proj)
+	;; @todo - this could be wasteful.
+	(setq proj (ede-load-project-file default-directory 'ROOT)))
+
+      (setq ede-object (ede-buffer-object (current-buffer)
+					  'ede-object-project))
+
+      (setq ede-object-root-project
+	    (or ROOT (ede-project-root ede-object-project)))
+
+      (if (and (not ede-object) ede-object-project)
+	  (ede-auto-add-to-target))
+
+      (ede-apply-target-options))))
+
 (defun ede-reset-all-buffers (onoff)
   "Reset all the buffers due to change in EDE.
 ONOFF indicates enabling or disabling the mode."
   (let ((b (buffer-list)))
     (while b
       (when (buffer-file-name (car b))
-	(ede-buffer-object (car b))
+	(with-current-buffer (car b)
+	  ;; Reset all state variables
+	  (setq ede-object nil
+		ede-object-project nil
+		ede-object-root-project nil)
+	  ;; Now re-initialize this buffer.
+	  (ede-initialize-state-current-buffer)
+	  )
 	)
       (setq b (cdr b)))))
 
@@ -966,6 +590,7 @@
 			     r)
 			   )
 			  nil t)))
+  (require 'ede/custom)
   ;; Make sure we have a valid directory
   (when (not (file-exists-p default-directory))
     (error "Cannot create project in non-existent directory %s" default-directory))
@@ -1013,20 +638,6 @@
   "Add into PROJ-A, the subproject PROJ-B."
   (oset proj-a subproj (cons proj-b (oref proj-a subproj))))
 
-(defmethod ede-subproject-relative-path ((proj ede-project) &optional parent-in)
-  "Get a path name for PROJ which is relative to the parent project.
-If PARENT is specified, then be relative to the PARENT project.
-Specifying PARENT is useful for sub-sub projects relative to the root project."
-  (let* ((parent (or parent-in (ede-parent-project proj)))
-	 (dir (file-name-directory (oref proj file))))
-    (if (and parent (not (eq parent proj)))
-	(file-relative-name dir (file-name-directory (oref parent file)))
-      "")))
-
-(defmethod ede-subproject-p ((proj ede-project))
-  "Return non-nil if PROJ is a sub project."
-  (ede-parent-project proj))
-
 (defun ede-invoke-method (sym &rest args)
   "Invoke method SYM on the current buffer's project object.
 ARGS are additional arguments to pass to method sym."
@@ -1161,175 +772,9 @@
 (defun ede-make-dist ()
   "Create a distribution from the current project."
   (interactive)
-  (let ((ede-object (ede-current-project)))
+  (let ((ede-object (ede-toplevel)))
     (ede-invoke-method 'project-make-dist)))
 
-;;; Customization
-;;
-;; Routines for customizing projects and targets.
-
-(defvar eieio-ede-old-variables nil
-  "The old variables for a project.")
-
-(defalias 'customize-project 'ede-customize-project)
-(defun ede-customize-project (&optional group)
-  "Edit fields of the current project through EIEIO & Custom.
-Optional GROUP specifies the subgroup of slots to customize."
-  (interactive "P")
-  (require 'eieio-custom)
-  (let* ((ov (oref (ede-current-project) local-variables))
-	 (cp (ede-current-project))
-	 (group (if group (eieio-read-customization-group cp))))
-    (eieio-customize-object cp group)
-    (make-local-variable 'eieio-ede-old-variables)
-    (setq eieio-ede-old-variables ov)))
-
-(defalias 'customize-target 'ede-customize-current-target)
-(defun ede-customize-current-target(&optional group)
-  "Edit fields of the current target through EIEIO & Custom.
-Optional argument OBJ is the target object to customize.
-Optional argument GROUP is the slot group to display."
-  (interactive "P")
-  (require 'eieio-custom)
-  (if (not (obj-of-class-p ede-object ede-target))
-      (error "Current file is not part of a target"))
-  (let ((group (if group (eieio-read-customization-group ede-object))))
-    (ede-customize-target ede-object group)))
-
-(defun ede-customize-target (obj group)
-  "Edit fields of the current target through EIEIO & Custom.
-Optional argument OBJ is the target object to customize.
-Optional argument GROUP is the slot group to display."
-  (require 'eieio-custom)
-  (if (and obj (not (obj-of-class-p obj ede-target)))
-      (error "No logical target to customize"))
-  (eieio-customize-object obj (or group 'default)))
-;;; Target Sorting
-;;
-;; Target order can be important, but custom doesn't support a way
-;; to resort items in a list.  This function by David Engster allows
-;; targets to be re-arranged.
-
-(defvar ede-project-sort-targets-order nil
-  "Variable for tracking target order in `ede-project-sort-targets'.")
-
-(defun ede-project-sort-targets ()
-  "Create a custom-like buffer for sorting targets of current project."
-  (interactive)
-  (let ((proj (ede-current-project))
-        (count 1)
-        current order)
-    (switch-to-buffer (get-buffer-create "*EDE sort targets*"))
-    (erase-buffer)
-    (setq ede-object-project proj)
-    (widget-create 'push-button
-                   :notify (lambda (&rest ignore)
-                             (let ((targets (oref ede-object-project targets))
-                                   cur newtargets)
-                               (while (setq cur (pop ede-project-sort-targets-order))
-                                 (setq newtargets (append newtargets
-                                                          (list (nth cur targets)))))
-                               (oset ede-object-project targets newtargets))
-                             (ede-commit-project ede-object-project)
-                             (kill-buffer))
-                   " Accept ")
-    (widget-insert "   ")
-    (widget-create 'push-button
-                   :notify (lambda (&rest ignore)
-                               (kill-buffer))
-                   " Cancel ")
-    (widget-insert "\n\n")
-    (setq ede-project-sort-targets-order nil)
-    (mapc (lambda (x)
-            (add-to-ordered-list
-             'ede-project-sort-targets-order
-             x x))
-          (number-sequence 0 (1- (length (oref proj targets)))))
-    (ede-project-sort-targets-list)
-    (use-local-map widget-keymap)
-    (widget-setup)
-    (goto-char (point-min))))
-
-(defun ede-project-sort-targets-list ()
-  "Sort the target list while using `ede-project-sort-targets'."
-  (save-excursion
-    (let ((count 0)
-          (targets (oref ede-object-project targets))
-          (inhibit-read-only t)
-          (inhibit-modification-hooks t))
-      (goto-char (point-min))
-      (forward-line 2)
-      (delete-region (point) (point-max))
-      (while (< count (length targets))
-        (if (> count 0)
-            (widget-create 'push-button
-                           :notify `(lambda (&rest ignore)
-                                      (let ((cur ede-project-sort-targets-order))
-                                        (add-to-ordered-list
-                                         'ede-project-sort-targets-order
-                                         (nth ,count cur)
-                                         (1- ,count))
-                                        (add-to-ordered-list
-                                         'ede-project-sort-targets-order
-                                         (nth (1- ,count) cur) ,count))
-                                      (ede-project-sort-targets-list))
-                           " Up ")
-          (widget-insert "      "))
-        (if (< count (1- (length targets)))
-            (widget-create 'push-button
-                           :notify `(lambda (&rest ignore)
-                                      (let ((cur ede-project-sort-targets-order))
-                                        (add-to-ordered-list
-                                         'ede-project-sort-targets-order
-                                         (nth ,count cur) (1+ ,count))
-                                        (add-to-ordered-list
-                                         'ede-project-sort-targets-order
-                                         (nth (1+ ,count) cur) ,count))
-                                      (ede-project-sort-targets-list))
-                           " Down ")
-          (widget-insert "        "))
-        (widget-insert (concat " " (number-to-string (1+ count)) ".:   "
-                               (oref (nth (nth count ede-project-sort-targets-order)
-                                          targets) name) "\n"))
-        (setq count (1+ count))))))
-
-;;; Customization hooks
-;;
-;; These hooks are used when finishing up a customization.
-(defmethod eieio-done-customizing ((proj ede-project))
-  "Call this when a user finishes customizing PROJ."
-  (let ((ov eieio-ede-old-variables)
-	(nv (oref proj local-variables)))
-    (setq eieio-ede-old-variables nil)
-    (while ov
-      (if (not (assoc (car (car ov)) nv))
-	  (save-excursion
-	    (mapc (lambda (b)
-		    (set-buffer b)
-		    (kill-local-variable (car (car ov))))
-		  (ede-project-buffers proj))))
-      (setq ov (cdr ov)))
-    (mapc (lambda (b) (ede-set-project-variables proj b))
-	  (ede-project-buffers proj))))
-
-(defmethod eieio-done-customizing ((target ede-target))
-  "Call this when a user finishes customizing TARGET."
-  nil)
-
-(defmethod ede-commit-project ((proj ede-project))
-  "Commit any change to PROJ to its file."
-  nil
-  )
-
-
-;;; EDE project placeholder methods
-;;
-(defmethod ede-project-force-load ((this ede-project-placeholder))
-  "Make sure the placeholder THIS is replaced with the real thing.
-Return the new object created in its place."
-  this
-  )
-
 
 ;;; EDE project target baseline methods.
 ;;
@@ -1342,9 +787,9 @@
 ;;  methods based on those below.
 
 (defmethod project-interactive-select-target ((this ede-project-placeholder) prompt)
-  ; checkdoc-params: (prompt)
+					; checkdoc-params: (prompt)
   "Make sure placeholder THIS is replaced with the real thing, and pass through."
-  (project-interactive-select-target (ede-project-force-load this) prompt))
+  (project-interactive-select-target this prompt))
 
 (defmethod project-interactive-select-target ((this ede-project) prompt)
   "Interactively query for a target that exists in project THIS.
@@ -1353,9 +798,9 @@
     (cdr (assoc (completing-read prompt ob nil t) ob))))
 
 (defmethod project-add-file ((this ede-project-placeholder) file)
-  ; checkdoc-params: (file)
+					; checkdoc-params: (file)
   "Make sure placeholder THIS is replaced with the real thing, and pass through."
-  (project-add-file (ede-project-force-load this) file))
+  (project-add-file this file))
 
 (defmethod project-add-file ((ot ede-target) file)
   "Add the current buffer into project project target OT.
@@ -1412,132 +857,6 @@
 (defmethod project-rescan ((this ede-project))
   "Rescan the EDE proj project THIS."
   (error "Rescanning a project is not supported by %s" (object-name this)))
-
-;;; Default methods for EDE classes
-;;
-;; These are methods which you might want to override, but there is
-;; no need to in most situations because they are either a) simple, or
-;; b) cosmetic.
-
-(defmethod ede-name ((this ede-target))
-  "Return the name of THIS target."
-  (oref this name))
-
-(defmethod ede-target-name ((this ede-target))
-  "Return the name of THIS target, suitable for make or debug style commands."
-  (oref this name))
-
-(defmethod ede-name ((this ede-project))
-  "Return a short-name for THIS project file.
-Do this by extracting the lowest directory name."
-  (oref this name))
-
-(defmethod ede-description ((this ede-project))
-  "Return a description suitable for the minibuffer about THIS."
-  (format "Project %s: %d subprojects, %d targets."
-	  (ede-name this) (length (oref this subproj))
-	  (length (oref this targets))))
-
-(defmethod ede-description ((this ede-target))
-  "Return a description suitable for the minibuffer about THIS."
-  (format "Target %s: with %d source files."
-	  (ede-name this) (length (oref this source))))
-
-(defmethod ede-want-file-p ((this ede-target) file)
-  "Return non-nil if THIS target wants FILE."
-  ;; By default, all targets reference the source object, and let it decide.
-  (let ((src (ede-target-sourcecode this)))
-    (while (and src (not (ede-want-file-p (car src) file)))
-      (setq src (cdr src)))
-    src))
-
-(defmethod ede-want-file-source-p ((this ede-target) file)
-  "Return non-nil if THIS target wants FILE."
-  ;; By default, all targets reference the source object, and let it decide.
-  (let ((src (ede-target-sourcecode this)))
-    (while (and src (not (ede-want-file-source-p (car src) file)))
-      (setq src (cdr src)))
-    src))
-
-(defun ede-header-file ()
-  "Return the header file for the current buffer.
-Not all buffers need headers, so return nil if no applicable."
-  (if ede-object
-      (ede-buffer-header-file ede-object (current-buffer))
-    nil))
-
-(defmethod ede-buffer-header-file ((this ede-project) buffer)
-  "Return nil, projects don't have header files."
-  nil)
-
-(defmethod ede-buffer-header-file ((this ede-target) buffer)
-  "There are no default header files in EDE.
-Do a quick check to see if there is a Header tag in this buffer."
-  (with-current-buffer buffer
-    (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t)
-	(buffer-substring-no-properties (match-beginning 1)
-					(match-end 1))
-      (let ((src (ede-target-sourcecode this))
-	    (found nil))
-	(while (and src (not found))
-	  (setq found (ede-buffer-header-file (car src) (buffer-file-name))
-		src (cdr src)))
-	found))))
-
-(defun ede-documentation-files ()
-  "Return the documentation files for the current buffer.
-Not all buffers need documentations, so return nil if no applicable.
-Some projects may have multiple documentation files, so return a list."
-  (if ede-object
-      (ede-buffer-documentation-files ede-object (current-buffer))
-    nil))
-
-(defmethod ede-buffer-documentation-files ((this ede-project) buffer)
-  "Return all documentation in project THIS based on BUFFER."
-  ;; Find the info node.
-  (ede-documentation this))
-
-(defmethod ede-buffer-documentation-files ((this ede-target) buffer)
-  "Check for some documentation files for THIS.
-Also do a quick check to see if there is a Documentation tag in this BUFFER."
-  (with-current-buffer buffer
-    (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t)
-	(buffer-substring-no-properties (match-beginning 1)
-					(match-end 1))
-      ;; Check the master project
-      (let ((cp (ede-toplevel)))
-	(ede-buffer-documentation-files cp (current-buffer))))))
-
-(defmethod ede-documentation ((this ede-project))
-  "Return a list of files that provide documentation.
-Documentation is not for object THIS, but is provided by THIS for other
-files in the project."
-  (let ((targ (oref this targets))
-	(proj (oref this subproj))
-	(found nil))
-    (while targ
-      (setq found (append (ede-documentation (car targ)) found)
-	    targ (cdr targ)))
-    (while proj
-      (setq found (append (ede-documentation (car proj)) found)
-	    proj (cdr proj)))
-    found))
-
-(defmethod ede-documentation ((this ede-target))
-  "Return a list of files that provide documentation.
-Documentation is not for object THIS, but is provided by THIS for other
-files in the project."
-  nil)
-
-(defun ede-html-documentation-files ()
-  "Return a list of HTML documentation files associated with this project."
-  (ede-html-documentation (ede-toplevel))
-  )
-
-(defmethod ede-html-documentation ((this ede-project))
-  "Return a list of HTML files provided by project THIS."
-
-  )
 
 (defun ede-ecb-project-paths ()
   "Return a list of all paths for all active EDE projects.
@@ -1549,24 +868,8 @@
 		    d)
 	    p (cdr p)))
     d))
-
-;;; EDE project-autoload methods
-;;
-(defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir)
-  "Return a full file name of project THIS found in DIR.
-Return nil if the project file does not exist."
-  (let* ((d (file-name-as-directory dir))
-	 (root (ede-project-root-directory this d))
-	 (pf (oref this proj-file))
-	 (f (cond ((stringp pf)
-		   (expand-file-name pf (or root d)))
-		  ((and (symbolp pf) (fboundp pf))
-		   (funcall pf (or root d)))))
-	 )
-    (when (and f (file-exists-p f))
-      f)))
 
-;;; EDE basic functions
+;;; PROJECT LOADING/TRACKING
 ;;
 (defun ede-add-project-to-global-list (proj)
   "Add the project PROJ to the master list of projects.
@@ -1602,7 +905,7 @@
 	(if p (ede-load-project-file p)
 	  nil)
 	;; recomment as we go
-	;nil
+	;;nil
 	))
      ;; Do nothing if we are buiding an EDE project already
      (ede-constructing
@@ -1611,7 +914,7 @@
      (t
       (setq toppath (ede-toplevel-project path))
       ;; We found the top-most directory.  Check to see if we already
-      ;; have an object defining it's project.
+      ;; have an object defining its project.
       (setq pfc (ede-directory-project-p toppath t))
 
       ;; See if it's been loaded before
@@ -1619,7 +922,7 @@
 			    ede-projects))
       (if (not o)
 	  ;; If not, get it now.
-	  (let ((ede-constructing t))
+	  (let ((ede-constructing pfc))
 	    (setq o (funcall (oref pfc load-type) toppath))
 	    (when (not o)
 	      (error "Project type error: :load-type failed to create a project"))
@@ -1648,9 +951,14 @@
 		(delete (oref found file) ede-project-cache-files)))
 	found)))))
 
+;;; PROJECT ASSOCIATIONS
+;;
+;; Moving between relative projects.  Associating between buffers and
+;; projects.
+
 (defun ede-parent-project (&optional obj)
   "Return the project belonging to the parent directory.
-Returns nil if there is no previous directory.
+Return nil if there is no previous directory.
 Optional argument OBJ is an object to find the parent of."
   (let* ((proj (or obj ede-object-project)) ;; Current project.
 	 (root (if obj (ede-project-root obj)
@@ -1700,17 +1008,38 @@
     ;; Return what we found.
     ans))
 
-(defun ede-buffer-object (&optional buffer)
+(defun ede-buffer-object (&optional buffer projsym)
   "Return the target object for BUFFER.
-This function clears cached values and recalculates."
+This function clears cached values and recalculates.
+Optional PROJSYM is a symbol, which will be set to the project
+that contains the target that becomes buffer's object."
   (save-excursion
     (if (not buffer) (setq buffer (current-buffer)))
     (set-buffer buffer)
     (setq ede-object nil)
-    (let ((po (ede-current-project)))
-      (if po (setq ede-object (ede-find-target po buffer))))
-    (if (= (length ede-object) 1)
-	(setq ede-object (car ede-object)))
+    (let* ((localpo (ede-current-project))
+	   (po localpo)
+	   (top (ede-toplevel po)))
+      (if po (setq ede-object (ede-find-target po buffer)))
+      ;; If we get nothing, go with the backup plan of slowly
+      ;; looping upward
+      (while (and (not ede-object) (not (eq po top)))
+	(setq po (ede-parent-project po))
+	(if po (setq ede-object (ede-find-target po buffer))))
+      ;; Filter down to 1 project if there are dups.
+      (if (= (length ede-object) 1)
+	  (setq ede-object (car ede-object)))
+      ;; Track the project, if needed.
+      (when (and projsym (symbolp projsym))
+	(if ede-object
+	    ;; If we found a target, then PO is the
+	    ;; project to use.
+	    (set projsym po)
+	  ;; If there is no ede-object, then the projsym
+	  ;; is whichever part of the project is most local.
+	  (set projsym localpo))
+	))
+    ;; Return our findings.
     ede-object))
 
 (defmethod ede-target-in-project-p ((proj ede-project) target)
@@ -1737,14 +1066,6 @@
 	    projs (cdr projs)))
     ans))
 
-(defun ede-maybe-checkout (&optional buffer)
-  "Check BUFFER out of VC if necessary."
-  (save-excursion
-    (if buffer (set-buffer buffer))
-    (if (and buffer-read-only vc-mode
-	     (y-or-n-p "Checkout Makefile.am from VC? "))
-	(vc-toggle-read-only))))
-
 (defmethod ede-find-target ((proj ede-project) buffer)
   "Fetch the target in PROJ belonging to BUFFER or nil."
   (with-current-buffer buffer
@@ -1785,7 +1106,7 @@
 	(pl nil))
     (while bl
       (with-current-buffer (car bl)
-	(if (and ede-object (eq (ede-current-project) project))
+	(if (ede-buffer-belongs-to-project-p)
 	    (setq pl (cons (car bl) pl))))
       (setq bl (cdr bl)))
     pl))
@@ -1856,6 +1177,16 @@
 Return the first non-nil value returned by PROC."
   (eval (cons 'or (ede-map-targets this proc))))
 
+;;; VC Handling
+;;
+(defun ede-maybe-checkout (&optional buffer)
+  "Check BUFFER out of VC if necessary."
+  (save-excursion
+    (if buffer (set-buffer buffer))
+    (if (and buffer-read-only vc-mode
+	     (y-or-n-p "Checkout Makefile.am from VC? "))
+	(vc-toggle-read-only))))
+
 
 ;;; Some language specific methods.
 ;;
@@ -1912,7 +1243,7 @@
   (with-current-buffer buffer
     (dolist (v (oref project local-variables))
       (make-local-variable (car v))
-      ;; set it's value here?
+      ;; set its value here?
       (set (car v) (cdr v)))))
 
 (defun ede-set (variable value &optional proj)
@@ -1935,60 +1266,6 @@
   "Commit change to local variables in PROJ."
   nil)
 
-
-;;; Accessors for more complex types where oref is inappropriate.
-;;
-(defmethod ede-target-sourcecode ((this ede-target))
-  "Return the sourcecode objects which THIS permits."
-  (let ((sc (oref this sourcetype))
-	(rs nil))
-    (while (and (listp sc) sc)
-      (setq rs (cons (symbol-value (car sc)) rs)
-	    sc (cdr sc)))
-    rs))
-
-
-;;; Debugging.
-
-(defun ede-adebug-project ()
-  "Run adebug against the current EDE project.
-Display the results as a debug list."
-  (interactive)
-  (require 'data-debug)
-  (when (ede-current-project)
-    (data-debug-new-buffer "*Analyzer ADEBUG*")
-    (data-debug-insert-object-slots (ede-current-project) "")
-    ))
-
-(defun ede-adebug-project-parent ()
-  "Run adebug against the current EDE parent project.
-Display the results as a debug list."
-  (interactive)
-  (require 'data-debug)
-  (when (ede-parent-project)
-    (data-debug-new-buffer "*Analyzer ADEBUG*")
-    (data-debug-insert-object-slots (ede-parent-project) "")
-    ))
-
-(defun ede-adebug-project-root ()
-  "Run adebug against the current EDE parent project.
-Display the results as a debug list."
-  (interactive)
-  (require 'data-debug)
-  (when (ede-toplevel)
-    (data-debug-new-buffer "*Analyzer ADEBUG*")
-    (data-debug-insert-object-slots (ede-toplevel) "")
-    ))
-
-;;; Hooks & Autoloads
-;;
-;;  These let us watch various activities, and respond appropriately.
-
-;; (add-hook 'edebug-setup-hook
-;; 	  (lambda ()
-;; 	    (def-edebug-spec ede-with-projectfile
-;; 	      (form def-body))))
-
 (provide 'ede)
 
 ;; Include this last because it depends on ede.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cedet/ede/auto.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,128 @@
+;;; ede/auto.el --- Autoload features for EDE
+
+;; Copyright (C) 2010  Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; EDE Autoloads are a way to refer to different project types without
+;; loading those projects into Emacs.
+;;
+;; These routines are used to detect a project in a filesystem before
+;; handing over control to the usual EDE project system.
+
+;;; Code:
+
+(require 'eieio)
+
+(defclass ede-project-autoload ()
+  ((name :initarg :name
+	 :documentation "Name of this project type")
+   (file :initarg :file
+	 :documentation "The lisp file belonging to this class.")
+   (proj-file :initarg :proj-file
+	      :documentation "Name of a project file of this type.")
+   (proj-root :initarg :proj-root
+	      :type function
+	      :documentation "A function symbol to call for the project root.
+This function takes no arguments, and returns the current directories
+root, if available.  Leave blank to use the EDE directory walking
+routine instead.")
+   (initializers :initarg :initializers
+		 :initform nil
+		 :documentation
+		 "Initializers passed to the project object.
+These are used so there can be multiple types of projects
+associated with a single object class, based on the initilizeres used.")
+   (load-type :initarg :load-type
+	      :documentation "Fn symbol used to load this project file.")
+   (class-sym :initarg :class-sym
+	      :documentation "Symbol representing the project class to use.")
+   (new-p :initarg :new-p
+	  :initform t
+	  :documentation
+	  "Non-nil if this is an option when a user creates a project.")
+   )
+  "Class representing minimal knowledge set to run preliminary EDE functions.
+When more advanced functionality is needed from a project type, that projects
+type is required and the load function used.")
+
+(defvar ede-project-class-files
+  (list
+   (ede-project-autoload "edeproject-makefile"
+			 :name "Make" :file 'ede/proj
+			 :proj-file "Project.ede"
+			 :load-type 'ede-proj-load
+			 :class-sym 'ede-proj-project)
+   (ede-project-autoload "edeproject-automake"
+			 :name "Automake" :file 'ede/proj
+			 :proj-file "Project.ede"
+			 :initializers '(:makefile-type Makefile.am)
+			 :load-type 'ede-proj-load
+			 :class-sym 'ede-proj-project)
+   (ede-project-autoload "automake"
+			 :name "automake" :file 'ede/project-am
+			 :proj-file "Makefile.am"
+			 :load-type 'project-am-load
+			 :class-sym 'project-am-makefile
+			 :new-p nil))
+  "List of vectors defining how to determine what type of projects exist.")
+
+;;; EDE project-autoload methods
+;;
+(defmethod ede-project-root ((this ede-project-autoload))
+  "If a project knows its root, return it here.
+Allows for one-project-object-for-a-tree type systems."
+  nil)
+
+(defmethod ede-project-root-directory ((this ede-project-autoload)
+				       &optional file)
+  "If a project knows its root, return it here.
+Allows for one-project-object-for-a-tree type systems.
+Optional FILE is the file to test.  If there is no FILE, use
+the current buffer."
+  (when (not file)
+    (setq file default-directory))
+  (when (slot-boundp this :proj-root)
+    (let ((rootfcn (oref this proj-root)))
+      (when rootfcn
+	(condition-case nil
+	    (funcall rootfcn file)
+	  (error
+	   (funcall rootfcn)))
+	))))
+
+(defmethod ede-dir-to-projectfile ((this ede-project-autoload) dir)
+  "Return a full file name of project THIS found in DIR.
+Return nil if the project file does not exist."
+  (let* ((d (file-name-as-directory dir))
+	 (root (ede-project-root-directory this d))
+	 (pf (oref this proj-file))
+	 (f (cond ((stringp pf)
+		   (expand-file-name pf (or root d)))
+		  ((and (symbolp pf) (fboundp pf))
+		   (funcall pf (or root d)))))
+	 )
+    (when (and f (file-exists-p f))
+      f)))
+
+
+(provide 'ede/auto)
+
+;;; ede/auto.el ends here
--- a/lisp/cedet/ede/autoconf-edit.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/autoconf-edit.el	Wed Oct 13 22:40:51 2010 +0900
@@ -27,20 +27,8 @@
 
 ;;; Code:
 (require 'autoconf)
-
-(defvar autoconf-new-automake-string
-  "dnl Process this file with autoconf to produce a configure script
-
-AC_INIT(%s)
-AM_INIT_AUTOMAKE([%s], 0)
-AM_CONFIG_HEADER(config.h)
-
-dnl End the configure script.
-AC_OUTPUT(Makefile, [date > stamp-h] )\n"
-  "This string is used to initialize a new configure.in.
-The default is designed to be used with automake.
-The first %s will be filled with the test file.
-The second %s will be filled with the program name.")
+(declare-function ede-srecode-setup "ede/srecode")
+(declare-function ede-srecode-insert "ede/srecode")
 
 (defun autoconf-new-program (rootdir program testfile)
   "Initialize a new configure.in in ROOTDIR for PROGRAM using TESTFILE.
@@ -49,6 +37,7 @@
 TESTFILE is the file used with AC_INIT.
 configure the initial configure script using `autoconf-new-automake-string'"
   (interactive "DRoot Dir: \nsProgram: \nsTest File: ")
+  (require 'ede/srecode)
   (if (bufferp rootdir)
       (set-buffer rootdir)
     (let ((cf1 (expand-file-name "configure.in" rootdir))
@@ -62,7 +51,12 @@
       (find-file cf2)))
   ;; Note, we only ask about overwrite if a string/path is specified.
   (erase-buffer)
-  (insert (format autoconf-new-automake-string testfile program)))
+  (ede-srecode-setup)
+  (ede-srecode-insert
+   "file:ede-empty"
+   "TEST_FILE" testfile
+   "PROGRAM" program)
+  )
 
 (defvar autoconf-preferred-macro-order
   '("AC_INIT"
@@ -151,42 +145,44 @@
     (beginning-of-line)
     (looking-at (concat "\\(A[CM]_" macro "\\|" macro "\\)"))))
 
-(defun autoconf-find-last-macro (macro)
+(defun autoconf-find-last-macro (macro &optional ignore-bol)
   "Move to the last occurrence of MACRO in FILE, and return that point.
 The last macro is usually the one in which we would like to insert more
 items such as CHECK_HEADERS."
-  (let ((op (point)))
+  (let ((op (point)) (atbol (if ignore-bol "" "^")))
     (goto-char (point-max))
-    (if (re-search-backward (concat "^" (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t)
+    (if (re-search-backward (concat atbol (regexp-quote macro) "\\s-*\\((\\|$\\)") nil t)
 	(progn
-	  (beginning-of-line)
+	  (unless ignore-bol (beginning-of-line))
 	  (point))
       (goto-char op)
       nil)))
 
 (defun autoconf-parameter-strip (param)
   "Strip the parameter PARAM  of whitespace and miscellaneous characters."
-  (when (string-match "^\\s-*\\[?\\s-*" param)
+  ;; force greedy match for \n.
+  (when (string-match "\\`\n*\\s-*\\[?\\s-*" param)
     (setq param (substring param (match-end 0))))
-  (when (string-match "\\s-*\\]?\\s-*$" param)
+  (when (string-match "\\s-*\\]?\\s-*\\'" param)
     (setq param (substring param 0  (match-beginning 0))))
   param)
 
-(defun autoconf-parameters-for-macro (macro)
+(defun autoconf-parameters-for-macro (macro &optional ignore-bol ignore-case)
   "Retrieve the parameters to MACRO.
 Returns a list of the arguments passed into MACRO as strings."
-  (save-excursion
-    (when (autoconf-find-last-macro macro)
-      (forward-sexp 1)
-      (mapcar
-       #'autoconf-parameter-strip
-       (when (looking-at "(")
-	 (let* ((start (+ (point) 1))
-		(end (save-excursion
-		       (forward-sexp 1)
-		       (- (point) 1)))
-		(ans (buffer-substring-no-properties start end)))
-	   (split-string ans "," t)))))))
+  (let ((case-fold-search ignore-case))
+    (save-excursion
+      (when (autoconf-find-last-macro macro ignore-bol)
+	(forward-sexp 1)
+	(mapcar
+	 #'autoconf-parameter-strip
+	 (when (looking-at "(")
+	   (let* ((start (+ (point) 1))
+		  (end (save-excursion
+			 (forward-sexp 1)
+			 (- (point) 1)))
+		  (ans (buffer-substring-no-properties start end)))
+	     (split-string ans "," t))))))))
 
 (defun autoconf-position-for-macro (macro)
   "Position the cursor where a new MACRO could be inserted.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cedet/ede/base.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,636 @@
+;;; ede/base.el --- Baseclasses for EDE.
+
+;; Copyright (C) 2010  Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Baseclasses for EDE.
+;;
+;; Contains all the base structures needed by EDE.
+
+;;; Code:
+(require 'eieio)
+(require 'eieio-speedbar)
+(require 'ede/auto)
+
+;; Defined in ede.el:
+(defvar ede-projects)
+(defvar ede-object)
+(defvar ede-object-root-project)
+
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-object-slots "eieio-datadebug")
+(declare-function ede-parent-project "ede" (&optional obj))
+(declare-function ede-current-project "ede" (&optional dir))
+
+;;; TARGET
+;;
+;; The TARGET is an entity in a project that knows about files
+;; and features of those files.
+
+(defclass ede-target (eieio-speedbar-directory-button)
+  ((buttonface :initform speedbar-file-face) ;override for superclass
+   (name :initarg :name
+	 :type string
+	 :custom string
+	 :label "Name"
+	 :group (default name)
+	 :documentation "Name of this target.")
+   ;; @todo - I think this should be "dir", and not "path".
+   (path :initarg :path
+	 :type string
+	 ;:custom string
+	 ;:label "Path to target"
+	 ;:group (default name)
+	 :documentation "The path to the sources of this target.
+Relative to the path of the project it belongs to.")
+   (source :initarg :source
+	   :initform nil
+	   ;; I'd prefer a list of strings.
+	   :type list
+	   :custom (repeat (string :tag "File"))
+	   :label "Source Files"
+	   :group (default source)
+	   :documentation "Source files in this target.")
+   (versionsource :initarg :versionsource
+		  :initform nil
+		  :type list
+		  :custom (repeat (string :tag "File"))
+		  :label "Source Files with Version String"
+		  :group (source)
+		  :documentation
+		  "Source files with a version string in them.
+These files are checked for a version string whenever the EDE version
+of the master project is changed.  When strings are found, the version
+previously there is updated.")
+   ;; Class level slots
+   ;;
+   (sourcetype :allocation :class
+	       :type list ;; list of symbols
+	       :documentation
+	       "A list of `ede-sourcecode' objects this class will handle.
+This is used to match target objects with the compilers they can use, and
+which files this object is interested in."
+	       :accessor ede-object-sourcecode)
+   (keybindings :allocation :class
+		:initform (("D" . ede-debug-target))
+		:documentation
+"Keybindings specialized to this type of target."
+		:accessor ede-object-keybindings)
+   (menu :allocation :class
+	 :initform ( [ "Debug target" ede-debug-target
+		       (ede-buffer-belongs-to-target-p) ]
+		     [ "Run target" ede-run-target
+		       (ede-buffer-belongs-to-target-p) ]
+		     )
+	 :documentation "Menu specialized to this type of target."
+	 :accessor ede-object-menu)
+   )
+  "A target is a structure that describes a file set that produces something.
+Targets, as with 'Make', is an entity that will manage a file set
+and knows how to compile or otherwise transform those files into some
+other desired outcome.")
+
+;;; PROJECT/PLACEHOLDER
+;;
+;; Project placeholders are minimum parts of a project used
+;; by the project cache.  The project cache can refer to these placeholders,
+;; and swap them out with the real-deal when that project is loaded.
+;;
+(defclass ede-project-placeholder (eieio-speedbar-directory-button)
+  ((name :initarg :name
+	 :initform "Untitled"
+	 :type string
+	 :custom string
+	 :label "Name"
+	 :group (default name)
+	 :documentation "The name used when generating distribution files.")
+   (version :initarg :version
+	    :initform "1.0"
+	    :type string
+	    :custom string
+	    :label "Version"
+	    :group (default name)
+	    :documentation "The version number used when distributing files.")
+   (directory :type string
+	      :initarg :directory
+	      :documentation "Directory this project is associated with.")
+   (dirinode :documentation "The inode id for :directory.")
+   (file :type string
+	 :initarg :file
+	 :documentation "File name where this project is stored.")
+   (rootproject ; :initarg - no initarg, don't save this slot!
+    :initform nil
+    :type (or null ede-project-placeholder-child)
+    :documentation "Pointer to our root project.")
+   )
+  "Placeholder object for projects not loaded into memory.
+Projects placeholders will be stored in a user specific location
+and querying them will cause the actual project to get loaded.")
+
+;;; PROJECT
+;;
+;; An EDE project controls a set of TARGETS, and can also contain
+;; multiple SUBPROJECTS.
+;;
+;; The project defines a set of features that need to be built from
+;; files, in addition as to controlling what to do with the file set,
+;; such as creating distributions, compilation, and web sites.
+;;
+;; Projects can also affect how EDE works, by changing what appears in
+;; the EDE menu, or how some keys are bound.
+;;
+(defclass ede-project (ede-project-placeholder)
+  ((subproj :initform nil
+	    :type list
+	    :documentation "Sub projects controlled by this project.
+For Automake based projects, each directory is treated as a project.")
+   (targets :initarg :targets
+	    :type list
+	    :custom (repeat (object :objectcreatefcn ede-new-target-custom))
+	    :label "Local Targets"
+	    :group (targets)
+	    :documentation "List of top level targets in this project.")
+   (locate-obj :type (or null ede-locate-base-child)
+	       :documentation
+	       "A locate object to use as a backup to `ede-expand-filename'.")
+   (tool-cache :initarg :tool-cache
+	       :type list
+	       :custom (repeat object)
+	       :label "Tool: "
+	       :group tools
+	       :documentation "List of tool cache configurations in this project.
+This allows any tool to create, manage, and persist project-specific settings.")
+   (mailinglist :initarg :mailinglist
+		:initform ""
+		:type string
+		:custom string
+		:label "Mailing List Address"
+		:group name
+		:documentation
+		"An email address where users might send email for help.")
+   (web-site-url :initarg :web-site-url
+		 :initform ""
+		 :type string
+		 :custom string
+		 :label "Web Site URL"
+		 :group name
+		 :documentation "URL to this projects web site.
+This is a URL to be sent to a web site for documentation.")
+   (web-site-directory :initarg :web-site-directory
+		       :initform ""
+		       :custom string
+		       :label "Web Page Directory"
+		       :group name
+		       :documentation
+		       "A directory where web pages can be found by Emacs.
+For remote locations use a path compatible with ange-ftp or EFS.
+You can also use TRAMP for use with rcp & scp.")
+   (web-site-file :initarg :web-site-file
+		  :initform ""
+		  :custom string
+		  :label "Web Page File"
+		  :group name
+		  :documentation
+		  "A file which contains the home page for this project.
+This file can be relative to slot `web-site-directory'.
+This can be a local file, use ange-ftp, EFS, or TRAMP.")
+   (ftp-site :initarg :ftp-site
+	     :initform ""
+	     :type string
+	     :custom string
+	     :label "FTP site"
+	     :group name
+	     :documentation
+	     "FTP site where this project's distribution can be found.
+This FTP site should be in Emacs form, as needed by `ange-ftp', but can
+also be of a form used by TRAMP for use with scp, or rcp.")
+   (ftp-upload-site :initarg :ftp-upload-site
+		    :initform ""
+		    :type string
+		    :custom string
+		    :label "FTP Upload site"
+		    :group name
+		    :documentation
+		    "FTP Site to upload new distributions to.
+This FTP site should be in Emacs form as needed by `ange-ftp'.
+If this slot is nil, then use `ftp-site' instead.")
+   (configurations :initarg :configurations
+		   :initform ("debug" "release")
+		   :type list
+		   :custom (repeat string)
+		   :label "Configuration Options"
+		   :group (settings)
+		   :documentation "List of available configuration types.
+Individual target/project types can form associations between a configuration,
+and target specific elements such as build variables.")
+   (configuration-default :initarg :configuration-default
+			  :initform "debug"
+			  :custom string
+			  :label "Current Configuration"
+			  :group (settings)
+			  :documentation "The default configuration.")
+   (local-variables :initarg :local-variables
+		    :initform nil
+		    :custom (repeat (cons (sexp :tag "Variable")
+					  (sexp :tag "Value")))
+		    :label "Project Local Variables"
+		    :group (settings)
+		    :documentation "Project local variables")
+   (keybindings :allocation :class
+		:initform (("D" . ede-debug-target)
+			   ("R" . ede-run-target))
+		:documentation "Keybindings specialized to this type of target."
+		:accessor ede-object-keybindings)
+   (menu :allocation :class
+	 :initform
+	 (
+	  [ "Update Version" ede-update-version ede-object ]
+	  [ "Version Control Status" ede-vc-project-directory ede-object ]
+	  [ "Edit Project Homepage" ede-edit-web-page
+	    (and ede-object (oref (ede-toplevel) web-site-file)) ]
+	  [ "Browse Project URL" ede-web-browse-home
+	    (and ede-object
+		 (not (string= "" (oref (ede-toplevel) web-site-url)))) ]
+	  "--"
+	  [ "Rescan Project Files" ede-rescan-toplevel t ]
+	  [ "Edit Projectfile" ede-edit-file-target
+	    (ede-buffer-belongs-to-project-p) ]
+	  )
+	 :documentation "Menu specialized to this type of target."
+	 :accessor ede-object-menu)
+   )
+  "Top level EDE project specification.
+All specific project types must derive from this project."
+  :method-invocation-order :depth-first)
+
+;;; Important macros for doing commands.
+;;
+(defmacro ede-with-projectfile (obj &rest forms)
+  "For the project in which OBJ resides, execute FORMS."
+  (list 'save-window-excursion
+	(list 'let* (list
+		     (list 'pf
+			   (list 'if (list 'obj-of-class-p
+					   obj 'ede-target)
+				 ;; @todo -I think I can change
+				 ;; this to not need ede-load-project-file
+				 ;; but I'm not sure how to test well.
+				 (list 'ede-load-project-file
+				       (list 'oref obj 'path))
+				 obj))
+		     '(dbka (get-file-buffer (oref pf file))))
+	      '(if (not dbka) (find-file (oref pf file))
+		 (switch-to-buffer dbka))
+	      (cons 'progn forms)
+	      '(if (not dbka) (kill-buffer (current-buffer))))))
+(put 'ede-with-projectfile 'lisp-indent-function 1)
+
+;;; The EDE persistent cache.
+;;
+;; The cache is a way to mark where all known projects live without
+;; loading those projects into memory, or scanning for them each time
+;; emacs starts.
+;;
+(defcustom ede-project-placeholder-cache-file
+  (locate-user-emacs-file "ede-projects.el" ".projects.ede")
+  "File containing the list of projects EDE has viewed."
+  :group 'ede
+  :type 'file)
+
+(defvar ede-project-cache-files nil
+  "List of project files EDE has seen before.")
+
+(defun ede-save-cache ()
+  "Save a cache of EDE objects that Emacs has seen before."
+  (interactive)
+  (let ((p ede-projects)
+	(c ede-project-cache-files)
+	(recentf-exclude '( (lambda (f) t) ))
+	)
+    (condition-case nil
+	(progn
+	  (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
+	  (erase-buffer)
+	  (insert ";; EDE project cache file.
+;; This contains a list of projects you have visited.\n(")
+	  (while p
+	    (when (and (car p) (ede-project-p p))
+	      (let ((f (oref (car p) file)))
+		(when (file-exists-p f)
+		  (insert "\n  \"" f "\""))))
+	    (setq p (cdr p)))
+	  (while c
+	    (insert "\n \"" (car c) "\"")
+	    (setq c (cdr c)))
+	  (insert "\n)\n")
+	  (condition-case nil
+	      (save-buffer 0)
+	    (error
+	     (message "File %s could not be saved."
+		      ede-project-placeholder-cache-file)))
+	  (kill-buffer (current-buffer))
+	  )
+      (error
+       (message "File %s could not be read."
+	       	ede-project-placeholder-cache-file))
+
+      )))
+
+(defun ede-load-cache ()
+  "Load the cache of EDE projects."
+  (save-excursion
+    (let ((cachebuffer nil))
+      (condition-case nil
+	  (progn
+	    (setq cachebuffer
+		  (find-file-noselect ede-project-placeholder-cache-file t))
+	    (set-buffer cachebuffer)
+	    (goto-char (point-min))
+	    (let ((c (read (current-buffer)))
+		  (new nil)
+		  (p ede-projects))
+	      ;; Remove loaded projects from the cache.
+	      (while p
+		(setq c (delete (oref (car p) file) c))
+		(setq p (cdr p)))
+	      ;; Remove projects that aren't on the filesystem
+	      ;; anymore.
+	      (while c
+		(when (file-exists-p (car c))
+		  (setq new (cons (car c) new)))
+		(setq c (cdr c)))
+	      ;; Save it
+	      (setq ede-project-cache-files (nreverse new))))
+	(error nil))
+      (when cachebuffer (kill-buffer cachebuffer))
+      )))
+
+;;; Get the cache usable.
+
+;; @TODO - Remove this cache setup, or use this for something helpful.
+;;(add-hook 'kill-emacs-hook 'ede-save-cache)
+;;(when (not noninteractive)
+;;  ;; No need to load the EDE cache if we aren't interactive.
+;;  ;; This occurs during batch byte-compiling of other tools.
+;;  (ede-load-cache))
+
+
+;;; METHODS
+;;
+;; The methods in ede-base handle project related behavior, and DO NOT
+;; related to EDE mode commands directory, such as keybindings.
+;;
+;; Mode related methods are in ede.el.  These methods are related
+;; project specific activities not directly tied to a keybinding.
+(defmethod ede-subproject-relative-path ((proj ede-project) &optional parent-in)
+  "Get a path name for PROJ which is relative to the parent project.
+If PARENT is specified, then be relative to the PARENT project.
+Specifying PARENT is useful for sub-sub projects relative to the root project."
+  (let* ((parent (or parent-in (ede-parent-project proj)))
+	 (dir (file-name-directory (oref proj file))))
+    (if (and parent (not (eq parent proj)))
+	(file-relative-name dir (file-name-directory (oref parent file)))
+      "")))
+
+(defmethod ede-subproject-p ((proj ede-project))
+  "Return non-nil if PROJ is a sub project."
+  ;; @TODO - Use this in more places, and also pay attention to
+  ;; metasubproject in ede-proj.el
+  (ede-parent-project proj))
+
+
+;;; Default descriptive methods for EDE classes
+;;
+;; These are methods which you might want to override, but there is
+;; no need to in most situations because they are either a) simple, or
+;; b) cosmetic.
+
+(defmethod ede-name ((this ede-target))
+  "Return the name of THIS target."
+  (oref this name))
+
+(defmethod ede-target-name ((this ede-target))
+  "Return the name of THIS target, suitable for make or debug style commands."
+  (oref this name))
+
+(defmethod ede-name ((this ede-project))
+  "Return a short-name for THIS project file.
+Do this by extracting the lowest directory name."
+  (oref this name))
+
+(defmethod ede-description ((this ede-project))
+  "Return a description suitable for the minibuffer about THIS."
+  (format "Project %s: %d subprojects, %d targets."
+	  (ede-name this) (length (oref this subproj))
+	  (length (oref this targets))))
+
+(defmethod ede-description ((this ede-target))
+  "Return a description suitable for the minibuffer about THIS."
+  (format "Target %s: with %d source files."
+	  (ede-name this) (length (oref this source))))
+
+;;; HEADERS/DOC
+;;
+;; Targets and projects are often associated with other files, such as
+;; header files, documentation files and the like.  Have strong
+;; associations can make useful user commands to quickly navigate
+;; between the files based on their associations.
+;;
+(defun ede-header-file ()
+  "Return the header file for the current buffer.
+Not all buffers need headers, so return nil if no applicable."
+  (if ede-object
+      (ede-buffer-header-file ede-object (current-buffer))
+    nil))
+
+(defmethod ede-buffer-header-file ((this ede-project) buffer)
+  "Return nil, projects don't have header files."
+  nil)
+
+(defmethod ede-buffer-header-file ((this ede-target) buffer)
+  "There are no default header files in EDE.
+Do a quick check to see if there is a Header tag in this buffer."
+  (with-current-buffer buffer
+    (if (re-search-forward "::Header:: \\([a-zA-Z0-9.]+\\)" nil t)
+	(buffer-substring-no-properties (match-beginning 1)
+					(match-end 1))
+      (let ((src (ede-target-sourcecode this))
+	    (found nil))
+	(while (and src (not found))
+	  (setq found (ede-buffer-header-file (car src) (buffer-file-name))
+		src (cdr src)))
+	found))))
+
+(defun ede-documentation-files ()
+  "Return the documentation files for the current buffer.
+Not all buffers need documentations, so return nil if no applicable.
+Some projects may have multiple documentation files, so return a list."
+  (if ede-object
+      (ede-buffer-documentation-files ede-object (current-buffer))
+    nil))
+
+(defmethod ede-buffer-documentation-files ((this ede-project) buffer)
+  "Return all documentation in project THIS based on BUFFER."
+  ;; Find the info node.
+  (ede-documentation this))
+
+(defmethod ede-buffer-documentation-files ((this ede-target) buffer)
+  "Check for some documentation files for THIS.
+Also do a quick check to see if there is a Documentation tag in this BUFFER."
+  (with-current-buffer buffer
+    (if (re-search-forward "::Documentation:: \\([a-zA-Z0-9.]+\\)" nil t)
+	(buffer-substring-no-properties (match-beginning 1)
+					(match-end 1))
+      ;; Check the master project
+      (let ((cp (ede-toplevel)))
+	(ede-buffer-documentation-files cp (current-buffer))))))
+
+(defmethod ede-documentation ((this ede-project))
+  "Return a list of files that provide documentation.
+Documentation is not for object THIS, but is provided by THIS for other
+files in the project."
+  (let ((targ (oref this targets))
+	(proj (oref this subproj))
+	(found nil))
+    (while targ
+      (setq found (append (ede-documentation (car targ)) found)
+	    targ (cdr targ)))
+    (while proj
+      (setq found (append (ede-documentation (car proj)) found)
+	    proj (cdr proj)))
+    found))
+
+(defmethod ede-documentation ((this ede-target))
+  "Return a list of files that provide documentation.
+Documentation is not for object THIS, but is provided by THIS for other
+files in the project."
+  nil)
+
+(defun ede-html-documentation-files ()
+  "Return a list of HTML documentation files associated with this project."
+  (ede-html-documentation (ede-toplevel))
+  )
+
+(defmethod ede-html-documentation ((this ede-project))
+  "Return a list of HTML files provided by project THIS."
+
+  )
+
+;;; Default "WANT" methods.
+;;
+;; These methods are used to determine if a target "wants", or could
+;; somehow handle a file, or some source type.
+;;
+(defmethod ede-want-file-p ((this ede-target) file)
+  "Return non-nil if THIS target wants FILE."
+  ;; By default, all targets reference the source object, and let it decide.
+  (let ((src (ede-target-sourcecode this)))
+    (while (and src (not (ede-want-file-p (car src) file)))
+      (setq src (cdr src)))
+    src))
+
+(defmethod ede-want-file-source-p ((this ede-target) file)
+  "Return non-nil if THIS target wants FILE."
+  ;; By default, all targets reference the source object, and let it decide.
+  (let ((src (ede-target-sourcecode this)))
+    (while (and src (not (ede-want-file-source-p (car src) file)))
+      (setq src (cdr src)))
+    src))
+
+(defmethod ede-target-sourcecode ((this ede-target))
+  "Return the sourcecode objects which THIS permits."
+  (let ((sc (oref this sourcetype))
+	(rs nil))
+    (while (and (listp sc) sc)
+      (setq rs (cons (symbol-value (car sc)) rs)
+	    sc (cdr sc)))
+    rs))
+
+
+;;; Debugging.
+;;
+(defun ede-adebug-project ()
+  "Run adebug against the current EDE project.
+Display the results as a debug list."
+  (interactive)
+  (require 'data-debug)
+  (when (ede-current-project)
+    (data-debug-new-buffer "*Analyzer ADEBUG*")
+    (data-debug-insert-object-slots (ede-current-project) "")
+    ))
+
+(defun ede-adebug-project-parent ()
+  "Run adebug against the current EDE parent project.
+Display the results as a debug list."
+  (interactive)
+  (require 'data-debug)
+  (when (ede-parent-project)
+    (data-debug-new-buffer "*Analyzer ADEBUG*")
+    (data-debug-insert-object-slots (ede-parent-project) "")
+    ))
+
+(defun ede-adebug-project-root ()
+  "Run adebug against the current EDE parent project.
+Display the results as a debug list."
+  (interactive)
+  (require 'data-debug)
+  (when (ede-toplevel)
+    (data-debug-new-buffer "*Analyzer ADEBUG*")
+    (data-debug-insert-object-slots (ede-toplevel) "")
+    ))
+
+
+
+;;; TOPLEVEL PROJECT
+;;
+;; The toplevel project is a way to identify the EDE structure that belongs
+;; to the top of a project.
+
+(defun ede-toplevel (&optional subproj)
+  "Return the ede project which is the root of the current project.
+Optional argument SUBPROJ indicates a subproject to start from
+instead of the current project."
+  (or ede-object-root-project
+      (let* ((cp (or subproj (ede-current-project))))
+	(or (and cp (ede-project-root cp))
+	    (progn
+	      (while (ede-parent-project cp)
+		(setq cp (ede-parent-project cp)))
+	      cp)))))
+
+
+;;; Hooks & Autoloads
+;;
+;;  These let us watch various activities, and respond appropriately.
+
+;; (add-hook 'edebug-setup-hook
+;; 	  (lambda ()
+;; 	    (def-edebug-spec ede-with-projectfile
+;; 	      (form def-body))))
+
+(provide 'ede/base)
+
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-load-name: "ede/base"
+;; End:
+
+;;; ede/base.el ends here
--- a/lisp/cedet/ede/cpp-root.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/cpp-root.el	Wed Oct 13 22:40:51 2010 +0900
@@ -131,7 +131,7 @@
 ;; (add-to-list 'ede-project-class-files
 ;; 	     (ede-project-autoload "cpp-root"
 ;; 	      :name "CPP ROOT"
-;; 	      :file 'ede-cpp-root
+;; 	      :file 'ede/cpp-root
 ;; 	      :proj-file 'MY-FILE-FOR-DIR
 ;;            :proj-root 'MY-ROOT-FCN
 ;; 	      :load-type 'MY-LOAD
@@ -237,6 +237,18 @@
   ;; Snoop through our master list.
   (ede-cpp-root-file-existing dir))
 
+;;;###autoload
+(add-to-list 'ede-project-class-files
+	     (ede-project-autoload "cpp-root"
+	      :name "CPP ROOT"
+	      :file 'ede/cpp-root
+	      :proj-file 'ede-cpp-root-project-file-for-dir
+	      :proj-root 'ede-cpp-root-project-root
+	      :load-type 'ede-cpp-root-load
+	      :class-sym 'ede-cpp-root
+	      :new-p nil)
+	     t)
+
 ;;; CLASSES
 ;;
 ;; EDE sets up projects with two kinds of objects.
@@ -504,6 +516,21 @@
   "Get the pre-processor map for project THIS."
   (ede-preprocessor-map  (ede-target-parent this)))
 
+;;; Quick Hack
+(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes)
+  "Create a bunch of projects under directory DIR.
+PROJFILE is a file name sans directory that indicates a subdirectory
+is a project directory.
+Generic ATTRIBUTES, such as :include-path can be added.
+Note: This needs some work."
+  (let ((files (directory-files dir t)))
+    (dolist (F files)
+      (if (file-exists-p (expand-file-name projfile F))
+	  `(ede-cpp-root-project (file-name-nondirectory F)
+				 :name (file-name-nondirectory F)
+				 :file (expand-file-name projfile F)
+				 attributes)))))
+
 (provide 'ede/cpp-root)
 
 ;; Local variables:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cedet/ede/custom.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,215 @@
+;;; ede.el --- customization of EDE projects.
+
+;; Copyright (C) 2010  Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Customization commands/hooks for EDE.
+;;
+;; EIEIO supports customizing objects, and EDE uses this to allow
+;; users to change basic settings in their projects.
+;;
+
+;;; Code:
+;;; Customization
+;;
+;; Routines for customizing projects and targets.
+
+(require 'ede)
+(eval-when-compile (require 'eieio-custom))
+
+(defvar eieio-ede-old-variables nil
+  "The old variables for a project.")
+
+;;; Customization Commands
+;;
+;; These commands initialize custoization of EDE control objects.
+
+;;;###autoload
+(defun ede-customize-project ()
+  "Edit fields of the current project through EIEIO & Custom."
+  (interactive)
+  (require 'eieio-custom)
+  (let* ((ov (oref (ede-current-project) local-variables))
+	 (cp (ede-current-project)))
+    (ede-customize cp)
+    (make-local-variable 'eieio-ede-old-variables)
+    (setq eieio-ede-old-variables ov)))
+
+;;;###autoload
+(defalias 'customize-project 'ede-customize-project)
+
+;;;###autoload
+(defun ede-customize-current-target()
+  "Edit fields of the current target through EIEIO & Custom."
+  (interactive)
+  (require 'eieio-custom)
+  (if (not (obj-of-class-p ede-object ede-target))
+      (error "Current file is not part of a target"))
+  (ede-customize-target ede-object))
+
+;;;###autoload
+(defalias 'customize-target 'ede-customize-current-target)
+
+(defun ede-customize-target (obj)
+  "Edit fields of the current target through EIEIO & Custom.
+OBJ is the target object to customize."
+  (require 'eieio-custom)
+  (if (and obj (not (obj-of-class-p obj ede-target)))
+      (error "No logical target to customize"))
+  (ede-customize obj))
+
+(defmethod ede-customize ((proj ede-project))
+  "Customize the EDE project PROJ."
+  (eieio-customize-object proj 'default))
+
+(defmethod ede-customize ((target ede-target))
+  "Customize the EDE TARGET."
+  (eieio-customize-object target 'default))
+
+;;; Target Sorting
+;;
+;; Target order can be important, but custom doesn't support a way
+;; to resort items in a list.  This function by David Engster allows
+;; targets to be re-arranged.
+
+(defvar ede-project-sort-targets-order nil
+  "Variable for tracking target order in `ede-project-sort-targets'.")
+
+;;;###autoload
+(defun ede-project-sort-targets ()
+  "Create a custom-like buffer for sorting targets of current project."
+  (interactive)
+  (let ((proj (ede-current-project))
+        (count 1)
+        current order)
+    (switch-to-buffer (get-buffer-create "*EDE sort targets*"))
+    (erase-buffer)
+    (setq ede-object-project proj)
+    (widget-create 'push-button
+                   :notify (lambda (&rest ignore)
+                             (let ((targets (oref ede-object-project targets))
+                                   cur newtargets)
+                               (while (setq cur (pop ede-project-sort-targets-order))
+                                 (setq newtargets (append newtargets
+                                                          (list (nth cur targets)))))
+                               (oset ede-object-project targets newtargets))
+                             (ede-commit-project ede-object-project)
+                             (kill-buffer))
+                   " Accept ")
+    (widget-insert "   ")
+    (widget-create 'push-button
+                   :notify (lambda (&rest ignore)
+			     (kill-buffer))
+                   " Cancel ")
+    (widget-insert "\n\n")
+    (setq ede-project-sort-targets-order nil)
+    (mapc (lambda (x)
+            (add-to-ordered-list
+             'ede-project-sort-targets-order
+             x x))
+          (number-sequence 0 (1- (length (oref proj targets)))))
+    (ede-project-sort-targets-list)
+    (use-local-map widget-keymap)
+    (widget-setup)
+    (goto-char (point-min))))
+
+(defun ede-project-sort-targets-list ()
+  "Sort the target list while using `ede-project-sort-targets'."
+  (save-excursion
+    (let ((count 0)
+          (targets (oref ede-object-project targets))
+          (inhibit-read-only t)
+          (inhibit-modification-hooks t))
+      (goto-char (point-min))
+      (forward-line 2)
+      (delete-region (point) (point-max))
+      (while (< count (length targets))
+        (if (> count 0)
+            (widget-create 'push-button
+                           :notify `(lambda (&rest ignore)
+                                      (let ((cur ede-project-sort-targets-order))
+                                        (add-to-ordered-list
+                                         'ede-project-sort-targets-order
+                                         (nth ,count cur)
+                                         (1- ,count))
+                                        (add-to-ordered-list
+                                         'ede-project-sort-targets-order
+                                         (nth (1- ,count) cur) ,count))
+                                      (ede-project-sort-targets-list))
+                           " Up ")
+          (widget-insert "      "))
+        (if (< count (1- (length targets)))
+            (widget-create 'push-button
+                           :notify `(lambda (&rest ignore)
+                                      (let ((cur ede-project-sort-targets-order))
+                                        (add-to-ordered-list
+                                         'ede-project-sort-targets-order
+                                         (nth ,count cur) (1+ ,count))
+                                        (add-to-ordered-list
+                                         'ede-project-sort-targets-order
+                                         (nth (1+ ,count) cur) ,count))
+                                      (ede-project-sort-targets-list))
+                           " Down ")
+          (widget-insert "        "))
+        (widget-insert (concat " " (number-to-string (1+ count)) ".:   "
+                               (oref (nth (nth count ede-project-sort-targets-order)
+                                          targets) name) "\n"))
+        (setq count (1+ count))))))
+
+;;; Customization hooks
+;;
+;; These hooks are used when finishing up a customization.
+(defmethod eieio-done-customizing ((proj ede-project))
+  "Call this when a user finishes customizing PROJ."
+  (let ((ov eieio-ede-old-variables)
+	(nv (oref proj local-variables)))
+    (setq eieio-ede-old-variables nil)
+    (while ov
+      (if (not (assoc (car (car ov)) nv))
+	  (save-excursion
+	    (mapc (lambda (b)
+		    (set-buffer b)
+		    (kill-local-variable (car (car ov))))
+		  (ede-project-buffers proj))))
+      (setq ov (cdr ov)))
+    (mapc (lambda (b) (ede-set-project-variables proj b))
+	  (ede-project-buffers proj))))
+
+;; These two methods should be implemented by subclasses of
+;; project and targets in order to account for user specified
+;; changes.
+(defmethod eieio-done-customizing ((target ede-target))
+  "Call this when a user finishes customizing TARGET."
+  nil)
+
+(defmethod ede-commit-project ((proj ede-project))
+  "Commit any change to PROJ to its file."
+  nil
+  )
+
+(provide 'ede/custom)
+
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-load-name: "ede/custom"
+;; End:
+
+;;; ede/custom.el ends here
--- a/lisp/cedet/ede/dired.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/dired.el	Wed Oct 13 22:40:51 2010 +0900
@@ -88,7 +88,7 @@
   (let ((files (dired-get-marked-files t)))
     (while files
       (project-add-file target (car files))
-      ;; Find the buffer for this files, and set it's ede-object
+      ;; Find the buffer for this files, and set its ede-object
       (if (get-file-buffer (car files))
 	  (with-current-buffer (get-file-buffer (car files))
 	    (setq ede-object nil)
--- a/lisp/cedet/ede/emacs.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/emacs.el	Wed Oct 13 22:40:51 2010 +0900
@@ -133,6 +133,18 @@
       )
   )
 
+;;;###autoload
+(add-to-list 'ede-project-class-files
+	     (ede-project-autoload "emacs"
+	      :name "EMACS ROOT"
+	      :file 'ede/emacs
+	      :proj-file "src/emacs.c"
+	      :proj-root 'ede-emacs-project-root
+	      :load-type 'ede-emacs-load
+	      :class-sym 'ede-emacs-project
+	      :new-p nil)
+	     t)
+
 (defclass ede-emacs-target-c (ede-target)
   ()
   "EDE Emacs Project target for C code.
@@ -150,7 +162,7 @@
 
 (defmethod initialize-instance ((this ede-emacs-project)
 				&rest fields)
-  "Make sure the :file is fully expanded."
+  "Make sure the targets slot is bound."
   (call-next-method)
   (unless (slot-boundp this 'targets)
     (oset this :targets nil)))
--- a/lisp/cedet/ede/files.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/files.el	Wed Oct 13 22:40:51 2010 +0900
@@ -38,6 +38,7 @@
 (declare-function ede-locate-file-in-hash "ede/locate")
 (declare-function ede-locate-add-file-to-hash "ede/locate")
 (declare-function ede-locate-file-in-project "ede/locate")
+(declare-function ede-locate-flush-hash "ede/locate")
 
 (defvar ede--disable-inode nil
   "Set to 't' to simulate systems w/out inode support.")
@@ -57,44 +58,29 @@
 	     (ede-project-root-directory (ede-current-project))))
     (find-file fname)))
 
+(defun ede-flush-project-hash ()
+  "Flush the file locate hash for the current project."
+  (interactive)
+  (require 'ede/locate)
+  (let* ((loc (ede-get-locator-object (ede-current-project))))
+    (ede-locate-flush-hash loc)))
+
 ;;; Placeholders for ROOT directory scanning on base objects
 ;;
 (defmethod ede-project-root ((this ede-project-placeholder))
-  "If a project knows it's root, return it here.
+  "If a project knows its root, return it here.
 Allows for one-project-object-for-a-tree type systems."
   (oref this rootproject))
 
 (defmethod ede-project-root-directory ((this ede-project-placeholder)
 				       &optional file)
-  "If a project knows it's root, return it here.
+  "If a project knows its root, return it here.
 Allows for one-project-object-for-a-tree type systems.
 Optional FILE is the file to test.  It is ignored in preference
 of the anchor file for the project."
   (file-name-directory (expand-file-name (oref this file))))
 
 
-(defmethod ede-project-root ((this ede-project-autoload))
-  "If a project knows it's root, return it here.
-Allows for one-project-object-for-a-tree type systems."
-  nil)
-
-(defmethod ede-project-root-directory ((this ede-project-autoload)
-				       &optional file)
-  "If a project knows it's root, return it here.
-Allows for one-project-object-for-a-tree type systems.
-Optional FILE is the file to test.  If there is no FILE, use
-the current buffer."
-  (when (not file)
-    (setq file default-directory))
-  (when (slot-boundp this :proj-root)
-    (let ((rootfcn (oref this proj-root)))
-      (when rootfcn
-	(condition-case nil
-	    (funcall rootfcn file)
-	  (error
-	   (funcall rootfcn)))
-	))))
-
 (defmethod ede--project-inode ((proj ede-project-placeholder))
   "Get the inode of the directory project PROJ is in."
   (if (slot-boundp proj 'dirinode)
@@ -262,27 +248,30 @@
 (defun ede-directory-project-p (dir &optional force)
   "Return a project description object if DIR has a project.
 Optional argument FORCE means to ignore a hash-hit of 'nomatch.
-This depends on an up to date `ede-project-class-files' variable."
-  (let* ((dirtest (expand-file-name dir))
-	 (match (ede-directory-project-from-hash dirtest)))
-    (cond
-     ((and (eq match 'nomatch) (not force))
-      nil)
-     ((and match (not (eq match 'nomatch)))
-      match)
-     (t
-      (let ((types ede-project-class-files)
-	    (ret nil))
-	;; Loop over all types, loading in the first type that we find.
-	(while (and types (not ret))
-	  (if (ede-dir-to-projectfile (car types) dirtest)
-	      (progn
-		;; We found one!  Require it now since we will need it.
-		(require (oref (car types) file))
-		(setq ret (car types))))
-	  (setq types (cdr types)))
-	(ede-directory-project-add-description-to-hash dirtest (or ret 'nomatch))
-	ret)))))
+This depends on an up to date `ede-project-class-files' variable.
+Any directory that contains the file .ede-ignore will allways
+return nil."
+  (when (not (file-exists-p (expand-file-name ".ede-ignore" dir)))
+    (let* ((dirtest (expand-file-name dir))
+	   (match (ede-directory-project-from-hash dirtest)))
+      (cond
+       ((and (eq match 'nomatch) (not force))
+	nil)
+       ((and match (not (eq match 'nomatch)))
+	match)
+       (t
+	(let ((types ede-project-class-files)
+	      (ret nil))
+	  ;; Loop over all types, loading in the first type that we find.
+	  (while (and types (not ret))
+	    (if (ede-dir-to-projectfile (car types) dirtest)
+		(progn
+		  ;; We found one!  Require it now since we will need it.
+		  (require (oref (car types) file))
+		  (setq ret (car types))))
+	    (setq types (cdr types)))
+	  (ede-directory-project-add-description-to-hash dirtest (or ret 'nomatch))
+	  ret))))))
 
 ;;; TOPLEVEL
 ;;
@@ -324,7 +313,7 @@
 	  ;; If PROJ didn't know, or there is no PROJ, then
 
 	  ;; Loop up to the topmost project, and then load that single
-	  ;; project, and it's sub projects.  When we are done, identify the
+	  ;; project, and its sub projects.  When we are done, identify the
 	  ;; sub-project object belonging to file.
 	  (while (and (not ans) newpath proj)
 	    (setq toppath newpath
@@ -338,24 +327,6 @@
 	    )
 	  (or ans toppath))))))
 
-;;; TOPLEVEL PROJECT
-;;
-;; The toplevel project is a way to identify the EDE structure that belongs
-;; to the top of a project.
-
-(defun ede-toplevel (&optional subproj)
-  "Return the ede project which is the root of the current project.
-Optional argument SUBPROJ indicates a subproject to start from
-instead of the current project."
-  (or ede-object-root-project
-      (let* ((cp (or subproj (ede-current-project)))
-	     )
-	(or (and cp (ede-project-root cp))
-	    (progn
-	      (while (ede-parent-project cp)
-		(setq cp (ede-parent-project cp)))
-	      cp)))))
-
 ;;; DIRECTORY CONVERSION STUFF
 ;;
 (defmethod ede-convert-path ((this ede-project) path)
@@ -372,11 +343,13 @@
 	    (substring fptf (match-end 0))
 	  (error "Cannot convert relativize path %s" fp))))))
 
-(defmethod ede-convert-path ((this ede-target) path)
+(defmethod ede-convert-path ((this ede-target) path &optional project)
   "Convert path in a standard way for a given project.
 Default to making it project relative.
-Argument THIS is the project to convert PATH to."
-  (let ((proj (ede-target-parent this)))
+Argument THIS is the project to convert PATH to.
+Optional PROJECT is the project that THIS belongs to.  Associating
+a target to a project is expensive, so using this can speed things up."
+  (let ((proj (or project (ede-target-parent this))))
     (if proj
 	(let ((p (ede-convert-path proj path))
 	      (lp (or (oref this path) "")))
@@ -406,7 +379,8 @@
 by this project.
 Optional argument FORCE forces the default filename to be provided even if it
 doesn't exist.
-If FORCE equals 'newfile, then the cache is ignored."
+If FORCE equals 'newfile, then the cache is ignored and a new file in THIS
+is returned."
   (require 'ede/locate)
   (let* ((loc (ede-get-locator-object this))
 	 (ha (ede-locate-file-in-hash loc filename))
@@ -467,17 +441,8 @@
 	(proj (oref this subproj))
 	(found nil))
     ;; find it Locally.
-    (setq found
-	  (cond ((file-exists-p (expand-file-name filename path))
-		 (expand-file-name filename path))
-		((file-exists-p (expand-file-name  (concat "include/" filename) path))
-		 (expand-file-name (concat "include/" filename) path))
-		(t
-		 (while (and (not found) proj)
-		   (setq found (when (car proj)
-				 (ede-expand-filename (car proj) filename))
-			 proj (cdr proj)))
-		 found)))
+    (setq found (or (ede-expand-filename-local this filename)
+		    (ede-expand-filename-impl-via-subproj this filename)))
     ;; Use an external locate tool.
     (when (not found)
       (require 'ede/locate)
@@ -485,6 +450,30 @@
     ;; Return it
     found))
 
+(defmethod ede-expand-filename-local ((this ede-project) filename)
+  "Expand filename locally to project THIS with filesystem tests."
+  (let ((path (ede-project-root-directory this)))
+    (cond ((file-exists-p (expand-file-name filename path))
+	   (expand-file-name filename path))
+	  ((file-exists-p (expand-file-name  (concat "include/" filename) path))
+	   (expand-file-name (concat "include/" filename) path)))))
+
+(defmethod ede-expand-filename-impl-via-subproj ((this ede-project) filename)
+  "Return a fully qualified file name based on project THIS.
+FILENAME should be just a filename which occurs in a directory controlled
+by this project."
+  (let ((proj (list (ede-toplevel this)))
+	(found nil))
+    ;; find it Locally.
+    (while (and (not found) proj)
+      (let ((thisproj (car proj)))
+	(setq proj (append (cdr proj) (oref thisproj subproj)))
+	(setq found (when thisproj
+		      (ede-expand-filename-local thisproj filename)))
+	))
+    ;; Return it
+    found))
+
 (defmethod ede-expand-filename ((this ede-target) filename &optional force)
   "Return a fully qualified file name based on target THIS.
 FILENAME should be a filename which occurs in a directory in which THIS works.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/cedet/ede/generic.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,442 @@
+;;; ede/generic.el --- Base Support for generic build systems
+
+;; Copyright (C) 2010 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <eric@siege-engine.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; There are a lot of build systems out there, and EDE can't support
+;; them all fully.  The ede-generic.el system is the base for
+;; supporting alternate build systems in a simple way, automatically.
+;;
+;; The structure is for the ede-generic baseclass, which is augmented
+;; by simple sub-classes that can be created by users on an as needed
+;; basis.  The generic system will have targets for many language
+;; types, and create the targets on an as needed basis.  All
+;; sub-project types will recycle the same generic target types.
+;;
+;; The generic target types will only be implemented for languages
+;; where having EDE support actually matters, with a single MISC to
+;; represent anything else.
+;;
+;; TOO MANY PROJECTS DETECTED:
+;;
+;; If enabling ede-generic support starts identifying too many
+;; projects, drop a file called `.ede-ignore' into any directory where
+;; you do not want a project to be.
+;;
+;; Customization:
+;;
+;; Since these projects are all so increadibly generic, a user will
+;; need to configure some aspects of the project by hand.  In order to
+;; enable this without configuring the project objects directly (which
+;; are auto-generated) a special ede-generic-confg object is defined to
+;; hold the basics.  Generic projects will identify and use these
+;; config files.
+;;
+;; Adding support for new projects:
+;;
+;; To add support to EDE Generic for new project types is very quick.
+;; See the end of this file for examples such as CMake and SCons.
+;;
+;; Support consists of one class for your project, specifying the file
+;; name used by the project system you want to support.  It also
+;; should implement th method `ede-generic-setup-configuration' to
+;; prepopulate the configurable portion of the generic project with
+;; build details.
+;;
+;; Lastly, call `ede-generic-new-autoloader' to setup your project so
+;; EDE can use it.
+;;
+;; Adding support for new types of source code:
+;;
+;; Sources of different types are supported with a simple class which
+;; subclasses `ede-generic-target'.  The slots `shortname' and
+;; `extension' should be given new initial values.
+;;
+;; Optionally, any target method used by EDE can then be overriden.
+;; The ede-generic-target-c-cpp has some example methods setting up
+;; the pre-processor map and system include path.
+;;
+;; NOTE: It is not necessary to modify ede-generic.el to add any of
+;; the above described support features.
+
+(require 'eieio-opt)
+(require 'ede)
+(require 'semantic/db)
+
+;;; Code:
+;;
+;; Start with the configuration system
+(defclass ede-generic-config (eieio-persistent)
+  ((extension :initform ".ede")
+   (file-header-line :initform ";; EDE Generic Project Configuration")
+   (project :initform nil
+	    :documentation
+	    "The project this config is bound to.")
+   ;; Generic customizations
+   (build-command :initarg :build-command
+		  :initform "make -k"
+		  :type string
+		  :custom string
+		  :group (default build)
+		  :documentation
+		  "Command used for building this project.")
+   (debug-command :initarg :debug-command
+		  :initform "gdb "
+		  :type string
+		  :custom string
+		  :group (default build)
+		  :documentation
+		  "Command used for debugging this project.")
+   ;; C target customixations
+   (c-include-path :initarg :c-include-path
+		   :initform nil
+		   :type list
+		   :custom (repeat (string :tag "Path"))
+		   :group c
+		   :documentation
+		   "The include path used by C/C++ projects.")
+   (c-preprocessor-table :initarg :c-preprocessor-table
+			 :initform nil
+			 :type list
+			 :custom (repeat (cons (string :tag "Macro")
+					       (string :tag "Value")))
+			 :group c
+			 :documentation
+			 "Preprocessor Symbols for this project.")
+   (c-preprocessor-files :initarg :c-preprocessor-files
+			 :initform nil
+			 :type list
+			 :custom (repeat (string :tag "Include File")))
+   )
+  "User Configuration object for a generic project.")
+
+(defun ede-generic-load (dir &optional rootproj)
+  "Return a Generic Project object if there is a match.
+Return nil if there isn't one.
+Argument DIR is the directory it is created for.
+ROOTPROJ is nil, since there is only one project."
+  ;; Doesn't already exist, so lets make one.
+  (let* ((alobj ede-constructing)
+	 (this nil))
+    (when (not alobj) (error "Cannot load generic project without the autoload instance"))
+
+    (setq this
+	  (funcall (oref alobj class-sym)
+		   (symbol-name (oref alobj class-sym))
+		   :name (file-name-nondirectory
+			  (directory-file-name dir))
+		   :version "1.0"
+		   :directory (file-name-as-directory dir)
+		   :file (expand-file-name (oref alobj :proj-file)) ))
+    (ede-add-project-to-global-list this)
+    ))
+
+;;; Base Classes for the system
+(defclass ede-generic-target (ede-target)
+  ((shortname :initform ""
+	     :type string
+	     :allocation :class
+	     :documentation
+	     "Something prepended to the target name.")
+  (extension :initform ""
+	      :type string
+	      :allocation :class
+	      :documentation
+	      "Regular expression representing the extension used for this target.
+subclasses of this base target will override the default value.")
+  )
+  "Baseclass for all targets belonging to the generic ede system."
+  :abstract t)
+
+(defclass ede-generic-project (ede-project)
+  ((buildfile :initform ""
+	      :type string
+	      :allocation :class
+	      :documentation "The file name that identifies a project of this type.
+The class allocated value is replace by different sub classes.")
+   (config :initform nil
+	   :type (or null ede-generic-config)
+	   :documentation
+	   "The configuration object for this project.")
+   )
+  "The baseclass for all generic EDE project types."
+  :abstract t)
+
+(defmethod initialize-instance ((this ede-generic-project)
+				&rest fields)
+  "Make sure the targets slot is bound."
+  (call-next-method)
+  (unless (slot-boundp this 'targets)
+    (oset this :targets nil))
+  )
+
+(defmethod ede-generic-get-configuration ((proj ede-generic-project))
+  "Return the configuration for the project PROJ."
+  (let ((config (oref proj config)))
+    (when (not config)
+      (let ((fname (expand-file-name "EDEConfig.el"
+				     (oref proj :directory))))
+	(if (file-exists-p fname)
+	    ;; Load in the configuration
+	    (setq config (eieio-persistent-read fname))
+	  ;; Create a new one.
+	  (setq config (ede-generic-config
+			"Configuration"
+			:file fname))
+	  ;; Set initial values based on project.
+	  (ede-generic-setup-configuration proj config))
+	;; Link things together.
+	(oset proj config config)
+	(oset config project proj)))
+    config))
+
+(defmethod ede-generic-setup-configuration ((proj ede-generic-project) config)
+  "Default configuration setup method."
+  nil)
+
+(defmethod ede-commit-project ((proj ede-generic-project))
+  "Commit any change to PROJ to its file."
+  (let ((config (ede-generic-get-configuration proj)))
+    (ede-commit config)))
+
+;;; A list of different targets
+(defclass ede-generic-target-c-cpp (ede-generic-target)
+  ((shortname :initform "C/C++")
+   (extension :initform "\\([ch]\\(pp\\|xx\\|\\+\\+\\)?\\|cc\\|hh\\|CC?\\)"))
+  "EDE Generic Project target for C and C++ code.
+All directories need at least one target.")
+
+(defclass ede-generic-target-el (ede-generic-target)
+  ((shortname :initform "ELisp")
+   (extension :initform "el"))
+  "EDE Generic Project target for Emacs Lisp code.
+All directories need at least one target.")
+
+(defclass ede-generic-target-fortran (ede-generic-target)
+  ((shortname :initform "Fortran")
+   (extension :initform "[fF]9[05]\\|[fF]\\|for"))
+  "EDE Generic Project target for Fortran code.
+All directories need at least one target.")
+
+(defclass ede-generic-target-texi (ede-generic-target)
+  ((shortname :initform "Texinfo")
+   (extension :initform "texi"))
+  "EDE Generic Project target for texinfo code.
+All directories need at least one target.")
+
+;; MISC must always be last since it will always match the file.
+(defclass ede-generic-target-misc (ede-generic-target)
+  ((shortname :initform "Misc")
+   (extension :initform ""))
+  "EDE Generic Project target for Misc files.
+All directories need at least one target.")
+
+;;; Automatic target aquisition.
+(defun ede-generic-find-matching-target (class dir targets)
+  "Find a target that is a CLASS and is in DIR in the list of TARGETS."
+  (let ((match nil))
+    (dolist (T targets)
+      (when (and (object-of-class-p T class)
+		 (string= (oref T :path) dir))
+	(setq match T)
+      ))
+    match))
+
+(defmethod ede-find-target ((proj ede-generic-project) buffer)
+  "Find an EDE target in PROJ for BUFFER.
+If one doesn't exist, create a new one for this directory."
+  (let* ((ext (file-name-extension (buffer-file-name buffer)))
+	 (classes (eieio-build-class-alist 'ede-generic-target t))
+	 (cls nil)
+	 (targets (oref proj targets))
+	 (dir default-directory)
+	 (ans nil)
+	 )
+    ;; Pick a matching class type.
+    (when ext
+      (dolist (C classes)
+	(let* ((classsym (intern (car C)))
+	       (extreg (oref classsym extension)))
+	  (when (and (not (string= extreg ""))
+		     (string-match (concat "^" extreg "$") ext))
+	    (setq cls classsym)))))
+    (when (not cls) (setq cls 'ede-generic-target-misc))
+    ;; find a pre-existing matching target
+    (setq ans (ede-generic-find-matching-target cls dir targets))
+    ;; Create a new instance if there wasn't one
+    (when (not ans)
+      (setq ans (make-instance
+		 cls
+		 :name (oref cls shortname)
+		 :path dir
+		 :source nil))
+      (object-add-to-list proj :targets ans)
+      )
+    ans))
+
+;;; C/C++ support
+(defmethod ede-preprocessor-map ((this ede-generic-target-c-cpp))
+  "Get the pre-processor map for some generic C code."
+  (let* ((proj (ede-target-parent this))
+	 (root (ede-project-root proj))
+	 (config (ede-generic-get-configuration proj))
+	 filemap
+	 )
+    ;; Preprocessor files
+    (dolist (G (oref config :c-preprocessor-files))
+      (let ((table (semanticdb-file-table-object
+		    (ede-expand-filename root G))))
+	(when table
+	  (when (semanticdb-needs-refresh-p table)
+	    (semanticdb-refresh-table table))
+	  (setq filemap (append filemap (oref table lexical-table)))
+	  )))
+    ;; The core table
+    (setq filemap (append filemap (oref config :c-preprocessor-table)))
+
+    filemap
+    ))
+
+(defmethod ede-system-include-path ((this ede-generic-target-c-cpp))
+  "Get the system include path used by project THIS."
+  (let* ((proj (ede-target-parent this))
+	(config (ede-generic-get-configuration proj)))
+    (oref config c-include-path)))
+
+;;; Customization
+;;
+(defmethod ede-customize ((proj ede-generic-project))
+  "Customize the EDE project PROJ."
+  (let ((config (ede-generic-get-configuration proj)))
+    (eieio-customize-object config)))
+
+(defmethod ede-customize ((target ede-generic-target))
+  "Customize the EDE TARGET."
+  ;; Nothing unique for the targets, use the project.
+  (ede-customize-project))
+
+(defmethod eieio-done-customizing ((config ede-generic-config))
+  "Called when EIEIO is done customizing the configuration object.
+We need to go back through the old buffers, and update them with
+the new configuration."
+  (ede-commit config)
+  ;; Loop over all the open buffers, and re-apply.
+  (ede-map-targets
+   (oref config project)
+   (lambda (target)
+     (ede-map-target-buffers
+      target
+      (lambda (b)
+	(with-current-buffer b
+	  (ede-apply-target-options)))))))
+
+(defmethod ede-commit ((config ede-generic-config))
+  "Commit all changes to the configuration to disk."
+  (eieio-persistent-save config))
+
+;;; Creating Derived Projects:
+;;
+;; Derived projects need an autoloader so that EDE can find the
+;; different projects on disk.
+(defun ede-generic-new-autoloader (internal-name external-name
+						 projectfile class)
+  "Add a new EDE Autoload instance for identifying a generic project.
+INTERNAL-NAME is a long name that identifies thsi project type.
+EXTERNAL-NAME is a shorter human readable name to describe the project.
+PROJECTFILE is a file name that identifies a project of this type to EDE, such as
+a Makefile, or SConstruct file.
+CLASS is the EIEIO class that is used to track this project.  It should subclass
+the class `ede-generic-project' project."
+  (add-to-list 'ede-project-class-files
+	       (ede-project-autoload internal-name
+				     :name external-name
+				     :file 'ede/generic
+				     :proj-file projectfile
+				     :load-type 'ede-generic-load
+				     :class-sym class
+				     :new-p nil)
+	       ;; Generics must go at the end, since more specific types
+	       ;; can create Makefiles also.
+	       t))
+
+;;;###autoload
+(defun ede-enable-generic-projects ()
+  "Enable generic project loaders."
+  (interactive)
+  (ede-generic-new-autoloader "edeproject-makefile" "Make"
+			      "Makefile" 'ede-generic-makefile-project)
+  (ede-generic-new-autoloader "edeproject-scons" "SCons"
+			      "SConstruct" 'ede-generic-scons-project)
+  (ede-generic-new-autoloader "edeproject-cmake" "CMake"
+			      "CMakeLists" 'ede-generic-cmake-project)
+  )
+
+
+;;; SPECIFIC TYPES OF GENERIC BUILDS
+;;
+
+;;; MAKEFILE
+
+(defclass ede-generic-makefile-project (ede-generic-project)
+  ((buildfile :initform "Makefile")
+   )
+  "Generic Project for makefiles.")
+
+(defmethod ede-generic-setup-configuration ((proj ede-generic-makefile-project) config)
+  "Setup a configuration for Make."
+  (oset config build-command "make -k")
+  (oset config debug-command "gdb ")
+  )
+
+
+;;; SCONS
+(defclass ede-generic-scons-project (ede-generic-project)
+  ((buildfile :initform "SConstruct")
+   )
+  "Generic Project for scons.")
+
+(defmethod ede-generic-setup-configuration ((proj ede-generic-scons-project) config)
+  "Setup a configuration for SCONS."
+  (oset config build-command "scons")
+  (oset config debug-command "gdb ")
+  )
+
+
+;;; CMAKE
+(defclass ede-generic-cmake-project (ede-generic-project)
+  ((buildfile :initform "CMakeLists")
+   )
+  "Generic Project for cmake.")
+
+(defmethod ede-generic-setup-configuration ((proj ede-generic-cmake-project) config)
+  "Setup a configuration for CMake."
+  (oset config build-command "cmake")
+  (oset config debug-command "gdb ")
+  )
+
+(provide 'ede/generic)
+
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-load-name: "ede/generic"
+;; End:
+
+;;; ede/generic.el ends here
--- a/lisp/cedet/ede/linux.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/linux.el	Wed Oct 13 22:40:51 2010 +0900
@@ -112,6 +112,18 @@
       )
   )
 
+;;;###autoload
+(add-to-list 'ede-project-class-files
+	     (ede-project-autoload "linux"
+	      :name "LINUX ROOT"
+	      :file 'ede/linux
+	      :proj-file "scripts/ver_linux"
+	      :proj-root 'ede-linux-project-root
+	      :load-type 'ede-linux-load
+	      :class-sym 'ede-linux-project
+	      :new-p nil)
+	     t)
+
 (defclass ede-linux-target-c (ede-target)
   ()
   "EDE Linux Project target for C code.
@@ -124,7 +136,7 @@
 
 (defmethod initialize-instance ((this ede-linux-project)
 				&rest fields)
-  "Make sure the :file is fully expanded."
+  "Make sure the targets slot is bound."
   (call-next-method)
   (unless (slot-boundp this 'targets)
     (oset this :targets nil)))
--- a/lisp/cedet/ede/locate.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/locate.el	Wed Oct 13 22:40:51 2010 +0900
@@ -121,7 +121,7 @@
   ;; Basic setup.
   (call-next-method)
   ;; Make sure we have a hash table.
-  (oset loc hash (make-hash-table :test 'equal))
+  (ede-locate-flush-hash loc)
   )
 
 (defmethod ede-locate-ok-in-project :static ((loc ede-locate-base)
@@ -129,6 +129,10 @@
   "Is it ok to use this project type under ROOT."
   t)
 
+(defmethod ede-locate-flush-hash ((loc ede-locate-base))
+  "For LOC, flush hashtable and start from scratch."
+  (oset loc hash (make-hash-table :test 'equal)))
+
 (defmethod ede-locate-file-in-hash ((loc ede-locate-base)
 				    filestring)
   "For LOC, is the file FILESTRING in our hashtable?"
@@ -160,6 +164,13 @@
   nil
   )
 
+(defmethod ede-locate-create/update-root-database :STATIC
+  ((loc ede-locate-base) root)
+  "Create or update the database for the current project.
+You cannot create projects for the baseclass."
+  (error "Cannot create/update a database of type %S"
+	 (object-name loc)))
+
 ;;; LOCATE
 ;;
 ;; Using the standard unix "locate" command.
@@ -242,6 +253,11 @@
   (let ((default-directory (oref loc root)))
     (cedet-gnu-global-expand-filename filesubstring)))
 
+(defmethod ede-locate-create/update-root-database :STATIC
+  ((loc ede-locate-global) root)
+  "Create or update the GNU Global database for the current project."
+  (cedet-gnu-global-create/update-database root))
+
 ;;; IDUTILS
 ;;
 (defclass ede-locate-idutils (ede-locate-base)
@@ -280,6 +296,11 @@
   (let ((default-directory (oref loc root)))
     (cedet-idutils-expand-filename filesubstring)))
 
+(defmethod ede-locate-create/update-root-database :STATIC
+  ((loc ede-locate-idutils) root)
+  "Create or update the GNU Global database for the current project."
+  (cedet-idutils-create/update-database root))
+
 ;;; CSCOPE
 ;;
 (defclass ede-locate-cscope (ede-locate-base)
@@ -315,6 +336,11 @@
   (let ((default-directory (oref loc root)))
     (cedet-cscope-expand-filename filesubstring)))
 
+(defmethod ede-locate-create/update-root-database :STATIC
+  ((loc ede-locate-cscope) root)
+  "Create or update the GNU Global database for the current project."
+  (cedet-cscope-create/update-database root))
+
 (provide 'ede/locate)
 
 ;; Local variables:
--- a/lisp/cedet/ede/pconf.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/pconf.el	Wed Oct 13 22:40:51 2010 +0900
@@ -126,7 +126,11 @@
 
 	  (while compilation-in-progress
 	    (accept-process-output)
-	    (sit-for 1))
+	    ;; If sit for indicates that input is waiting, then
+	    ;; read and discard whatever it is that is going on.
+	    (when (not (sit-for 1))
+	      (read-event nil nil .1)
+	      ))
 
 	  (with-current-buffer "*compilation*"
 	    (goto-char (point-max))
--- a/lisp/cedet/ede/pmake.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/pmake.el	Wed Oct 13 22:40:51 2010 +0900
@@ -262,6 +262,18 @@
      (goto-char (point-max))))
 (put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
 
+(defmacro ede-pmake-insert-variable-once (varname &rest body)
+  "Add VARNAME into the current Makefile if it doesn't exist.
+Execute BODY in a location where a value can be placed."
+  `(let ((addcr t) (v ,varname))
+     (unless (re-search-backward (concat "^" v "\\s-*=") nil t)
+       (insert v "=")
+       ,@body
+       (if addcr (insert "\n"))
+       (goto-char (point-max)))
+     ))
+(put 'ede-pmake-insert-variable-once 'lisp-indent-function 1)
+
 ;;; SOURCE VARIABLE NAME CONSTRUCTION
 
 (defsubst ede-pmake-varname (obj)
@@ -369,10 +381,14 @@
 	  conf-table))
   (let* ((top "")
 	 (tmp this))
+    ;; Use relative paths for subdirs.
     (while (ede-parent-project tmp)
       (setq tmp (ede-parent-project tmp)
 	    top (concat "../" top)))
-    (insert "\ntop=" top))
+    ;; If this is the top, then use CURDIR.
+    (if (and (not (oref this metasubproject)) (string= top ""))
+	(insert "\ntop=\"$(CURDIR)\"/")
+      (insert "\ntop=" top)))
   (insert "\nede_FILES=" (file-name-nondirectory (oref this file)) " "
 	  (file-name-nondirectory (ede-proj-dist-makefile this)) "\n"))
 
@@ -425,14 +441,13 @@
 	(link (ede-proj-linkers this))
 	(name (ede-proj-makefile-target-name this))
 	(src (oref this source)))
+    (ede-proj-makefile-insert-object-variables (car comp) name src)
     (dolist (obj comp)
       (ede-compiler-only-once obj
 			      (ede-proj-makefile-insert-variables obj)))
-    (ede-proj-makefile-insert-object-variables (car comp) name src)
-    (while link
-      (ede-linker-only-once (car link)
-	(ede-proj-makefile-insert-variables (car link)))
-      (setq link (cdr link)))))
+    (dolist (linker link)
+      (ede-linker-only-once linker
+			    (ede-proj-makefile-insert-variables linker)))))
 
 (defmethod ede-proj-makefile-insert-automake-pre-variables
   ((this ede-proj-target))
--- a/lisp/cedet/ede/proj-archive.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-archive.el	Wed Oct 13 22:40:51 2010 +0900
@@ -29,7 +29,7 @@
 
 (defclass ede-proj-target-makefile-archive
   (ede-proj-target-makefile-objectcode)
-  ((availablelinkers :initform (ede-archive-linker)))
+  ((availablelinkers :initform '(ede-archive-linker)))
   "This target generates an object code archive.")
 
 (defvar ede-archive-linker
--- a/lisp/cedet/ede/proj-aux.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-aux.el	Wed Oct 13 22:40:51 2010 +0900
@@ -29,7 +29,7 @@
 
 ;;; Code:
 (defclass ede-proj-target-aux (ede-proj-target)
-  ((sourcetype :initform (ede-aux-source)))
+  ((sourcetype :initform '(ede-aux-source)))
   "This target consists of aux files such as READMEs and COPYING.")
 
 (defvar ede-aux-source
--- a/lisp/cedet/ede/proj-elisp.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-elisp.el	Wed Oct 13 22:40:51 2010 +0900
@@ -36,8 +36,8 @@
   ((menu :initform nil)
    (keybindings :initform nil)
    (phony :initform t)
-   (sourcetype :initform (ede-source-emacs))
-   (availablecompilers :initform (ede-emacs-compiler ede-xemacs-compiler))
+   (sourcetype :initform '(ede-source-emacs))
+   (availablecompilers :initform '(ede-emacs-compiler ede-xemacs-compiler))
    (aux-packages :initarg :aux-packages
 		 :initform nil
 		 :type list
@@ -259,7 +259,7 @@
 ;; Autoload generators
 ;;
 (defclass ede-proj-target-elisp-autoloads (ede-proj-target-elisp)
-  ((availablecompilers :initform (ede-emacs-cedet-autogen-compiler))
+  ((availablecompilers :initform '(ede-emacs-cedet-autogen-compiler))
    (aux-packages :initform ("cedet-autogen"))
    (phony :initform t)
    (autoload-file :initarg :autoload-file
--- a/lisp/cedet/ede/proj-info.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-info.el	Wed Oct 13 22:40:51 2010 +0900
@@ -31,9 +31,9 @@
 (defclass ede-proj-target-makefile-info (ede-proj-target-makefile)
   ((menu :initform nil)
    (keybindings :initform nil)
-   (availablecompilers :initform (ede-makeinfo-compiler
-				  ede-texi2html-compiler))
-   (sourcetype :initform (ede-makeinfo-source))
+   (availablecompilers :initform '(ede-makeinfo-compiler
+				   ede-texi2html-compiler))
+   (sourcetype :initform '(ede-makeinfo-source))
    (mainmenu :initarg :mainmenu
 	     :initform ""
 	     :type string
--- a/lisp/cedet/ede/proj-misc.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-misc.el	Wed Oct 13 22:40:51 2010 +0900
@@ -35,8 +35,8 @@
 
 ;; FIXME this isn't how you spell "miscellaneous". :(
 (defclass ede-proj-target-makefile-miscelaneous (ede-proj-target-makefile)
-  ((sourcetype :initform (ede-misc-source))
-   (availablecompilers :initform (ede-misc-compile))
+  ((sourcetype :initform '(ede-misc-source))
+   (availablecompilers :initform '(ede-misc-compile))
    (submakefile :initarg :submakefile
 		:initform ""
 		:type string
--- a/lisp/cedet/ede/proj-obj.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-obj.el	Wed Oct 13 22:40:51 2010 +0900
@@ -39,28 +39,32 @@
    (configuration-variables :initform ("debug" . (("CFLAGS" . "-g")
 						  ("LDFLAGS" . "-g"))))
    ;; @TODO - add an include path.
-   (availablecompilers :initform (ede-gcc-compiler
-				  ede-g++-compiler
-				  ede-gfortran-compiler
-				  ede-gfortran-module-compiler
-				  ;; More C and C++ compilers, plus
-				  ;; fortran or pascal can be added here
-				  ))
-   (availablelinkers :initform (ede-g++-linker
-				ede-cc-linker
-				ede-gfortran-linker
-				ede-ld-linker
-				;; Add more linker thingies here.
-				))
-   (sourcetype :initform (ede-source-c
-			  ede-source-c++
-			  ede-source-f77
-			  ede-source-f90
-			  ;; ede-source-other
-			  ;; This object should take everything that
-			  ;; gets compiled into objects like fortran
-			  ;; and pascal.
-			  ))
+   (availablecompilers :initform '(ede-gcc-compiler
+				   ede-g++-compiler
+				   ede-gfortran-compiler
+				   ede-gfortran-module-compiler
+				   ede-lex-compiler
+				   ede-yacc-compiler
+				   ;; More C and C++ compilers, plus
+				   ;; fortran or pascal can be added here
+				   ))
+   (availablelinkers :initform '(ede-g++-linker
+				 ede-cc-linker
+				 ede-ld-linker
+				 ede-gfortran-linker
+				 ;; Add more linker thingies here.
+				 ))
+   (sourcetype :initform '(ede-source-c
+			   ede-source-c++
+			   ede-source-f77
+			   ede-source-f90
+			   ede-source-lex
+			   ede-source-yacc
+			   ;; ede-source-other
+			   ;; This object should take everything that
+			   ;; gets compiled into objects like fortran
+			   ;; and pascal.
+			   ))
    )
   "Abstract class for Makefile based object code generating targets.
 Belonging to this group assumes you could make a .o from an element source
@@ -115,15 +119,15 @@
    :name "cc"
    :sourcetype '(ede-source-c)
    :variables  '(("C_LINK" . "$(CC) $(CFLAGS) $(LDFLAGS) -L."))
-   :commands '("$(C_LINK) -o $@ $^")
+   :commands '("$(C_LINK) -o $@ $^ $(LDDEPS)")
    :objectextention "")
   "Linker for C sourcecode.")
 
 (defvar ede-source-c++
   (ede-sourcecode "ede-source-c++"
 		  :name "C++"
-		  :sourcepattern "\\.\\(cpp\\|cc\\|cxx\\)$"
-		  :auxsourcepattern "\\.\\(hpp\\|hh?\\|hxx\\)$"
+		  :sourcepattern "\\.\\(c\\(pp?\\|c\\|xx\\|++\\)\\|C\\\(PP\\)?\\)$"
+		  :auxsourcepattern "\\.\\(hpp?\\|hh?\\|hxx\\|H\\)$"
 		  :garbagepattern '("*.o" "*.obj" ".deps/*.P" ".lo"))
   "C++ source code definition.")
 
@@ -158,11 +162,43 @@
    ;; Only use this linker when c++ exists.
    :sourcetype '(ede-source-c++)
    :variables  '(("CXX_LINK" . "$(CXX) $(CFLAGS) $(LDFLAGS) -L."))
-   :commands '("$(CXX_LINK) -o $@ $^")
+   :commands '("$(CXX_LINK) -o $@ $^ $(LDDEPS)")
    :autoconf '("AC_PROG_CXX")
    :objectextention "")
   "Linker needed for c++ programs.")
 
+;;; LEX
+(defvar ede-source-lex
+  (ede-sourcecode "ede-source-lex"
+		  :name "lex"
+		  :sourcepattern "\\.l\\(l\\|pp\\|++\\)")
+  "Lex source code definition.
+No garbage pattern since it creates C or C++ code.")
+
+(defvar ede-lex-compiler
+  (ede-object-compiler
+   "ede-lex-compiler"
+   ;; Can we support regular makefiles too??
+   :autoconf '("AC_PROG_LEX")
+   :sourcetype '(ede-source-lex))
+  "Compiler used for Lexical source.")
+
+;;; YACC
+(defvar ede-source-yacc
+  (ede-sourcecode "ede-source-yacc"
+		  :name "yacc"
+		  :sourcepattern "\\.y\\(y\\|pp\\|++\\)")
+  "Yacc source code definition.
+No garbage pattern since it creates C or C++ code.")
+
+(defvar ede-yacc-compiler
+  (ede-object-compiler
+   "ede-yacc-compiler"
+   ;; Can we support regular makefiles too??
+   :autoconf '("AC_PROG_YACC")
+   :sourcetype '(ede-source-yacc))
+  "Compiler used for yacc/bison grammar files source.")
+
 ;;; Fortran Compiler/Linker
 ;;
 ;; Contributed by David Engster
@@ -233,7 +269,7 @@
    :name "ld"
    :variables  '(("LD" . "ld")
 		 ("LD_LINK" . "$(LD) $(LDFLAGS) -L."))
-   :commands '("$(LD_LINK) -o $@ $^")
+   :commands '("$(LD_LINK) -o $@ $^ $(LDDEPS)")
    :objectextention "")
   "Linker needed for c++ programs.")
 
--- a/lisp/cedet/ede/proj-prog.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-prog.el	Wed Oct 13 22:40:51 2010 +0900
@@ -34,14 +34,14 @@
 ;;; Code:
 (defclass ede-proj-target-makefile-program
   (ede-proj-target-makefile-objectcode)
-  ((ldlibs :initarg :ldlibs
-	   :initform nil
-	   :type list
-	   :custom (repeat (string :tag "Library"))
-	   :documentation
-	   "Libraries, such as \"m\" or \"Xt\" which this program depends on.
-The linker flag \"-l\" is automatically prepended.  Do not include a \"lib\"
-prefix, or a \".so\" suffix.
+  ((ldlibs-local :initarg :ldlibs-local
+		 :initform nil
+		 :type list
+		 :custom (repeat (string :tag "Local Library"))
+		 :documentation
+	   "Libraries that are part of this project.
+The full path to these libraries should be specified, such as:
+../lib/libMylib.la  or ../ar/myArchive.a
 
 Note: Currently only used for Automake projects."
 	   )
@@ -51,10 +51,21 @@
 	    :custom (repeat (string :tag "Link Flag"))
 	    :documentation
 	    "Additional flags to add when linking this target.
-Use ldlibs to add addition libraries.  Use this to specify specific
-options to the linker.
+Use this to specify specific options to the linker.
+A Common use may be to add -L to specify in-project locations of libraries
+specified with ldlibs.")
+   (ldlibs :initarg :ldlibs
+	   :initform nil
+	   :type list
+	   :custom (repeat (string :tag "Library"))
+	   :documentation
+	   "Libraries, such as \"m\" or \"Xt\" which this program depends on.
+The linker flag \"-l\" is automatically prepended.  Do not include a \"lib\"
+prefix, or a \".so\" suffix.
+Use the 'ldflags' slot to specify where in-project libraries might be.
 
-Note: Not currently used.  This bug needs to be fixed.")
+Note: Currently only used for Automake projects."
+	   )
    )
    "This target is an executable program.")
 
@@ -70,27 +81,24 @@
   "Insert bin_PROGRAMS variables needed by target THIS."
   (ede-pmake-insert-variable-shared
       (concat (ede-name this) "_LDADD")
-    (mapc (lambda (c) (insert " -l" c)) (oref this ldlibs)))
-  ;; For other targets THIS depends on
-  ;;
-  ;; NOTE: FIX THIS
-  ;;
-  ;;(ede-pmake-insert-variable-shared
-  ;;    (concat (ede-name this) "_DEPENDENCIES")
-  ;;  (mapcar (lambda (d) (insert d)) (oref this FOOOOOOOO)))
+    (mapc (lambda (l) (insert " " l)) (oref this ldlibs-local))
+    (mapc (lambda (c) (insert " " c)) (oref this ldflags))
+    (when (oref this ldlibs)
+      (mapc (lambda (d) (insert " -l" d)) (oref this ldlibs)))
+    )
   (call-next-method))
 
-(defmethod ede-proj-makefile-insert-rules ((this ede-proj-target-makefile-program))
-  "Insert rules needed by THIS target."
-  (let ((ede-proj-compiler-object-linkflags
-	 (mapconcat 'identity (oref this ldflags) " ")))
+(defmethod ede-proj-makefile-insert-variables ((this ede-proj-target-makefile-program))
+  "Insert variables needed by the compiler THIS."
+  (call-next-method)
+  (let ((lf (mapconcat 'identity (oref this ldflags) " ")))
     (with-slots (ldlibs) this
       (if ldlibs
-	  (setq ede-proj-compiler-object-linkflags
-		(concat ede-proj-compiler-object-linkflags
-			" -l"
-			(mapconcat 'identity ldlibs " -l")))))
-    (call-next-method)))
+	  (setq lf
+		(concat lf " -l" (mapconcat 'identity ldlibs " -l")))))
+    ;; LDFLAGS as needed.
+    (when (and lf (not (string= "" lf)))
+      (ede-pmake-insert-variable-once "LDDEPS" (insert lf)))))
 
 (defmethod project-debug-target ((obj ede-proj-target-makefile-program))
   "Debug a program target OBJ."
--- a/lisp/cedet/ede/proj-shared.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj-shared.el	Wed Oct 13 22:40:51 2010 +0900
@@ -34,15 +34,15 @@
 ;;; Code:
 (defclass ede-proj-target-makefile-shared-object
   (ede-proj-target-makefile-program)
-  ((availablecompilers :initform (ede-gcc-libtool-shared-compiler
-				  ;;ede-gcc-shared-compiler
-				  ede-g++-libtool-shared-compiler
-				  ;;ede-g++-shared-compiler
-				  ))
-   (availablelinkers :initform (ede-cc-linker-libtool
-				ede-g++-linker-libtool
-				;; Add more linker thingies here.
-				))
+  ((availablecompilers :initform '(ede-gcc-libtool-shared-compiler
+				   ;;ede-gcc-shared-compiler
+				   ede-g++-libtool-shared-compiler
+				   ;;ede-g++-shared-compiler
+				   ))
+   (availablelinkers :initform '(ede-cc-linker-libtool
+				 ede-g++-linker-libtool
+				 ;; Add more linker thingies here.
+				 ))
    (ldflags :custom (repeat (string :tag "Libtool flag"))
 	    :documentation
 	    "Additional flags to add when linking this shared library.
@@ -124,7 +124,7 @@
 	 :rules (list (ede-makefile-rule
 		       "c++-inference-rule-libtool"
 		       :target "%.o"
-		       :dependencies "%.c"
+		       :dependencies "%.cpp"
 		       :rules '("@echo '$(LTCOMPILE) -o $@ $<'; \\"
 				"$(LTCOMPILE) -o $@ $<"
 				)
--- a/lisp/cedet/ede/proj.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/proj.el	Wed Oct 13 22:40:51 2010 +0900
@@ -29,7 +29,6 @@
 ;; rebuild.  The targets provided in ede-proj can be augmented with
 ;; additional target types inherited directly from `ede-proj-target'.
 
-;; (eval-and-compile '(require 'ede))
 (require 'ede/proj-comp)
 (require 'ede/make)
 
@@ -336,7 +335,9 @@
     (or (string= (file-name-nondirectory (oref this file)) f)
 	(string= (ede-proj-dist-makefile this) f)
 	(string-match "Makefile\\(\\.\\(in\\|am\\)\\)?$" f)
-	(string-match "config\\(ure\\.in\\|\\.stutus\\)?$" f)
+	(string-match "config\\(ure\\.\\(in\\|ac\\)\\|\\.status\\)?$" f)
+	(string-match "config.h\\(\\.in\\)?" f)
+	(member f '("AUTHORS" "NEWS" "COPYING" "INSTALL" "README"))
 	)))
 
 (defmethod ede-buffer-mine ((this ede-proj-target) buffer)
@@ -398,11 +399,11 @@
 	     :source nil)))
 
 (defmethod project-delete-target ((this ede-proj-target))
-  "Delete the current target THIS from it's parent project."
+  "Delete the current target THIS from its parent project."
   (let ((p (ede-current-project))
 	(ts (oref this source)))
     ;; Loop across all sources.  If it exists in a buffer,
-    ;; clear it's object.
+    ;; clear its object.
     (while ts
       (let* ((default-directory (oref this path))
 	     (b (get-file-buffer (car ts))))
@@ -413,7 +414,7 @@
 		    (setq ede-object nil)
 		    (ede-apply-object-keymap))))))
       (setq ts (cdr ts)))
-    ;; Remove THIS from it's parent.
+    ;; Remove THIS from its parent.
     ;; The two vectors should be pointer equivalent.
     (oset p targets (delq this (oref p targets)))
     (ede-proj-save (ede-current-project))))
@@ -447,15 +448,13 @@
 
 (defmethod project-make-dist ((this ede-proj-project))
   "Build a distribution for the project based on THIS target."
-  ;; I'm a lazy bum, so I'll make a makefile for doing this sort
-  ;; of thing, and rely only on that small section of code.
   (let ((pm (ede-proj-dist-makefile this))
 	(df (project-dist-files this)))
     (if (and (file-exists-p (car df))
 	     (not (y-or-n-p "Dist file already exists.  Rebuild? ")))
 	(error "Try `ede-update-version' before making a distribution"))
     (ede-proj-setup-buildenvironment this)
-    (if (string= (file-name-nondirectory pm) "Makefile.am")
+    (if (ede-proj-automake-p this)
 	(setq pm (expand-file-name "Makefile"
 				   (file-name-directory pm))))
     (compile (concat ede-make-command " -f " pm " dist"))))
@@ -473,7 +472,7 @@
   (let ((pm (ede-proj-dist-makefile proj))
 	(default-directory (file-name-directory (oref proj file))))
     (ede-proj-setup-buildenvironment proj)
-    (if (string= (file-name-nondirectory pm) "Makefile.am")
+    (if (ede-proj-automake-p proj)
 	(setq pm (expand-file-name "Makefile"
 				   (file-name-directory pm))))
     (compile (concat ede-make-command" -f " pm " all"))))
@@ -539,7 +538,15 @@
 	    (if (ede-want-any-source-files-p (symbol-value (car st)) sources)
 		(let ((c (ede-proj-find-compiler avail (car st))))
 		  (if c (setq comp (cons c comp)))))
-	    (setq st (cdr st)))))
+	    (setq st (cdr st)))
+	  ;; Provide a good error msg.
+	  (unless comp
+	    (error "Could not find compiler match for source code extension \"%s\".
+You may need to add support for this type of file."
+		   (if sources
+		       (file-name-extension (car sources))
+		     "")))
+	  ))
       ;; Return the disovered compilers
       comp)))
 
@@ -664,18 +671,9 @@
   (let ((root (or (ede-project-root this) this))
 	)
     (setq ede-projects (delq root ede-projects))
-    (ede-proj-load (ede-project-root-directory root))
+    (ede-load-project-file (ede-project-root-directory root))
     ))
 
-(defmethod project-rescan ((this ede-proj-target) readstream)
-  "Rescan target THIS from the read list READSTREAM."
-  (setq readstream (cdr (cdr readstream))) ;; constructor/name
-  (while readstream
-    (let ((tag (car readstream))
-	  (val (car (cdr readstream))))
-      (eieio-oset this tag val))
-    (setq readstream (cdr (cdr readstream)))))
-
 (provide 'ede/proj)
 
 ;; arch-tag: eb8a40f8-0d2c-41c4-b273-af04101d1cdf
--- a/lisp/cedet/ede/project-am.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/project-am.el	Wed Oct 13 22:40:51 2010 +0900
@@ -30,27 +30,19 @@
 ;; fashion.
 ;;
 ;; project-am uses the structure defined in all good GNU projects with
-;; the Automake file as it's base template, and then maintains that
+;; the Automake file as its base template, and then maintains that
 ;; information during edits, automatically updating the automake file
 ;; where appropriate.
 
-
-;; (eval-and-compile
-;;   ;; Compatibility for makefile mode.
-;;   (condition-case nil
-;;       (require 'makefile "make-mode")
-;;     (error (require 'make-mode "make-mode")))
-
-;;   ;; Requiring the .el files prevents incomplete builds.
-;;   (require 'eieio "eieio.el")
-;;   (require 'ede "ede.el"))
-
 (require 'make-mode)
 (require 'ede)
 (require 'ede/make)
 (require 'ede/makefile-edit)
+(require 'semantic/find) ;; for semantic-find-tags-by-...
+(require 'ede/autoconf-edit)
 
 (declare-function autoconf-parameters-for-macro "ede/autoconf-edit")
+(declare-function ede-shell-run-something "ede/shell")
 (eval-when-compile (require 'compile))
 
 ;;; Code:
@@ -104,7 +96,7 @@
     ;; ("ltlibcustom" project-am-lib ".*?_LTLIBRARIES" t)
     )
   "Alist of type names and the type of object to create for them.
-Each entry is of th form:
+Each entry is of the form:
   (EMACSNAME CLASS AUTOMAKEVAR INDIRECT)
 where EMACSNAME is a name for Emacs to use.
 CLASS is the EDE target class to represent the target.
@@ -113,6 +105,23 @@
 INDIRECT is optional.  If it is non-nil, then the variable in
 question lists other variables that need to be looked up.")
 
+
+(defconst project-am-meta-type-alist
+  '((project-am-program "_PROGRAMS$" t)
+    (project-am-lib "_\\(LIBS\\|LIBRARIES\\|LTLIBRARIES\\)$" t)
+
+    ;; direct primary target use a dummy object (man target)
+    ;; update to: * 3.3 Uniform  in automake-1.11 info node.
+    (project-am-man "_\\(DATA\\|HEADERS\\|PYTHON\\|JAVA\\|SCRIPTS\\|MANS\\|TEXINFOS\\)$" nil)
+    )
+  "Alist of meta-target type, each entry has form:
+     (CLASS REGEXPVAR INDIRECT)
+where CLASS is the EDE target class for target.
+REGEXPVAR is the regexp used in `semantic-find-tags-by-name-regexp'.
+INDIRECT is optional. If it is non-nil, then the variable in it have
+other meta-variable based on this name.")
+
+
 (defclass project-am-target (ede-target)
   nil
   "Base target class for everything in project-am.")
@@ -291,16 +300,6 @@
       ;; Rescan the object in this makefile.
       (project-rescan ede-object))))
 
-;(defun project-am-rescan-toplevel ()
-;  "Rescan all projects in which the current buffer resides."
-;  (interactive)
-;  (let* ((tlof (project-am-find-topmost-level default-directory))
-;	 (tlo (project-am-load tlof))
-;	 (ede-deep-rescan t))  ; scan deep in this case.
-;    ;; tlo is the top level object for whatever file we are in
-;    ;; or nil.  If we have an object, call the rescan method.
-;    (if tlo (project-am-rescan tlo))))
-
 ;;
 ;; NOTE TO SELF
 ;;
@@ -404,6 +403,7 @@
 
 (defmethod project-run-target ((obj project-am-objectcode))
   "Run the current project target in comint buffer."
+  (require 'ede/shell)
   (let ((tb (get-buffer-create " *padt*"))
 	(dd (oref obj path))
 	(cmd nil))
@@ -427,45 +427,17 @@
 
 ;;; Project loading and saving
 ;;
-(defun project-am-load (project &optional rootproj)
-  "Read an automakefile PROJECT into our data structure.
-Make sure that the tree down to our makefile is complete so that there
-is cohesion in the project.  Return the project file (or sub-project).
+(defun project-am-load (directory &optional rootproj)
+  "Read an automakefile DIRECTORY into our data structure.
 If a given set of projects has already been loaded, then do nothing
 but return the project for the directory given.
 Optional ROOTPROJ is the root EDE project."
-  ;; @TODO - rationalize this to the newer EDE way of doing things.
-  (setq project (expand-file-name project))
-  (let* ((ede-constructing t)
-	 (fn (project-am-find-topmost-level (file-name-as-directory project)))
-	 (amo nil)
-	 (trimmed (if (string-match (regexp-quote fn)
-				    project)
-		      (replace-match "" t t project)
-		    ""))
-	 (subdir nil))
-    (setq amo (object-assoc (expand-file-name "Makefile.am" fn)
-			    'file ede-projects))
-    (if amo
-	(error "Synchronous error in ede/project-am objects")
-      (let ((project-am-constructing t))
-	(setq amo (project-am-load-makefile fn))))
-    (if (not amo)
-	nil
-      ;; Now scan down from amo, and find the current directory
-      ;; from the PROJECT file.
-      (while (< 0 (length trimmed))
-	(if (string-match "\\([a-zA-Z0-9.-]+\\)/" trimmed)
-	    (setq subdir (match-string 0 trimmed)
-		  trimmed (replace-match "" t t trimmed))
-	  (error "Error scanning down path for project"))
-	(setq amo (project-am-subtree
-		   amo
-		   (expand-file-name "Makefile.am"
-				     (expand-file-name subdir fn)))
-	      fn (expand-file-name subdir fn)))
-      amo)
-    ))
+  (let* ((ede-constructiong t)
+	 (amo (object-assoc (expand-file-name "Makefile.am" directory)
+			    'file ede-projects)))
+    (when (not amo)
+      (setq amo (project-am-load-makefile directory)))
+    amo))
 
 (defun project-am-find-topmost-level (dir)
   "Find the topmost automakefile starting with DIR."
@@ -486,17 +458,19 @@
 	  (fb nil)
 	  (kb (get-file-buffer fn)))
      (if (not (file-exists-p fn))
-	nil
-      (save-excursion
-	(if kb (setq fb kb)
-	  ;; We need to find-file this thing, but don't use
-	  ;; any semantic features.
-	  (let ((semantic-init-hook nil))
-	    (setq fb (find-file-noselect fn)))
-	  )
-	(set-buffer fb)
-	(prog1 ,@forms
-	  (if (not kb) (kill-buffer (current-buffer))))))))
+	 nil
+       (save-excursion
+	 (if kb (setq fb kb)
+	   ;; We need to find-file this thing, but don't use
+	   ;; any semantic features.
+	   (let ((semantic-init-hook nil)
+		 (recentf-exclude '( (lambda (f) t) ))
+		 )
+	     (setq fb (find-file-noselect fn)))
+	   )
+	 (set-buffer fb)
+	 (prog1 ,@forms
+	   (if (not kb) (kill-buffer (current-buffer))))))))
 (put 'project-am-with-makefile-current 'lisp-indent-function 1)
 
 (add-hook 'edebug-setup-hook
@@ -505,14 +479,18 @@
 	      (form def-body))))
 
 
-(defun project-am-load-makefile (path)
+(defun project-am-load-makefile (path &optional suggestedname)
   "Convert PATH into a project Makefile, and return its project object.
-It does not check for existing project objects.  Use `project-am-load'."
+It does not check for existing project objects.  Use `project-am-load'.
+Optional argument SUGGESTEDNAME will be the project name.
+This is used when subprojects are made in named subdirectories."
   (project-am-with-makefile-current path
     (if (and ede-object (project-am-makefile-p ede-object))
 	ede-object
       (let* ((pi (project-am-package-info path))
-	     (pn (or (nth 0 pi) (project-am-last-dir fn)))
+	     (sfn (when suggestedname
+		    (project-am-last-dir suggestedname)))
+	     (pn (or sfn (nth 0 pi) (project-am-last-dir fn)))
 	     (ver (or (nth 1 pi) "0.0"))
 	     (bug (nth 2 pi))
 	     (cof (nth 3 pi))
@@ -530,21 +508,6 @@
 	ampf))))
 
 ;;; Methods:
-(defmethod ede-find-target ((amf project-am-makefile) buffer)
-  "Fetch the target belonging to BUFFER."
-  (or (call-next-method)
-      (let ((targ (oref amf targets))
-	    (sobj (oref amf subproj))
-	    (obj nil))
-	(while (and targ (not obj))
-	  (if (ede-buffer-mine (car targ) buffer)
-	      (setq obj (car targ)))
-	  (setq targ (cdr targ)))
-	(while (and sobj (not obj))
-	  (setq obj (project-am-buffer-object (car sobj) buffer)
-		sobj (cdr sobj)))
-	obj)))
-
 (defmethod project-targets-for-file ((proj project-am-makefile))
   "Return a list of targets the project PROJ."
   (oref proj targets))
@@ -554,44 +517,110 @@
 CURRPROJ is the current project being scanned.
 DIR is the directory to apply to new targets."
   (let* ((otargets (oref currproj targets))
+	 ;; `ntargets' results in complete targets list
+	 ;; not only the new targets by diffing.
 	 (ntargets nil)
 	 (tmp nil)
 	 )
-      (mapc
-       ;; Map all the different types
-       (lambda (typecar)
-	 (let ((macro (nth 2 typecar))
-	       (class (nth 1 typecar))
-	       (indirect (nth 3 typecar))
-	       ;(name (car typecar))
-	       )
-	   (if indirect
-	       ;; Map all the found objects
-	       (mapc (lambda (lstcar)
-		       (setq tmp (object-assoc lstcar 'name otargets))
-		       (when (not tmp)
-			 (setq tmp (apply class lstcar :name lstcar
-					  :path dir nil)))
-		       (project-rescan tmp)
-		       (setq ntargets (cons tmp ntargets)))
-		     (makefile-macro-file-list macro))
-	     ;; Non-indirect will have a target whos sources
-	     ;; are actual files, not names of other targets.
-	     (let ((files (makefile-macro-file-list macro)))
-	       (when files
-		 (setq tmp (object-assoc macro 'name otargets))
-		 (when (not tmp)
-		   (setq tmp (apply class macro :name macro
+
+    (mapc
+     ;; Map all the different types
+     (lambda (typecar)
+       (let ((macro (nth 2 typecar))
+	     (class (nth 1 typecar))
+	     (indirect (nth 3 typecar))
+	     )
+	 (if indirect
+	     ;; Map all the found objects
+	     (mapc (lambda (lstcar)
+		     (setq tmp (object-assoc lstcar 'name otargets))
+		     (when (not tmp)
+		       (setq tmp (apply class lstcar :name lstcar
+					:path dir nil)))
+		     (project-rescan tmp)
+		     (setq ntargets (cons tmp ntargets)))
+		   (makefile-macro-file-list macro))
+	   ;; Non-indirect will have a target whos sources
+	   ;; are actual files, not names of other targets.
+	   (let ((files (makefile-macro-file-list macro)))
+	     (when files
+	       (setq tmp (object-assoc macro 'name otargets))
+	       (when (not tmp)
+		 (setq tmp (apply class macro :name macro
+				  :path dir nil)))
+	       (project-rescan tmp)
+	       (setq ntargets (cons tmp ntargets))
+	       ))
+	   )
+	 ))
+     project-am-type-alist)
+
+    ;; At now check variables for meta-target regexp
+    ;; We have to check ntargets to avoid useless rescan.
+    ;; Also we have check otargets to prevent duplication.
+    (mapc
+     (lambda (typecar)
+       (let ((class (nth 0 typecar))
+	     (metaregex (nth 1 typecar))
+	     (indirect (nth 2 typecar)))
+	 (if indirect
+	     ;; Map all the found objects
+	     (mapc
+	      (lambda (lstcar)
+		(unless (object-assoc lstcar 'name ntargets)
+		  (or
+		   (setq tmp (object-assoc lstcar 'name otargets))
+		   (setq tmp (apply class lstcar :name lstcar
 				    :path dir nil)))
-		 (project-rescan tmp)
-		 (setq ntargets (cons tmp ntargets))
-		 ))
-	     )
-	   ))
-       project-am-type-alist)
-      ntargets))
+		  (project-rescan tmp)
+		  (setq ntargets (cons tmp ntargets))))
+	      ;; build a target list to map over
+	      (let (atargets)
+		(dolist (TAG
+			 (semantic-find-tags-by-name-regexp
+			  metaregex (semantic-find-tags-by-class
+				     'variable (semantic-fetch-tags))))
+		  ;; default-value have to be a list
+		  (when (cadr (assoc ':default-value TAG))
+		    (setq atargets
+			  (append
+			   (nreverse (cadr (assoc ':default-value TAG)))
+			   atargets))))
+		(nreverse atargets)))
 
-(defmethod project-rescan ((this project-am-makefile))
+	   ;; else not indirect, TODO: FIX various direct meta type in a sane way.
+	   (dolist (T (semantic-find-tags-by-name-regexp
+		       metaregex (semantic-find-tags-by-class
+				  'variable (semantic-fetch-tags))))
+	     (unless (setq tmp (object-assoc (car T) 'name ntargets))
+	       (or (setq tmp (object-assoc (car T) 'name otargets))
+		   ;; we are really new
+		   (setq tmp (apply class (car T) :name (car T)
+				    :path dir nil)))
+	       (project-rescan tmp)
+	       (setq ntargets (cons tmp ntargets))))
+	   )))
+     project-am-meta-type-alist)
+    ntargets))
+
+(defun project-am-expand-subdirlist (place subdirs)
+  "Store in PLACE the SUBDIRS expanded from variables.
+Strip out duplicates, and recurse on variables."
+  (mapc (lambda (sp)
+	  (let ((var (makefile-extract-varname-from-text sp)))
+	    (if var
+		;; If it is a variable, expand that variable, and keep going.
+		(project-am-expand-subdirlist
+		 place (makefile-macro-file-list var))
+	      ;; Else, add SP in if it isn't a dup.
+	      (if (member sp (symbol-value place))
+		  nil ; don't do it twice.
+		(set place (cons sp (symbol-value place))) ;; add
+		))))
+	subdirs)
+  )
+
+(defmethod project-rescan ((this project-am-makefile) &optional suggestedname)
   "Rescan the makefile for all targets and sub targets."
   (project-am-with-makefile-current (file-name-directory (oref this file))
     ;;(message "Scanning %s..." (oref this file))
@@ -601,10 +630,10 @@
 	   (bug (nth 2 pi))
 	   (cof (nth 3 pi))
 	   (osubproj (oref this subproj))
-	   (csubproj (or
-		      ;; If DIST_SUBDIRS doesn't exist, then go for the
-		      ;; static list of SUBDIRS.  The DIST version should
-		      ;; contain SUBDIRS plus extra stuff.
+	   ;; 1/30/10 - We need to append these two lists together,
+	   ;; then strip out duplicates.  Expanding this list (via
+	   ;; references to other variables should also strip out dups
+	   (csubproj (append
 		      (makefile-macro-file-list "DIST_SUBDIRS")
 		      (makefile-macro-file-list "SUBDIRS")))
 	   (csubprojexpanded nil)
@@ -615,79 +644,57 @@
 	   (tmp nil)
 	   (ntargets (project-am-scan-for-targets this dir))
 	   )
-
-      (and pn (string= (directory-file-name
-			(oref this directory))
-		       (directory-file-name
-			(project-am-find-topmost-level
-			 (oref this directory))))
-	   (oset this name pn)
-	   (and pv (oset this version pv))
-	   (and bug (oset this mailinglist bug))
-	   (oset this configureoutputfiles cof))
-
-;      ;; LISP is different.  Here there is only one kind of lisp (that I know of
-;      ;; anyway) so it doesn't get mapped when it is found.
-;      (if (makefile-move-to-macro "lisp_LISP")
-; 	  (let ((tmp (project-am-lisp "lisp"
-; 				      :name "lisp"
-; 				      :path dir)))
-; 	    (project-rescan tmp)
-; 	    (setq ntargets (cons tmp ntargets))))
-;
+      (if suggestedname
+	  (oset this name (project-am-last-dir suggestedname))
+	;; Else, setup toplevel project info.
+	(and pn (string= (directory-file-name
+			  (oref this directory))
+			 (directory-file-name
+			  (project-am-find-topmost-level
+			   (oref this directory))))
+	     (oset this name pn)
+	     (and pv (oset this version pv))
+	     (and bug (oset this mailinglist bug))
+	     (oset this configureoutputfiles cof)))
       ;; Now that we have this new list, chuck the old targets
       ;; and replace it with the new list of targets I just created.
       (oset this targets (nreverse ntargets))
       ;; We still have a list of targets.  For all buffers, make sure
       ;; their object still exists!
-
       ;; FIGURE THIS OUT
-
-      (mapc (lambda (sp)
- 	      (let ((var (makefile-extract-varname-from-text sp))
- 		    )
- 		(if (not var)
- 		    (setq csubprojexpanded (cons sp csubprojexpanded))
- 		  ;; If it is a variable, expand that variable, and keep going.
- 		  (let ((varexp (makefile-macro-file-list var)))
- 		    (dolist (V varexp)
- 		      (setq csubprojexpanded (cons V csubprojexpanded)))))
- 		))
- 	    csubproj)
-
+      (project-am-expand-subdirlist 'csubprojexpanded csubproj)
       ;; Ok, now lets look at all our sub-projects.
       (mapc (lambda (sp)
- 	      (let* ((subdir (file-name-as-directory
- 			      (expand-file-name
- 			       sp (file-name-directory (oref this :file)))))
- 		     (submake (expand-file-name
- 			       "Makefile.am"
- 			       subdir)))
- 		(if (string= submake (oref this :file))
- 		    nil	;; don't recurse.. please!
-
- 		  ;; For each project id found, see if we need to recycle,
- 		  ;; and if we do not, then make a new one.  Check the deep
- 		  ;; rescan value for behavior patterns.
- 		  (setq tmp (object-assoc
- 			     submake
- 			     'file osubproj))
- 		  (if (not tmp)
- 		      (setq tmp
- 			    (condition-case nil
- 				;; In case of problem, ignore it.
- 				(project-am-load-makefile subdir)
- 			      (error nil)))
- 		    ;; If we have tmp, then rescan it only if deep mode.
- 		    (if ede-deep-rescan
- 			(project-rescan tmp)))
- 		  ;; Tac tmp onto our list of things to keep, but only
- 		  ;; if tmp was found.
- 		  (when tmp
- 		    ;;(message "Adding %S" (object-print tmp))
- 		    (setq nsubproj (cons tmp nsubproj)))))
- 	      )
- 	    (nreverse csubprojexpanded))
+	      (let* ((subdir (file-name-as-directory
+			      (expand-file-name
+			       sp (file-name-directory (oref this :file)))))
+		     (submake (expand-file-name
+			       "Makefile.am"
+			       subdir)))
+		(if (string= submake (oref this :file))
+		    nil	;; don't recurse.. please!
+		  ;; For each project id found, see if we need to recycle,
+		  ;; and if we do not, then make a new one.  Check the deep
+		  ;; rescan value for behavior patterns.
+		  (setq tmp (object-assoc
+			     submake
+			     'file osubproj))
+		  (if (not tmp)
+		      (setq tmp
+			    (condition-case nil
+				;; In case of problem, ignore it.
+				(project-am-load-makefile subdir subdir)
+			      (error nil)))
+		    ;; If we have tmp, then rescan it only if deep mode.
+		    (if ede-deep-rescan
+			(project-rescan tmp subdir)))
+		  ;; Tac tmp onto our list of things to keep, but only
+		  ;; if tmp was found.
+		  (when tmp
+		    ;;(message "Adding %S" (object-print tmp))
+		    (setq nsubproj (cons tmp nsubproj)))))
+	      )
+	    (nreverse csubprojexpanded))
       (oset this subproj nsubproj)
       ;; All elements should be updated now.
       )))
@@ -696,12 +703,16 @@
 (defmethod project-rescan ((this project-am-program))
   "Rescan object THIS."
   (oset this :source (makefile-macro-file-list (project-am-macro this)))
+  (unless (oref this :source)
+    (oset this :source (list (concat (oref this :name) ".c"))))
   (oset this :ldadd (makefile-macro-file-list
 		     (concat (oref this :name) "_LDADD"))))
 
 (defmethod project-rescan ((this project-am-lib))
   "Rescan object THIS."
-  (oset this :source (makefile-macro-file-list (project-am-macro this))))
+  (oset this :source (makefile-macro-file-list (project-am-macro this)))
+  (unless (oref this :source)
+    (oset this :source (list (concat (file-name-sans-extension (oref this :name)) ".c")))))
 
 (defmethod project-rescan ((this project-am-texinfo))
   "Rescan object THIS."
@@ -726,19 +737,6 @@
 (defmethod project-rescan ((this project-am-extra-dist))
   "Rescan object THIS."
   (oset this :source (makefile-macro-file-list "EXTRA_DIST")))
-  ;; NOTE: The below calls 'file' then checks that it is some sort of
-  ;; text file.  The  file command may not be available on all platforms
-  ;; and some files may not exist yet.  (ie - auto-generated)
-
-  ;;(mapc
-  ;; (lambda (f)
-  ;;   ;; prevent garbage to be parsed, could we use :aux ?
-  ;;   (if (and (not (member f (oref this :source)))
-  ;;	      (string-match-p "ASCII\\|text"
-  ;;			      (shell-command-to-string
-  ;;			       (concat "file " f))))
-  ;;	 (oset this :source (cons f (oref this :source)))))
-  ;; (makefile-macro-file-list "EXTRA_DIST")))
 
 (defmethod project-am-macro ((this project-am-objectcode))
   "Return the default macro to 'edit' for this object type."
@@ -808,22 +806,24 @@
 
 (defmethod ede-buffer-mine ((this project-am-objectcode) buffer)
   "Return t if object THIS lays claim to the file in BUFFER."
-  (member (file-name-nondirectory (buffer-file-name buffer))
+  (member (file-relative-name (buffer-file-name buffer) (oref this :path))
 	  (oref this :source)))
 
 (defmethod ede-buffer-mine ((this project-am-texinfo) buffer)
   "Return t if object THIS lays claim to the file in BUFFER."
-  (let ((bfn (buffer-file-name buffer)))
-    (or (string= (oref this :name)  (file-name-nondirectory bfn))
-	(member (file-name-nondirectory bfn) (oref this :include)))))
+  (let ((bfn (file-relative-name (buffer-file-name buffer)
+				 (oref this :path))))
+    (or (string= (oref this :name)  bfn)
+	(member bfn (oref this :include)))))
 
 (defmethod ede-buffer-mine ((this project-am-man) buffer)
   "Return t if object THIS lays claim to the file in BUFFER."
-  (string= (oref this :name) (buffer-file-name buffer)))
+  (string= (oref this :name)
+	   (file-relative-name (buffer-file-name buffer) (oref this :path))))
 
 (defmethod ede-buffer-mine ((this project-am-lisp) buffer)
   "Return t if object THIS lays claim to the file in BUFFER."
-  (member (file-name-nondirectory (buffer-file-name buffer))
+  (member (file-relative-name (buffer-file-name buffer) (oref this :path))
 	  (oref this :source)))
 
 (defmethod project-am-subtree ((ampf project-am-makefile) subdir)
@@ -954,7 +954,6 @@
     (cond
      ;; Try configure.in or configure.ac
      (conf-in
-      (require 'ede/autoconf-edit)
       (project-am-with-config-current conf-in
 	(let ((aci (autoconf-parameters-for-macro "AC_INIT"))
 	      (aia (autoconf-parameters-for-macro "AM_INIT_AUTOMAKE"))
@@ -980,7 +979,7 @@
 				(t acf))))
 	    (if (> (length outfiles) 1)
 		(setq configfiles outfiles)
-	      (setq configfiles (split-string (car outfiles) " " t)))
+	      (setq configfiles (split-string (car outfiles) "\\s-" t)))
 	    )
 	  ))
       )
@@ -1005,6 +1004,18 @@
     (when top (setq dir (oref top :directory)))
     (project-am-extract-package-info dir)))
 
+;; for simple per project include path extension
+(defmethod ede-system-include-path ((this project-am-makefile))
+  "Return `project-am-localvars-include-path', usually local variable
+per file or in .dir-locals.el or similar."
+  (bound-and-true-p project-am-localvars-include-path))
+
+(defmethod ede-system-include-path ((this project-am-target))
+  "Return `project-am-localvars-include-path', usually local variable
+per file or in .dir-locals.el or similar."
+  (bound-and-true-p project-am-localvars-include-path))
+
+
 (provide 'ede/project-am)
 
 ;; arch-tag: 528db935-f186-4240-b647-e305c5b784a2
--- a/lisp/cedet/ede/shell.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/shell.el	Wed Oct 13 22:40:51 2010 +0900
@@ -70,7 +70,7 @@
 (defmethod ede-shell-buffer ((target ede-target))
   "Get the buffer for running shell commands for TARGET."
   (let ((name (ede-name target)))
-    (get-buffer-create (format "*EDE Shell %s" name))))
+    (get-buffer-create (format "*EDE Shell %s*" name))))
 
 (provide 'ede/shell)
 
--- a/lisp/cedet/ede/simple.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/simple.el	Wed Oct 13 22:40:51 2010 +0900
@@ -21,6 +21,10 @@
 
 ;;; Commentary:
 ;;
+;; NOTE: EDE Simple Projects are considered obsolete.  Use generic
+;; projects instead.  They have much better automatic support and
+;; simpler configuration.
+;;
 ;; A vast majority of projects use non-EDE project techniques, such
 ;; as hand written Makefiles, or other IDE's.
 ;;
@@ -41,6 +45,14 @@
 
 ;;; Code:
 
+(add-to-list 'ede-project-class-files
+	     (ede-project-autoload "simple-overlay"
+	      :name "Simple" :file 'ede/simple
+	      :proj-file 'ede-simple-projectfile-for-dir
+	      :load-type 'ede-simple-load
+	      :class-sym 'ede-simple-project)
+	     t)
+
 (defcustom ede-simple-save-directory "~/.ede"
   "*Directory where simple EDE project overlays are saved."
  :group 'ede
--- a/lisp/cedet/ede/speedbar.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/speedbar.el	Wed Oct 13 22:40:51 2010 +0900
@@ -108,7 +108,7 @@
 ;;; Some special commands useful in EDE
 ;;
 (defun ede-speedbar-remove-file-from-target ()
-  "Remove the file at point from it's target."
+  "Remove the file at point from its target."
   (interactive)
   (if (stringp (speedbar-line-token))
       (progn
--- a/lisp/cedet/ede/srecode.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/ede/srecode.el	Wed Oct 13 22:40:51 2010 +0900
@@ -43,7 +43,9 @@
   (srecode-map-update-map t)
   ;; We don't call this unless we need it.  Load in the templates.
   (srecode-load-tables-for-mode 'makefile-mode)
-  (srecode-load-tables-for-mode 'makefile-mode 'ede))
+  (srecode-load-tables-for-mode 'makefile-mode 'ede)
+  (srecode-load-tables-for-mode 'autoconf-mode)
+  (srecode-load-tables-for-mode 'autoconf-mode 'ede))
 
 (defmacro ede-srecode-insert-with-dictionary (template &rest forms)
   "Insert TEMPLATE after executing FORMS with a dictionary.
--- a/lisp/cedet/pulse.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/pulse.el	Wed Oct 13 22:40:51 2010 +0900
@@ -3,6 +3,7 @@
 ;;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
+;; Version: 1.0
 
 ;; This file is part of GNU Emacs.
 
@@ -57,10 +58,14 @@
     (error nil)))
 
 (defcustom pulse-flag (pulse-available-p)
-  "*Non-nil means to pulse the overlay face for momentary highlighting.
-Pulsing involves a bright highlight that slowly shifts to the background
-color.  Non-nil just means to highlight with an unchanging color for a short
-time.
+  "Whether to use pulsing for momentary highlighting.
+Pulsing involves a bright highlight that slowly shifts to the
+background color.
+
+If the value is nil, highlight with an unchanging color until a
+key is pressed.
+If the value is `never', do no coloring at all.
+Any other value means to the default pulsing behavior.
 
 If `pulse-flag' is non-nil, but `pulse-available-p' is nil, then
 this flag is ignored."
@@ -178,22 +183,23 @@
 Optional argument FACE specifies the fact to do the highlighting."
   (overlay-put o 'original-face (overlay-get o 'face))
   (add-to-list 'pulse-momentary-overlay o)
-  (if (or (not pulse-flag) (not (pulse-available-p)))
-      ;; Provide a face... clear on next command
-      (progn
-	(overlay-put o 'face (or face 'pulse-highlight-start-face))
-	(add-hook 'pre-command-hook
-		  'pulse-momentary-unhighlight)
-	)
-    ;; pulse it.
-    (unwind-protect
+  (if (eq pulse-flag 'never)
+      nil
+    (if (or (not pulse-flag) (not (pulse-available-p)))
+	;; Provide a face... clear on next command
 	(progn
-	  (overlay-put o 'face 'pulse-highlight-face)
-	  ;; The pulse function puts FACE onto 'pulse-highlight-face.
-	  ;; Thus above we put our face on the overlay, but pulse
-	  ;; with a reference face needed for the color.
-	  (pulse face))
-      (pulse-momentary-unhighlight))))
+	  (overlay-put o 'face (or face 'pulse-highlight-start-face))
+	  (add-hook 'pre-command-hook
+		    'pulse-momentary-unhighlight))
+      ;; pulse it.
+      (unwind-protect
+	  (progn
+	    (overlay-put o 'face 'pulse-highlight-face)
+	    ;; The pulse function puts FACE onto 'pulse-highlight-face.
+	    ;; Thus above we put our face on the overlay, but pulse
+	    ;; with a reference face needed for the color.
+	    (pulse face))
+	(pulse-momentary-unhighlight)))))
 
 (defun pulse-momentary-unhighlight ()
   "Unhighlight a line recently highlighted."
--- a/lisp/cedet/semantic.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic.el	Wed Oct 13 22:40:51 2010 +0900
@@ -4,7 +4,8 @@
 ;;   2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
-;; Keywords: syntax
+;; Keywords: syntax tools
+;; Version: 2.0
 
 ;; This file is part of GNU Emacs.
 
@@ -38,7 +39,7 @@
 (require 'semantic/tag)
 (require 'semantic/lex)
 
-(defvar semantic-version "2.0pre7"
+(defvar semantic-version "2.0"
   "Current version of Semantic.")
 
 (declare-function inversion-test "inversion")
@@ -875,6 +876,7 @@
     ;; (define-key km "i"    'senator-isearch-toggle-semantic-mode)
     (define-key map "\C-c,j" 'semantic-complete-jump-local)
     (define-key map "\C-c,J" 'semantic-complete-jump)
+    (define-key map "\C-c,m" 'semantic-complete-jump-local-members)
     (define-key map "\C-c,g" 'semantic-symref-symbol)
     (define-key map "\C-c,G" 'semantic-symref)
     (define-key map "\C-c,p" 'senator-previous-tag)
@@ -885,6 +887,7 @@
     (define-key map "\C-c,\M-w" 'senator-copy-tag)
     (define-key map "\C-c,\C-y" 'senator-yank-tag)
     (define-key map "\C-c,r" 'senator-copy-tag-to-register)
+    (define-key map "\C-c,," 'semantic-force-refresh)
     (define-key map [?\C-c ?, up] 'senator-transpose-tags-up)
     (define-key map [?\C-c ?, down] 'senator-transpose-tags-down)
     (define-key map "\C-c,l" 'semantic-analyze-possible-completions)
@@ -950,6 +953,9 @@
   (define-key navigate-menu [semantic-complete-jump]
     '(menu-item "Find Tag Globally..." semantic-complete-jump
 		:help "Read a tag name and find it in the current project"))
+  (define-key navigate-menu [semantic-complete-jump-local-members]
+    '(menu-item "Find Local Members ..." semantic-complete-jump-local-members
+		:help "Read a tag name and find a local member with that name"))
   (define-key navigate-menu [semantic-complete-jump-local]
     '(menu-item "Find Tag in This Buffer..." semantic-complete-jump-local
 		:help "Read a tag name and find it in this buffer"))
@@ -1080,6 +1086,11 @@
 	    (require 'semantic/db-ebrowse)
 	    (semanticdb-load-ebrowse-caches)))
 	(add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+	;; Add semantic-ia-complete-symbol to
+	;; completion-at-point-functions, so that it is run from
+	;; M-TAB.
+	(add-hook 'completion-at-point-functions
+		  'semantic-completion-at-point-function)
 	(if global-ede-mode
 	    (define-key cedet-menu-map [cedet-menu-separator] '("--")))
 	(dolist (b (buffer-list))
@@ -1087,6 +1098,8 @@
 	    (semantic-new-buffer-fcn))))
     ;; Disable all Semantic features.
     (remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
+    (remove-hook 'completion-at-point-functions
+		 'semantic-completion-at-point-function)
     (define-key cedet-menu-map [cedet-menu-separator] nil)
     (define-key cedet-menu-map [semantic-options-separator] nil)
     ;; FIXME: handle semanticdb-load-ebrowse-caches
@@ -1094,6 +1107,9 @@
       (if (and (boundp mode) (eval mode))
 	  (funcall mode -1)))))
 
+(defun semantic-completion-at-point-function ()
+  'semantic-ia-complete-symbol)
+
 ;;; Autoload some functions that are not in semantic/loaddefs
 
 (autoload 'global-semantic-idle-completions-mode "semantic/idle"
--- a/lisp/cedet/semantic/analyze.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/analyze.el	Wed Oct 13 22:40:51 2010 +0900
@@ -253,7 +253,7 @@
 	(tag nil)			; tag return list
 	(tagtype nil)			; tag types return list
 	(fname nil)
-	(miniscope (clone scope))
+	(miniscope (when scope (clone scope)))
 	)
     ;; First order check.  Is this wholely contained in the typecache?
     (setq tmp (semanticdb-typecache-find sequence))
@@ -297,11 +297,12 @@
 	      ;; and we can use it directly.
 	      (cond ((semantic-tag-of-class-p tmp 'type)
 		     ;; update the miniscope when we need to analyze types directly.
-		     (let ((rawscope
-			    (apply 'append
-				   (mapcar 'semantic-tag-type-members
-					   tagtype))))
-		       (oset miniscope fullscope rawscope))
+		     (when miniscope
+		       (let ((rawscope
+			      (apply 'append
+				     (mapcar 'semantic-tag-type-members
+					     tagtype))))
+			 (oset miniscope fullscope rawscope)))
 		     ;; Now analayze the type to remove metatypes.
 		     (or (semantic-analyze-type tmp miniscope)
 			 tmp))
@@ -351,7 +352,7 @@
 additional tags which are in SCOPE and do not need prefixing to
 find.
 
-This is a wrapper on top of semanticdb, semanticdb-typecache,
+This is a wrapper on top of semanticdb, semanticdb typecache,
 semantic-scope, and semantic search functions.  Almost all
 searches use the same arguments."
   (let ((namelst (if (consp name) name ;; test if pre-split.
--- a/lisp/cedet/semantic/analyze/complete.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/analyze/complete.el	Wed Oct 13 22:40:51 2010 +0900
@@ -63,11 +63,15 @@
 ;;; MAIN completion calculator
 ;;
 ;;;###autoload
-(define-overloadable-function semantic-analyze-possible-completions (context)
+(define-overloadable-function semantic-analyze-possible-completions (context &rest flags)
   "Return a list of semantic tags which are possible completions.
 CONTEXT is either a position (such as point), or a precalculated
 context.  Passing in a context is useful if the caller also needs
 to access parts of the analysis.
+The remaining FLAGS arguments are passed to the mode specific completion engine.
+Bad flags should be ignored by modes that don't use them.
+See `semantic-analyze-possible-completions-default' for details on the default FLAGS.
+
 Completions run through the following filters:
   * Elements currently in scope
   * Constants currently in scope
@@ -98,9 +102,13 @@
 	 (get-buffer-window "*Possible Completions*")))
       ans)))
 
-(defun semantic-analyze-possible-completions-default (context)
+(defun semantic-analyze-possible-completions-default (context &optional flags)
   "Default method for producing smart completions.
-Argument CONTEXT is an object specifying the locally derived context."
+Argument CONTEXT is an object specifying the locally derived context.
+The optional argument FLAGS changes which return options are returned.
+FLAGS can be any number of:
+  'no-tc     - do not apply data-type constraint.
+  'no-unique - do not apply unique by name filtering."
   (let* ((a context)
 	 (desired-type (semantic-analyze-type-constraint a))
 	 (desired-class (oref a prefixclass))
@@ -109,8 +117,13 @@
 	 (completetext nil)
 	 (completetexttype nil)
 	 (scope (oref a scope))
-	 (localvar (oref scope localvar))
-	 (c nil))
+	 (localvar (when scope (oref scope localvar)))
+	 (origc nil)
+	 (c nil)
+	 (any nil)
+	 (do-typeconstraint (not (memq 'no-tc flags)))
+	 (do-unique (not (memq 'no-unique flags)))
+	 )
 
     ;; Calculate what our prefix string is so that we can
     ;; find all our matching text.
@@ -160,33 +173,36 @@
 	       ;; Argument list and local variables
 	       (semantic-find-tags-for-completion completetext localvar)
 	       ;; The current scope
-	       (semantic-find-tags-for-completion completetext (oref scope fullscope))
+	       (semantic-find-tags-for-completion completetext (when scope (oref scope fullscope)))
 	       ;; The world
 	       (semantic-analyze-find-tags-by-prefix completetext))
 	    )
       )
 
-    (let ((origc c)
+    (let ((loopc c)
 	  (dtname (semantic-tag-name desired-type)))
 
+      ;; Save off our first batch of completions
+      (setq origc c)
+
       ;; Reset c.
       (setq c nil)
 
       ;; Loop over all the found matches, and catagorize them
       ;; as being possible features.
-      (while origc
+      (while (and loopc do-typeconstraint)
 
 	(cond
 	 ;; Strip operators
-	 ((semantic-tag-get-attribute (car origc) :operator-flag)
+	 ((semantic-tag-get-attribute (car loopc) :operator-flag)
 	  nil
 	  )
 
 	 ;; If we are completing from within some prefix,
 	 ;; then we want to exclude constructors and destructors
 	 ((and completetexttype
-	       (or (semantic-tag-get-attribute (car origc) :constructor-flag)
-		   (semantic-tag-get-attribute (car origc) :destructor-flag)))
+	       (or (semantic-tag-get-attribute (car loopc) :constructor-flag)
+		   (semantic-tag-get-attribute (car loopc) :destructor-flag)))
 	  nil
 	  )
 
@@ -197,17 +213,17 @@
 	   ;; Ok, we now have a completion list based on the text we found
 	   ;; we want to complete on.  Now filter that stream against the
 	   ;; type we want to search for.
-	   ((string= dtname (semantic-analyze-type-to-name (semantic-tag-type (car origc))))
-	    (setq c (cons (car origc) c))
+	   ((string= dtname (semantic-analyze-type-to-name (semantic-tag-type (car loopc))))
+	    (setq c (cons (car loopc) c))
 	    )
 
 	   ;; Now anything that is a compound type which could contain
 	   ;; additional things which are of the desired type
-	   ((semantic-tag-type (car origc))
-	    (let ((att (semantic-analyze-tag-type (car origc) scope))
+	   ((semantic-tag-type (car loopc))
+	    (let ((att (semantic-analyze-tag-type (car loopc) scope))
 		)
 	      (if (and att (semantic-tag-type-members att))
-		  (setq c (cons (car origc) c))))
+		  (setq c (cons (car loopc) c))))
 	    )
 
 	   ) ; cond
@@ -215,11 +231,11 @@
 
 	 ;; No desired type, no other restrictions.  Just add.
 	 (t
-	  (setq c (cons (car origc) c)))
+	  (setq c (cons (car loopc) c)))
 
 	 ); cond
 
-	(setq origc (cdr origc)))
+	(setq loopc (cdr loopc)))
 
       (when desired-type
 	;; Some types, like the enum in C, have special constant values that
@@ -241,15 +257,16 @@
     (when desired-class
       (setq c (semantic-analyze-tags-of-class-list c desired-class)))
 
-    ;; Pull out trash.
-    ;; NOTE TO SELF: Is this too slow?
-    ;; OTHER NOTE: Do we not want to strip duplicates by name and
-    ;; only by position?  When are duplicate by name but not by tag
-    ;; useful?
-    (setq c (semantic-unique-tag-table-by-name c))
+    (if do-unique
+	(if c
+	    ;; Pull out trash.
+	    ;; NOTE TO SELF: Is this too slow?
+	    (setq c (semantic-unique-tag-table-by-name c))
+	  (setq c (semantic-unique-tag-table-by-name origc)))
+      (when (not c)
+	(setq c origc)))
 
     ;; All done!
-
     c))
 
 (provide 'semantic/analyze/complete)
--- a/lisp/cedet/semantic/analyze/debug.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/analyze/debug.el	Wed Oct 13 22:40:51 2010 +0900
@@ -54,6 +54,8 @@
 
     ))
 
+;; @TODO - If this happens, but the last found type is
+;; a datatype, then the below is wrong
 (defun semantic-analyzer-debug-found-prefix (ctxt)
   "Debug the prefix found by the analyzer output CTXT."
   (let* ((pf (oref ctxt prefix))
@@ -97,7 +99,7 @@
 	)
     (with-output-to-temp-buffer (help-buffer)
       (with-current-buffer standard-output
-	(princ "Unable to find prefix ")
+	(princ "Unable to find symbol ")
 	(princ prefix)
 	(princ ".\n\n")
 
@@ -217,7 +219,7 @@
     (when (not dt) (error "Missing Innertype debugger is confused"))
     (with-output-to-temp-buffer (help-buffer)
       (with-current-buffer standard-output
-	(princ "Cannot find prefix \"")
+	(princ "Cannot find symbol \"")
 	(princ prefixitem)
 	(princ "\" in datatype:
   ")
@@ -550,24 +552,25 @@
   (let ((str (semantic-format-tag-prototype tag parent)))
     (if (and (semantic-tag-with-position-p tag)
 	     (semantic-tag-file-name tag))
-	(insert-button str
-		       'mouse-face 'custom-button-pressed-face
-		       'tag tag
-		       'action
-		       `(lambda (button)
-			  (let ((buff nil)
-				(pnt nil))
-			    (save-excursion
-			      (semantic-go-to-tag
-			       (button-get button 'tag))
-			      (setq buff (current-buffer))
-			      (setq pnt (point)))
-			    (if (get-buffer-window buff)
-				(select-window (get-buffer-window buff))
-			      (pop-to-buffer buff t))
-			    (goto-char pnt)
-			    (pulse-line-hook-function)))
-		       )
+	(with-current-buffer standard-output
+	  (insert-button str
+			 'mouse-face 'custom-button-pressed-face
+			 'tag tag
+			 'action
+			 `(lambda (button)
+			    (let ((buff nil)
+				  (pnt nil))
+			      (save-excursion
+				(semantic-go-to-tag
+				 (button-get button 'tag))
+				(setq buff (current-buffer))
+				(setq pnt (point)))
+			      (if (get-buffer-window buff)
+				  (select-window (get-buffer-window buff))
+				(pop-to-buffer buff t))
+			      (goto-char pnt)
+			      (pulse-line-hook-function)))
+			 ))
       (princ "\"")
       (princ str)
       (princ "\""))
--- a/lisp/cedet/semantic/analyze/refs.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/analyze/refs.el	Wed Oct 13 22:40:51 2010 +0900
@@ -104,6 +104,7 @@
   "Return the implementations derived in the reference analyzer REFS.
 Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
   (let ((allhits (oref refs rawsearchdata))
+	(tag (oref refs :tag))
 	(impl nil)
 	)
     (semanticdb-find-result-mapc
@@ -113,7 +114,8 @@
 	      (aT (cdr ans))
 	      (aDB (car ans))
 	      )
-	 (when (not (semantic-tag-prototype-p aT))
+	 (when (and (not (semantic-tag-prototype-p aT))
+		    (semantic-tag-similar-p tag aT :prototype-flag :parent))
 	   (when in-buffer (save-excursion (semantic-go-to-tag aT aDB)))
 	   (push aT impl))))
      allhits)
@@ -123,6 +125,7 @@
   "Return the prototypes derived in the reference analyzer REFS.
 Optional argument IN-BUFFER indicates that the returned tag should be in an active buffer."
   (let ((allhits (oref refs rawsearchdata))
+	(tag (oref refs :tag))
 	(proto nil))
     (semanticdb-find-result-mapc
      (lambda (T DB)
@@ -131,7 +134,8 @@
 	      (aT (cdr ans))
 	      (aDB (car ans))
 	      )
-	 (when (semantic-tag-prototype-p aT)
+	 (when (and (semantic-tag-prototype-p aT)
+		    (semantic-tag-similar-p tag aT :prototype-flag :parent))
 	   (when in-buffer (save-excursion (semantic-go-to-tag aT aDB)))
 	   (push aT proto))))
      allhits)
@@ -142,8 +146,8 @@
 (defun semantic--analyze-refs-full-lookup (tag scope)
   "Perform a full lookup for all occurrences of TAG in the current project.
 TAG should be the tag currently under point.
-PARENT is the list of tags that are parents to TAG by
-containment, as opposed to reference."
+SCOPE is the scope the cursor is in.  From this a list of parents is
+derived.  If SCOPE does not have parents, then only a simple lookup is done."
   (if (not (oref scope parents))
       ;; If this tag has some named parent, but is not
       (semantic--analyze-refs-full-lookup-simple tag)
@@ -177,20 +181,36 @@
     ans))
 
 (defun semantic--analyze-refs-find-tags-with-parent (find-results parents)
-  "Find in FIND-RESULTS all tags with PARNTS.
+  "Find in FIND-RESULTS all tags with PARENTS.
 NAME is the name of the tag needing finding.
 PARENTS is a list of names."
-  (let ((ans nil))
+  (let ((ans nil) (usingnames nil))
+    ;; Loop over the find-results passed in.
     (semanticdb-find-result-mapc
      (lambda (tag db)
        (let* ((p (semantic-tag-named-parent tag))
-	      (ps (when (stringp p)
-		    (semantic-analyze-split-name p))))
+	      (ps (when (stringp p) (semantic-analyze-split-name p))))
 	 (when (stringp ps) (setq ps (list ps)))
-	 (when (and ps (equal ps parents))
-	   ;; We could optimize this, but it seems unlikely.
-	   (push (list db tag) ans))
-	 ))
+	 (when ps
+	   ;; If there is a perfect match, then use it.
+	   (if (equal ps parents)
+	       (push (list db tag) ans))
+	   ;; No match, find something from our list of using names.
+	   ;; Do we need to split UN?
+	   (save-excursion
+	     (semantic-go-to-tag tag db)
+	     (setq usingnames nil)
+	     (let ((imports (semantic-ctxt-imported-packages)))
+	       ;; Derive the names from all the using statements.
+	       (mapc (lambda (T)
+		       (setq usingnames
+			     (cons (semantic-format-tag-name-from-anything T) usingnames)))
+		     imports))
+	     (dolist (UN usingnames)
+	       (when (equal (cons UN ps) parents)
+		 (push (list db tag) ans)
+		 (setq usingnames (cdr usingnames))))
+	     ))))
      find-results)
     ans))
 
@@ -206,7 +226,7 @@
 	 ;; Find all hits for the first parent name.
 	 (brute (semanticdb-find-tags-collector
 		 (lambda (table tags)
-		   (semanticdb-find-tags-by-name-method table name tags)
+		   (semanticdb-deep-find-tags-by-name-method table name tags)
 		   )
 		 nil nil t))
 	 ;; Prime the answer.
@@ -214,6 +234,7 @@
 	 )
     ;; First parent is already search to initialize "brute".
     (setq plist (cdr plist))
+
     ;; Go through the list of parents, and try to find matches.
     ;; As we cycle through plist, for each level look for NAME,
     ;; and compare the named-parent, and also dive into the next item of
@@ -253,7 +274,8 @@
 		 (lambda (table tags)
 		   (semanticdb-find-tags-by-name-method table name tags)
 		   )
-		 nil nil t))
+		 nil ;; This may need to be the entire project??
+		 nil t))
 	 )
 
 	(when (and (not brute) (not noerror))
--- a/lisp/cedet/semantic/bovine/c-by.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/bovine/c-by.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1240,7 +1240,9 @@
 	 (nth 7 vals))
 	(nth 0 vals)
 	(nth 10 vals)
-	(nth 4 vals))
+	(list
+	 (nth 4 vals))
+	(nth 9 vals))
       )
      (opt-stars
       opt-class
@@ -1262,7 +1264,9 @@
 	 (nth 6 vals))
 	(nth 0 vals)
 	(nth 9 vals)
-	(nth 4 vals))
+	(list
+	 (nth 4 vals))
+	(nth 8 vals))
       )
      ) ;; end func-decl
 
@@ -1433,13 +1437,11 @@
       namespace-symbol
       opt-bits
       opt-array
-      opt-assign
       ,(semantic-lambda
 	(nth 2 vals)
 	(nth 0 vals)
 	(nth 3 vals)
-	(nth 4 vals)
-	(nth 5 vals))
+	(nth 4 vals))
       )
      ) ;; end varname
 
@@ -1484,19 +1486,28 @@
       )
      ) ;; end variablearg-opt-name
 
+    (varname-opt-initializer
+     (semantic-list)
+     (opt-assign)
+     ( ;;EMPTY
+      )
+     ) ;; end varname-opt-initializer
+
     (varnamelist
      (opt-ref
       varname
+      varname-opt-initializer
       punctuation
       "\\`[,]\\'"
       varnamelist
       ,(semantic-lambda
 	(cons
 	 (nth 1 vals)
-	 (nth 3 vals)))
+	 (nth 4 vals)))
       )
      (opt-ref
       varname
+      varname-opt-initializer
       ,(semantic-lambda
 	(list
 	 (nth 1 vals)))
@@ -2108,74 +2119,64 @@
       "\\`[&]\\'")
      ) ;; end expr-start
 
+    (expr-binop
+     (punctuation
+      "\\`[-]\\'")
+     (punctuation
+      "\\`[+]\\'")
+     (punctuation
+      "\\`[*]\\'")
+     (punctuation
+      "\\`[/]\\'")
+     (punctuation
+      "\\`[&]\\'"
+      punctuation
+      "\\`[&]\\'")
+     (punctuation
+      "\\`[&]\\'")
+     (punctuation
+      "\\`[|]\\'"
+      punctuation
+      "\\`[|]\\'")
+     (punctuation
+      "\\`[|]\\'")
+     ) ;; end expr-binop
+
     (expression
-     (number
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (multi-stage-dereference
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (NEW
-      multi-stage-dereference
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (NEW
-      builtintype-types
-      semantic-list
+     (unaryexpression
+      expr-binop
+      unaryexpression
       ,(semantic-lambda
 	(list
 	 (identity start)
 	 (identity end)))
       )
-     (namespace-symbol
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (string-seq
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (type-cast
-      expression
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (semantic-list
-      expression
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (semantic-list
-      ,(semantic-lambda
-	(list
-	 (identity start)
-	 (identity end)))
-      )
-     (expr-start
-      expression
+     (unaryexpression
       ,(semantic-lambda
 	(list
 	 (identity start)
 	 (identity end)))
       )
      ) ;; end expression
+
+    (unaryexpression
+     (number)
+     (multi-stage-dereference)
+     (NEW
+      multi-stage-dereference)
+     (NEW
+      builtintype-types
+      semantic-list)
+     (namespace-symbol)
+     (string-seq)
+     (type-cast
+      expression)
+     (semantic-list
+      expression)
+     (semantic-list)
+     (expr-start
+      expression)
+     ) ;; end unaryexpression
     )
   "Parser table.")
 
--- a/lisp/cedet/semantic/bovine/c.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/bovine/c.el	Wed Oct 13 22:40:51 2010 +0900
@@ -39,6 +39,7 @@
 (declare-function semantic-brute-find-tag-by-attribute "semantic/find")
 (declare-function semanticdb-minor-mode-p "semantic/db-mode")
 (declare-function semanticdb-needs-refresh-p "semantic/db")
+(declare-function semanticdb-typecache-faux-namespace "semantic/db-typecache")
 (declare-function c-forward-conditional "cc-cmds")
 (declare-function ede-system-include-path "ede")
 
@@ -158,7 +159,7 @@
 Each entry is a cons cell like this:
   ( \"KEYWORD\" . \"REPLACEMENT\" )
 Where KEYWORD is the macro that gets replaced in the lexical phase,
-and REPLACEMENT is a string that is inserted in it's place.  Empty string
+and REPLACEMENT is a string that is inserted in its place.  Empty string
 implies that the lexical analyzer will discard KEYWORD when it is encountered.
 
 Alternately, it can be of the form:
@@ -295,6 +296,7 @@
       (cond
        ((looking-at "^\\s-*#\\s-*if")
 	;; We found a nested if.  Skip it.
+	;; @TODO - can we use the new c-scan-conditionals
 	(c-forward-conditional 1))
        ((looking-at "^\\s-*#\\s-*elif")
 	;; We need to let the preprocessor analize this one.
@@ -348,7 +350,6 @@
 	  ;; (message "%s %s yes" ift sym)
 	  (beginning-of-line)
 	  (setq pt (point))
-	  ;;(c-forward-conditional 1)
 	  ;; This skips only a section of a conditional.  Once that section
 	  ;; is opened, encountering any new #else or related conditional
 	  ;; should be skipped.
@@ -356,8 +357,8 @@
 	  (setq semantic-lex-end-point (point))
 	  (semantic-push-parser-warning (format "Skip #%s %s" ift sym)
 					pt (point))
-;;	  (semantic-lex-push-token
-;;	   (semantic-lex-token 'c-preprocessor-skip pt (point)))
+	  ;;	  (semantic-lex-push-token
+	  ;;	   (semantic-lex-token 'c-preprocessor-skip pt (point)))
 	  nil)
       ;; Else, don't ignore it, but do handle the internals.
       ;;(message "%s %s no" ift sym)
@@ -703,58 +704,60 @@
 	 (symtext (semantic-lex-token-text lexicaltoken))
 	 (macros (get-text-property 0 'macros symtext))
 	 )
-    (with-current-buffer buf
-      (erase-buffer)
-      (when (not (eq major-mode mode))
-	(save-match-data
+    (if (> semantic-c-parse-token-hack-depth 5)
+	nil
+      (with-current-buffer buf
+	(erase-buffer)
+	(when (not (eq major-mode mode))
+	  (save-match-data
 
-	  ;; Protect against user hooks throwing errors.
-	  (condition-case nil
-	      (funcall mode)
-	    (error
-	     (if (y-or-n-p
-		  (format "There was an error initializing %s in buffer \"%s\".  Debug your hooks? "
-			  mode (buffer-name)))
-		 (semantic-c-debug-mode-init mode)
-	       (message "Macro parsing state may be broken...")
-	       (sit-for 1))))
-	  ) ; save match data
+	    ;; Protect against user hooks throwing errors.
+	    (condition-case nil
+		(funcall mode)
+	      (error
+	       (if (y-or-n-p
+		    (format "There was an error initializing %s in buffer \"%s\".  Debug your hooks? "
+			    mode (buffer-name)))
+		   (semantic-c-debug-mode-init mode)
+		 (message "Macro parsing state may be broken...")
+		 (sit-for 1))))
+	    )				; save match data
 
-	;; Hack in mode-local
-	(activate-mode-local-bindings)
-	;; CHEATER!  The following 3 lines are from
-	;; `semantic-new-buffer-fcn', but we don't want to turn
-	;; on all the other annoying modes for this little task.
-	(setq semantic-new-buffer-fcn-was-run t)
-	(semantic-lex-init)
-	(semantic-clear-toplevel-cache)
-	(remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
-		     t)
-	)
-      ;; Get the macro symbol table right.
-      (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms)
-      ;; (message "%S" macros)
-      (dolist (sym macros)
-	(semantic-lex-spp-symbol-set (car sym) (cdr sym)))
+	  ;; Hack in mode-local
+	  (activate-mode-local-bindings)
+	  ;; CHEATER!  The following 3 lines are from
+	  ;; `semantic-new-buffer-fcn', but we don't want to turn
+	  ;; on all the other annoying modes for this little task.
+	  (setq semantic-new-buffer-fcn-was-run t)
+	  (semantic-lex-init)
+	  (semantic-clear-toplevel-cache)
+	  (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
+		       t)
+	  )
+	;; Get the macro symbol table right.
+	(setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms)
+	;; (message "%S" macros)
+	(dolist (sym macros)
+	  (semantic-lex-spp-symbol-set (car sym) (cdr sym)))
 
-      (insert symtext)
+	(insert symtext)
 
-      (setq stream
-	    (semantic-parse-region-default
-	     (point-min) (point-max) nonterminal depth returnonerror))
+	(setq stream
+	      (semantic-parse-region-default
+	       (point-min) (point-max) nonterminal depth returnonerror))
 
-      ;; Clean up macro symbols
-      (dolist (sym macros)
-	(semantic-lex-spp-symbol-remove (car sym)))
+	;; Clean up macro symbols
+	(dolist (sym macros)
+	  (semantic-lex-spp-symbol-remove (car sym)))
 
-      ;; Convert the text of the stream.
-      (dolist (tag stream)
-	;; Only do two levels here 'cause I'm lazy.
-	(semantic--tag-set-overlay tag (list start end))
-	(dolist (stag (semantic-tag-components-with-overlays tag))
-	  (semantic--tag-set-overlay stag (list start end))
-	  ))
-      )
+	;; Convert the text of the stream.
+	(dolist (tag stream)
+	  ;; Only do two levels here 'cause I'm lazy.
+	  (semantic--tag-set-overlay tag (list start end))
+	  (dolist (stag (semantic-tag-components-with-overlays tag))
+	    (semantic--tag-set-overlay stag (list start end))
+	    ))
+	))
     stream))
 
 (defvar semantic-c-debug-mode-init-last-mode nil
@@ -920,8 +923,34 @@
 	 ;; of type "typedef".
 	 ;; Each elt of NAME is ( STARS NAME )
 	 (let ((vl nil)
-	       (names (semantic-tag-name tag)))
+	       (names (semantic-tag-name tag))
+	       (super (semantic-tag-get-attribute tag :superclasses))
+	       (addlast nil))
+
+	   (when (and (semantic-tag-of-type-p tag "typedef")
+		      (semantic-tag-of-class-p super 'type)
+		      (semantic-tag-type-members super))
+	     ;; This is a typedef of a real type.  Extract
+	     ;; the super class, and stick it into the tags list.
+	     (setq addlast super)
+
+	     ;; Clone super and remove the members IFF super has a name.
+	     ;; Note: anonymous struct/enums that are typedef'd shouldn't
+	     ;; exist in the top level type list, so they will appear only
+	     ;; in the :typedef slot of the typedef.
+	     (setq super (semantic-tag-clone super))
+	     (if (not (string= (semantic-tag-name super) ""))
+		 (semantic-tag-put-attribute super :members nil)
+	       (setq addlast nil))
+
+	     ;; Add in props to the full superclass.
+	     (when addlast
+	       (semantic--tag-copy-properties tag addlast)
+	       (semantic--tag-set-overlay addlast (semantic-tag-overlay tag)))
+	     )
+
 	   (while names
+
 	     (setq vl (cons (semantic-tag-new-type
 			     (nth 1 (car names)) ; name
 			     "typedef"
@@ -938,16 +967,18 @@
 			     ;; is expanded out as.  Just the
 			     ;; name shows up as a parent of this
 			     ;; typedef.
-			     :typedef
-			     (semantic-tag-get-attribute tag :superclasses)
+			     :typedef super
 			     ;;(semantic-tag-type-superclasses tag)
 			     :documentation
 			     (semantic-tag-docstring tag))
 			    vl))
 	     (semantic--tag-copy-properties tag (car vl))
-	     (semantic--tag-set-overlay (car vl)
-					(semantic-tag-overlay tag))
+	     (semantic--tag-set-overlay (car vl) (semantic-tag-overlay tag))
 	     (setq names (cdr names)))
+
+	   ;; Add typedef superclass last.
+	   (when addlast (setq vl (cons addlast vl)))
+
 	   vl))
 	((and (listp (car tag))
 	      (semantic-tag-of-class-p (car tag) 'variable))
@@ -999,6 +1030,7 @@
 					(car tokenpart)))
 			  (and (stringp (car (nth 2 tokenpart)))
 			       (string= (car (nth 2 tokenpart)) (car tokenpart)))
+			  (nth 10 tokenpart) ; initializers
 			  )
 		      (not (car (nth 3 tokenpart)))))
 		(fcnpointer (string-match "^\\*" (car tokenpart)))
@@ -1029,7 +1061,10 @@
 			 (semantic-tag-new-type
 			  ;; name
 			  (or (car semantic-c-classname)
-			      (car (nth 2 tokenpart)))
+			      (let ((split (semantic-analyze-split-name-c-mode
+					    (car (nth 2 tokenpart)))))
+				(if (stringp split) split
+				  (car (last split)))))
 			  ;; type
 			  (or (cdr semantic-c-classname)
 			      "class")
@@ -1580,6 +1615,48 @@
     tagreturn
     ))
 
+(define-mode-local-override semantic-ctxt-imported-packages c++-mode (&optional point)
+  "Return the list of using tag types in scope of POINT."
+  (when point (goto-char (point)))
+  (let ((tagsaroundpoint (semantic-find-tag-by-overlay))
+	(namereturn nil)
+	(tmp nil)
+	)
+    ;; Collect using statements from the top level.
+    (setq tmp (semantic-find-tags-by-class 'using (current-buffer)))
+    (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
+    ;; Move through the tags around point looking for more using statements
+    (while (cdr tagsaroundpoint)  ; don't search the last one
+      (setq tmp (semantic-find-tags-by-class 'using (semantic-tag-components (car tagsaroundpoint))))
+      (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
+      (setq tagsaroundpoint (cdr tagsaroundpoint))
+      )
+    namereturn))
+
+(define-mode-local-override semanticdb-expand-nested-tag c++-mode (tag)
+  "Expand TAG if it has a fully qualified name.
+For types with a :parent, create faux namespaces to put TAG into."
+  (let ((p (semantic-tag-get-attribute tag :parent)))
+    (if (and p (semantic-tag-of-class-p tag 'type))
+	;; Expand the tag
+	(let ((s (semantic-analyze-split-name p))
+	      (newtag (semantic-tag-copy tag nil t)))
+	  ;; Erase the qualified name.
+	  (semantic-tag-put-attribute newtag :parent nil)
+	  ;; Fixup the namespace name
+	  (setq s (if (stringp s) (list s) (nreverse s)))
+	  ;; Loop over all the parents, creating the nested
+	  ;; namespace.
+	  (require 'semantic/db-typecache)
+	  (dolist (namespace s)
+	    (setq newtag (semanticdb-typecache-faux-namespace
+			  namespace (list newtag)))
+	    )
+	  ;; Return the last created namespace.
+	  newtag)
+      ;; Else, return tag unmodified.
+      tag)))
+
 (define-mode-local-override semantic-get-local-variables c++-mode ()
   "Do what `semantic-get-local-variables' does, plus add `this' if needed."
   (let* ((origvar (semantic-get-local-variables-default))
@@ -1759,7 +1836,9 @@
 	  (princ "\n")
 	  ))
 
-      (when (arrayp semantic-lex-spp-project-macro-symbol-obarray)
+      (when (and (boundp 'ede-object)
+		 ede-object
+		 (arrayp semantic-lex-spp-project-macro-symbol-obarray))
 	(princ "\n  Project symbol map:\n")
 	(princ "      Your project symbol map is derived from the EDE object:\n      ")
 	(princ (object-print ede-object))
--- a/lisp/cedet/semantic/bovine/el.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/bovine/el.el	Wed Oct 13 22:40:51 2010 +0900
@@ -958,7 +958,7 @@
 (add-hook 'lisp-mode-hook 'semantic-default-elisp-setup)
 
 (eval-after-load "semanticdb"
-  '(require 'semanticdb-el)
+  '(require 'semantic/db-el)
   )
 
 (provide 'semantic/bovine/el)
--- a/lisp/cedet/semantic/complete.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/complete.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1206,6 +1206,27 @@
   (require 'semantic/db-find)
   (semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path)))
 
+;;; Current Datatype member search.
+(defclass semantic-collector-local-members (semantic-collector-project-abstract)
+  ((scope :initform nil
+	  :type (or null semantic-scope-cache)
+	  :documentation
+	  "The scope the local members are being completed from."))
+  "Completion engine for tags in a project.")
+
+(defmethod semantic-collector-calculate-completions-raw
+  ((obj semantic-collector-local-members) prefix completionlist)
+  "Calculate the completions for prefix from completionlist."
+  (let* ((scope (or (oref obj scope)
+		    (oset obj scope (semantic-calculate-scope))))
+	 (localstuff (oref scope scope)))
+    (list
+     (cons
+      (oref scope :table)
+      (semantic-find-tags-for-completion prefix localstuff)))))
+    ;(semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))))
+
+;;; Smart completion collector
 (defclass semantic-collector-analyze-completions (semantic-collector-abstract)
   ((context :initarg :context
 	    :type semantic-analyze-context
@@ -1800,6 +1821,28 @@
    history)
   )
 
+(defun semantic-complete-read-tag-local-members (prompt &optional
+							default-tag
+							initial-input
+							history)
+  "Ask for a tag by name from the local type members.
+Available tags are from the the current scope.
+Completion options are presented in a traditional way, with highlighting
+to resolve same-name collisions.
+PROMPT is a string to prompt with.
+DEFAULT-TAG is a semantic tag or string to use as the default value.
+If INITIAL-INPUT is non-nil, insert it in the minibuffer initially.
+HISTORY is a symbol representing a variable to store the history in."
+  (semantic-complete-read-tag-engine
+   (semantic-collector-local-members prompt :buffer (current-buffer))
+   (semantic-displayor-traditional-with-focus-highlight "simple")
+   ;;(semantic-displayor-tooltip "simple")
+   prompt
+   default-tag
+   initial-input
+   history)
+  )
+
 (defun semantic-complete-read-tag-project (prompt &optional
 						  default-tag
 						  initial-input
@@ -1979,7 +2022,7 @@
 
 ;;;###autoload
 (defun semantic-complete-jump-local ()
-  "Jump to a semantic symbol."
+  "Jump to a local semantic symbol."
   (interactive)
   (let ((tag (semantic-complete-read-tag-buffer-deep "Jump to symbol: ")))
     (when (semantic-tag-p tag)
@@ -2005,6 +2048,23 @@
 	       (semantic-tag-name  tag)))))
 
 ;;;###autoload
+(defun semantic-complete-jump-local-members ()
+  "Jump to a semantic symbol."
+  (interactive)
+  (let* ((tag (semantic-complete-read-tag-local-members "Jump to symbol: ")))
+    (when (semantic-tag-p tag)
+      (let ((start (condition-case nil (semantic-tag-start tag)
+		     (error nil))))
+	(unless start
+	  (error "Tag %s has no location" (semantic-format-tag-prototype tag)))
+	(push-mark)
+	(goto-char start)
+	(semantic-momentary-highlight-tag tag)
+	(message "%S: %s "
+		 (semantic-tag-class tag)
+		 (semantic-tag-name  tag))))))
+
+;;;###autoload
 (defun semantic-complete-analyze-and-replace ()
   "Perform prompt completion to do in buffer completion.
 `semantic-analyze-possible-completions' is used to determine the
@@ -2075,15 +2135,17 @@
 
   ;; Prepare for doing completion, but exit quickly if there is keyboard
   ;; input.
-  (when (and (not (semantic-exit-on-input 'csi
-		    (semantic-fetch-tags)
-		    (semantic-throw-on-input 'csi)
-		    nil))
-	     (= arg 1)
-	     (not (semantic-exit-on-input 'csi
-		    (semantic-analyze-current-context)
-		    (semantic-throw-on-input 'csi)
-		    nil)))
+  (when (save-window-excursion
+	  (save-excursion
+	    (and (not (semantic-exit-on-input 'csi
+			(semantic-fetch-tags)
+			(semantic-throw-on-input 'csi)
+			nil))
+		 (= arg 1)
+		 (not (semantic-exit-on-input 'csi
+			(semantic-analyze-current-context)
+			(semantic-throw-on-input 'csi)
+			nil)))))
     (condition-case nil
 	(semantic-complete-analyze-inline)
       ;; Ignore errors.  Seems likely that we'll get some once in a while.
--- a/lisp/cedet/semantic/ctxt.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/ctxt.el	Wed Oct 13 22:40:51 2010 +0900
@@ -599,12 +599,18 @@
   "Return a list of scoped types by name for the current context at POINT.
 This is very different for various languages, and does nothing unless
 overridden."
-  (if point (goto-char point))
-  (let ((case-fold-search semantic-case-fold))
-    ;; We need to look at TYPES within the bounds of locally parse arguments.
-    ;; C needs to find using statements and the like too.  Bleh.
-    nil
-    ))
+  nil)
+
+(define-overloadable-function semantic-ctxt-imported-packages (&optional point)
+  "Return a list of package tags or names which are being imported at POINT.
+The return value is a list of strings which are package names
+that are implied in code.  Thus a C++ symbol:
+  foo::bar();
+where there is a statement such as:
+  using baz;
+means that the first symbol might be:
+  baz::foo::bar();"
+  nil)
 
 (provide 'semantic/ctxt)
 
--- a/lisp/cedet/semantic/db-file.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/db-file.el	Wed Oct 13 22:40:51 2010 +0900
@@ -245,7 +245,7 @@
 	   ;; @todo - It should ask if we are not called from a hook.
 	   ;;         How?
 	   (if (or supress-questions
-		   (y-or-n-p (format "Skip Error: %S ?" (car (cdr foo)))))
+		   (y-or-n-p (format "Skip Error: %s ?" (car (cdr foo)))))
 	       (message "Save Error: %S: %s" (car (cdr foo))
 			objname)
 	     (error "%S" (car (cdr foo))))))))
--- a/lisp/cedet/semantic/db-find.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/db-find.el	Wed Oct 13 22:40:51 2010 +0900
@@ -202,7 +202,7 @@
   (when (oref idx type-cache)
     (semantic-reset (oref idx type-cache)))
   ;; Clear the scope.  Scope doesn't have the data it needs to track
-  ;; it's own reset.
+  ;; its own reset.
   (semantic-scope-reset-cache)
   )
 
@@ -262,13 +262,13 @@
   "Translate PATH into a list of semantic tables.
 Path translation involves identifying the PATH input argument
 in one of the following ways:
-  nil - Take the current buffer, and use it's include list
+  nil - Take the current buffer, and use its include list
   buffer - Use that buffer's include list.
   filename - Use that file's include list.  If the file is not
       in a buffer, see of there is a semanticdb table for it.  If
       not, read that file into a buffer.
   tag - Get that tag's buffer of file file.  See above.
-  table - Search that table, and it's include list.
+  table - Search that table, and its include list.
   find result - Search the results of a previous find.
 
 In addition, once the base path is found, there is the possibility of
@@ -1006,9 +1006,14 @@
 	  (when norm
 	    ;; The normalized tags can now be found based on that
 	    ;; tags table.
-	    (semanticdb-set-buffer (car norm))
-	    ;; Now reset ans
-	    (setq ans (cdr norm))
+	    (condition-case foo
+		(progn
+		  (semanticdb-set-buffer (car norm))
+		  ;; Now reset ans
+		  (setq ans (cdr norm)))
+	      ;; Don't error for this case, but don't store
+	      ;; the thing either.
+	      (no-method-definition nil))
 	    ))
       )
     ;; Return the tag.
@@ -1019,10 +1024,10 @@
 FCN takes two arguments.  The first is a TAG, and the
 second is a DB from whence TAG originated.
 Returns result."
-  (mapc (lambda (sublst)
-	  (mapc (lambda (tag)
-		  (funcall fcn tag (car sublst)))
-		(cdr sublst)))
+  (mapc (lambda (sublst-icky)
+	  (mapc (lambda (tag-icky)
+		  (funcall fcn tag-icky (car sublst-icky)))
+		(cdr sublst-icky)))
 	result)
   result)
 
--- a/lisp/cedet/semantic/db-global.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/db-global.el	Wed Oct 13 22:40:51 2010 +0900
@@ -93,7 +93,7 @@
 	       '(omniscience))
        )
     (if dont-err-if-not-available
-	(message "No Global support in %s" default-directory)
+	nil; (message "No Global support in %s" default-directory)
       (error "No Global support in %s" default-directory))
     ))
 
--- a/lisp/cedet/semantic/db-typecache.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/db-typecache.el	Wed Oct 13 22:40:51 2010 +0900
@@ -217,6 +217,14 @@
    (semanticdb-full-filename table)
    tags))
 
+(defun semanticdb-typecache-faux-namespace (name members)
+  "Create a new namespace tag with NAME and a set of MEMBERS.
+The new tag will be a faux tag, used as a placeholder in a typecache."
+  (let ((tag (semantic-tag-new-type name "namespace" members nil)))
+    ;; Make sure we mark this as a fake tag.
+    (semantic-tag-set-faux tag)
+    tag))
+
 (defun semanticdb-typecache-merge-streams (cache1 cache2)
   "Merge into CACHE1 and CACHE2 together.  The Caches will be merged in place."
   (if (or (and (not cache1) (not cache2))
@@ -256,23 +264,22 @@
 	    (setq ans (cons next ans))
 	  ;; ELSE - We have a NAME match.
 	  (setq type (semantic-tag-type next))
-	  (if (semantic-tag-of-type-p prev type) ; Are they the same datatype
+	  (if (or (semantic-tag-of-type-p prev type) ; Are they the same datatype
+		  (semantic-tag-faux-p prev)
+		  (semantic-tag-faux-p next) ; or either a faux tag?
+		  )
 	      ;; Same Class, we can do a merge.
 	      (cond
 	       ((and (semantic-tag-of-class-p next 'type)
 		     (string= type "namespace"))
 		;; Namespaces - merge the children together.
 		(setcar ans
-			(semantic-tag-new-type
+			(semanticdb-typecache-faux-namespace
 			 (semantic-tag-name prev) ; - they are the same
-			 "namespace"	; - we know this as fact
 			 (semanticdb-typecache-merge-streams
 			  (semanticdb-typecache-safe-tag-members prev)
 			  (semanticdb-typecache-safe-tag-members next))
-			 nil		; - no attributes
 			 ))
-		;; Make sure we mark this as a fake tag.
-		(semantic-tag-set-faux (car ans))
 		)
 	       ((semantic-tag-prototype-p next)
 		;; NEXT is a prototype... so keep previous.
@@ -299,6 +306,12 @@
 ;;; Refresh / Query API
 ;;
 ;; Queries that can be made for the typecache.
+(define-overloadable-function semanticdb-expand-nested-tag (tag)
+  "Expand TAG from fully qualified names.
+If TAG has fully qualified names, expand it to a series of nested
+namespaces instead."
+  tag)
+
 (defmethod semanticdb-typecache-file-tags ((table semanticdb-abstract-table))
   "No tags available from non-file based tables."
   nil)
@@ -313,10 +326,13 @@
 
     ;; Make sure our file-tags list is up to date.
     (when (not (oref cache filestream))
-      (let ((tags  (semantic-find-tags-by-class 'type table)))
+      (let ((tags  (semantic-find-tags-by-class 'type table))
+	    (exptags nil))
 	(when tags
 	  (setq tags (semanticdb-typecache-safe-tag-list tags table))
-	  (oset cache filestream (semanticdb-typecache-merge-streams tags nil)))))
+	  (dolist (T tags)
+	    (push (semanticdb-expand-nested-tag T) exptags))
+	  (oset cache filestream (semanticdb-typecache-merge-streams exptags nil)))))
 
     ;; Return our cache.
     (oref cache filestream)
@@ -372,6 +388,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;; Search Routines
+;;
 ;;;###autoload
 (define-overloadable-function semanticdb-typecache-find (type &optional path find-file-match)
   "Search the typecache for TYPE in PATH.
@@ -386,16 +403,20 @@
 PATH is the search path, which should be one table object.
 If FIND-FILE-MATCH is non-nil, then force the file belonging to the
 found tag to be loaded."
-  (semanticdb-typecache-find-method (or path semanticdb-current-table)
-				    type find-file-match))
+  (if (not (and (featurep 'semantic/db) semanticdb-current-database))
+      nil ;; No DB, no search
+    (save-excursion
+      (semanticdb-typecache-find-method (or path semanticdb-current-table)
+					type find-file-match))))
 
 (defun semanticdb-typecache-find-by-name-helper (name table)
   "Find the tag with NAME in TABLE, which is from a typecache.
 If more than one tag has NAME in TABLE, we will prefer the tag that
 is of class 'type."
   (let* ((names (semantic-find-tags-by-name name table))
-	 (types (semantic-find-tags-by-class 'type names)))
-    (or (car-safe types) (car-safe names))))
+	 (nmerge (semanticdb-typecache-merge-streams names nil))
+	 (types (semantic-find-tags-by-class 'type nmerge)))
+    (or (car-safe types) (car-safe nmerge))))
 
 (defmethod semanticdb-typecache-find-method ((table semanticdb-abstract-table)
 					     type find-file-match)
--- a/lisp/cedet/semantic/db.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/db.el	Wed Oct 13 22:40:51 2010 +0900
@@ -542,10 +542,25 @@
 is not in a buffer.  Avoid using FORCE for most uses, as an old cache
 may be sufficient for the general case.  Forced updates can be slow.
 This will call `semantic-fetch-tags' if that file is in memory."
-  (when (or (semanticdb-in-buffer-p obj) force)
+  (cond
+   ;;
+   ;; Already in a buffer, just do it.
+   ((semanticdb-in-buffer-p obj)
+    (semanticdb-set-buffer obj)
+    (semantic-fetch-tags))
+   ;;
+   ;; Not in a buffer.  Forcing a load.
+   (force
+    ;; Patch from Iain Nicol. --
+    ;; @TODO: I wonder if there is a way to recycle
+    ;;        semanticdb-create-table-for-file-not-in-buffer
     (save-excursion
-      (semanticdb-set-buffer obj)
-      (semantic-fetch-tags))))
+      (let ((buff (semantic-find-file-noselect
+		   (semanticdb-full-filename obj))))
+	(set-buffer buff)
+	(semantic-fetch-tags)
+	;; Kill off the buffer if it didn't exist when we were called.
+	(kill-buffer buff))))))
 
 (defmethod semanticdb-needs-refresh-p ((obj semanticdb-table))
   "Return non-nil of OBJ's tag list is out of date.
@@ -808,12 +823,14 @@
     (setq root (run-hook-with-args-until-success
 		'semanticdb-project-root-functions
 		dir))
-    ;; Find roots based on strings
-    (while (and roots (not root))
-      (let ((r (file-truename (car roots))))
-	(if (string-match (concat "^" (regexp-quote r)) dir)
-	    (setq root r)))
-      (setq roots (cdr roots)))
+    (if root
+	(setq root (file-truename root))
+      ;; Else, Find roots based on strings
+      (while roots
+	(let ((r (file-truename (car roots))))
+	  (if (string-match (concat "^" (regexp-quote r)) dir)
+	      (setq root r)))
+	(setq roots (cdr roots))))
 
     ;; If no roots are found, use this directory.
     (unless root (setq root dir))
--- a/lisp/cedet/semantic/decorate.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/decorate.el	Wed Oct 13 22:40:51 2010 +0900
@@ -45,7 +45,7 @@
     ))
 
 (defun semantic-unhighlight-tag (tag)
-  "Unhighlight TAG, restoring it's previous face."
+  "Unhighlight TAG, restoring its previous face."
   (let ((o (semantic-tag-overlay tag)))
     (semantic-overlay-put o 'face (car (semantic-overlay-get o 'old-face)))
     (semantic-overlay-put o 'old-face (cdr (semantic-overlay-get o 'old-face)))
--- a/lisp/cedet/semantic/decorate/include.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/decorate/include.el	Wed Oct 13 22:40:51 2010 +0900
@@ -118,7 +118,7 @@
   '((((class color) (background dark))
      (:background "#900000"))
     (((class color) (background light))
-     (:background "#ff5050")))
+     (:background "#fff0f0")))
   "*Face used to show includes that cannot be found.
 Used by the decoration style: `semantic-decoration-on-unknown-includes'."
   :group 'semantic-faces)
@@ -302,16 +302,19 @@
 	)
       ))
 
-    (let ((ol (semantic-decorate-tag tag
-				     (semantic-tag-start tag)
-				     (semantic-tag-end tag)
-				     face))
-	  )
-      (semantic-overlay-put ol 'mouse-face 'highlight)
-      (semantic-overlay-put ol 'keymap map)
-      (semantic-overlay-put ol 'help-echo
-			    "Header File : mouse-3 - Context menu")
-      )))
+    ;; @TODO - if not a tag w/ a position, we need to get one.  How?
+
+    (when (semantic-tag-with-position-p tag)
+      (let ((ol (semantic-decorate-tag tag
+				       (semantic-tag-start tag)
+				       (semantic-tag-end tag)
+				       face))
+	    )
+	(semantic-overlay-put ol 'mouse-face 'highlight)
+	(semantic-overlay-put ol 'keymap map)
+	(semantic-overlay-put ol 'help-echo
+			      "Header File : mouse-3 - Context menu")
+	))))
 
 ;;; Regular Include Functions
 ;;
--- a/lisp/cedet/semantic/dep.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/dep.el	Wed Oct 13 22:40:51 2010 +0900
@@ -208,7 +208,8 @@
 	       mode 'semantic-dependency-system-include-path))
 	(edesys (when (and (featurep 'ede) ede-minor-mode
 			   ede-object)
-		  (ede-system-include-path ede-object)))
+		  (ede-system-include-path
+		   (if (listp ede-object) (car ede-object) ede-object))))
 	(locp (mode-local-value
 	       mode 'semantic-dependency-include-path))
 	(found nil))
--- a/lisp/cedet/semantic/doc.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/doc.el	Wed Oct 13 22:40:51 2010 +0900
@@ -78,7 +78,8 @@
 	   (start (if starttag
 		      (semantic-tag-end starttag)
 		    (point-min))))
-      (when (re-search-backward comment-start-skip start t)
+      (when (and comment-start-skip
+		 (re-search-backward comment-start-skip start t))
 	;; We found a comment that doesn't belong to the body
 	;; of a function.
 	(semantic-doc-snarf-comment-for-tag nosnarf)))
--- a/lisp/cedet/semantic/fw.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/fw.el	Wed Oct 13 22:40:51 2010 +0900
@@ -310,6 +310,17 @@
 	(find-file-noselect file nowarn rawfile wildcards)))
     ))
 
+;;; Database restriction settings
+;;
+(defmacro semanticdb-without-unloaded-file-searches (forms)
+  "Execute FORMS with `unloaded' removed from the current throttle."
+  `(let ((semanticdb-find-default-throttle
+	  (if (featurep 'semantic/db-find)
+	      (remq 'unloaded semanticdb-find-default-throttle)
+	    nil)))
+     ,forms))
+(put 'semanticdb-without-unloaded-file-searches 'lisp-indent-function 1)
+
 
 ;; ;;; Editor goodies ;-)
 ;; ;;
--- a/lisp/cedet/semantic/grammar.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/grammar.el	Wed Oct 13 22:40:51 2010 +0900
@@ -928,6 +928,12 @@
         ;; If running interactively, eval declarations and epilogue
         ;; code, then pop to the buffer visiting the generated file.
         (eval-region (point) (point-max))
+	;; Loop over the defvars and eval them explicitly to force
+	;; them to be evaluated and ready to use.
+        (goto-char (point-min))
+	(while (re-search-forward "(defvar " nil t)
+	  (eval-defun nil))
+	;; Move cursor to a logical spot in the generated code.
         (goto-char (point-min))
         (pop-to-buffer (current-buffer))
         ;; The generated code has been evaluated and updated into
@@ -1513,7 +1519,7 @@
   (car (semantic-find-tags-by-class
         'function
         (or (semantic-find-tags-by-name name (current-buffer))
-            (and (featurep 'semanticdb)
+            (and (featurep 'semantic/db)
                  semanticdb-current-database
                  (cdar (semanticdb-find-tags-by-name name nil t)))))))
 
--- a/lisp/cedet/semantic/html.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/html.el	Wed Oct 13 22:40:51 2010 +0900
@@ -243,6 +243,7 @@
 	semantic-imenu-bucketize-file nil
 	semantic-imenu-bucketize-type-members nil
 	senator-step-at-start-end-tag-classes '(section)
+	senator-step-at-tag-classes '(section)
 	semantic-stickyfunc-sticky-classes '(section)
 	)
   (semantic-install-function-overrides
--- a/lisp/cedet/semantic/ia.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/ia.el	Wed Oct 13 22:40:51 2010 +0900
@@ -40,7 +40,8 @@
 (require 'pulse)
 (eval-when-compile
   (require 'semantic/analyze)
-  (require 'semantic/analyze/refs))
+  (require 'semantic/analyze/refs)
+  (require 'semantic/find))
 
 (declare-function imenu--mouse-menu "imenu")
 
@@ -57,14 +58,6 @@
   :group 'semantic
   :type semantic-format-tag-custom-list)
 
-(defvar semantic-ia-cache nil
-  "Cache of the last completion request.
-Of the form ( POINT . COMPLETIONS ) where POINT is a location in the
-buffer where the completion was requested.  COMPLETONS is the list
-of semantic tag names that provide logical completions from that
-location.")
-(make-variable-buffer-local 'semantic-ia-cache)
-
 ;;; COMPLETION HELPER
 ;;
 ;; This overload function handles inserting a tag
@@ -86,23 +79,16 @@
 	   (insert "("))
 	  (t nil))))
 
-(declare-function semantic-analyze-possible-completions
-		  "semantic/analyze/complete")
+(defalias 'semantic-ia-get-completions 'semantic-ia-get-completions-deprecated
+  "`Semantic-ia-get-completions' is obsolete.
+Use `semantic-analyze-possible-completions' instead.")
 
-(defun semantic-ia-get-completions (context point)
-  "Fetch the completion of CONTEXT at POINT.
-Supports caching."
-  ;; Cache the current set of symbols so that we can get at
-  ;; them quickly the second time someone presses the
-  ;; complete button.
-  (let ((symbols
-	 (if (and semantic-ia-cache
-		  (= point (car semantic-ia-cache)))
-	     (cdr semantic-ia-cache)
-	   (semantic-analyze-possible-completions context))))
-    ;; Set the cache
-    (setq semantic-ia-cache (cons point symbols))
-    symbols))
+(defun semantic-ia-get-completions-deprecated (context point)
+  "A function to help transition away from `semantic-ia-get-completions'.
+Return completions based on CONTEXT at POINT.
+You should not use this, nor the aliased version.
+Use `semantic-analyze-possible-completions' instead."
+  (semantic-analyze-possible-completions context))
 
 ;;;###autoload
 (defun semantic-ia-complete-symbol (&optional pos)
@@ -110,56 +96,52 @@
 If POS is nil, default to point.
 Completion options are calculated with `semantic-analyze-possible-completions'."
   (interactive "d")
-  (or pos (setq pos (point)))
-  ;; Calculating completions is a two step process.
-  ;;
-  ;; The first analyzer the current context, which finds tags
-  ;; for all the stuff that may be references by the code around
-  ;; POS.
-  ;;
-  ;; The second step derives completions from that context.
-  (let* ((a (semantic-analyze-current-context pos))
-	 (syms (semantic-ia-get-completions a pos))
-	 (pre (car (reverse (oref a prefix))))
-	 )
-    ;; If PRE was actually an already completed symbol, it doesn't
-    ;; come in as a string, but as a tag instead.
-    (if (semantic-tag-p pre)
-	;; We will try completions on it anyway.
-	(setq pre (semantic-tag-name pre)))
-    ;; Complete this symbol.
-    (if (null syms)
-	(progn
-	  ;(message "No smart completions found.  Trying senator-complete-symbol.")
+  (when (semantic-active-p)
+    (or pos (setq pos (point)))
+    ;; Calculating completions is a two step process.
+    ;;
+    ;; The first analyzer the current context, which finds tags for
+    ;; all the stuff that may be references by the code around POS.
+    ;;
+    ;; The second step derives completions from that context.
+    (let* ((a (semantic-analyze-current-context pos))
+	   (syms (semantic-analyze-possible-completions a))
+	   (pre (car (reverse (oref a prefix)))))
+      ;; If PRE was actually an already completed symbol, it doesn't
+      ;; come in as a string, but as a tag instead.
+      (if (semantic-tag-p pre)
+	  ;; We will try completions on it anyway.
+	  (setq pre (semantic-tag-name pre)))
+      ;; Complete this symbol.
+      (if (null syms)
 	  (if (semantic-analyze-context-p a)
 	      ;; This is a clever hack.  If we were unable to find any
 	      ;; smart completions, lets divert to how senator derives
 	      ;; completions.
 	      ;;
-	      ;; This is a way of making this fcn more useful since the
-	      ;; smart completion engine sometimes failes.
-	      (semantic-complete-symbol)))
-      ;; Use try completion to seek a common substring.
-      (let ((tc (try-completion (or pre "")  syms)))
-	(if (and (stringp tc) (not (string= tc (or pre ""))))
-	    (let ((tok (semantic-find-first-tag-by-name
-			tc syms)))
-	      ;; Delete what came before...
-	      (when (and (car (oref a bounds)) (cdr (oref a bounds)))
-		(delete-region (car (oref a bounds))
-			       (cdr (oref a bounds)))
-		(goto-char (car (oref a bounds))))
-	      ;; We have some new text.  Stick it in.
-	      (if tok
-		  (semantic-ia-insert-tag tok)
-		(insert tc)))
-	  ;; We don't have new text.  Show all completions.
-	  (when (cdr (oref a bounds))
-	    (goto-char (cdr (oref a bounds))))
-	  (with-output-to-temp-buffer "*Completions*"
-	    (display-completion-list
-	     (mapcar semantic-ia-completion-format-tag-function syms))
-	    ))))))
+	      ;; This is a way of making this fcn more useful since
+	      ;; the smart completion engine sometimes failes.
+	      (semantic-complete-symbol))
+	;; Use try completion to seek a common substring.
+	(let ((tc (try-completion (or pre "")  syms)))
+	  (if (and (stringp tc) (not (string= tc (or pre ""))))
+	      (let ((tok (semantic-find-first-tag-by-name
+			  tc syms)))
+		;; Delete what came before...
+		(when (and (car (oref a bounds)) (cdr (oref a bounds)))
+		  (delete-region (car (oref a bounds))
+				 (cdr (oref a bounds)))
+		  (goto-char (car (oref a bounds))))
+		;; We have some new text.  Stick it in.
+		(if tok
+		    (semantic-ia-insert-tag tok)
+		  (insert tc)))
+	    ;; We don't have new text.  Show all completions.
+	    (when (cdr (oref a bounds))
+	      (goto-char (cdr (oref a bounds))))
+	    (with-output-to-temp-buffer "*Completions*"
+	      (display-completion-list
+	       (mapcar semantic-ia-completion-format-tag-function syms)))))))))
 
 (defcustom semantic-ia-completion-menu-format-tag-function
   'semantic-uml-concise-prototype-nonterminal
@@ -177,7 +159,7 @@
   "Pop up a tooltip for completion at POINT."
   (interactive "d")
   (let* ((a (semantic-analyze-current-context point))
-	 (syms (semantic-ia-get-completions a point))
+	 (syms (semantic-analyze-possible-completions a))
          (x (mod (- (current-column) (window-hscroll))
                  (window-width)))
          (y (save-excursion
@@ -216,8 +198,48 @@
 	       ;; tag associated with the current context.
 	       (semantic-analyze-interesting-tag ctxt)))
 	)
-    (when pf
-      (message "%s" (semantic-format-tag-summarize pf nil t)))))
+    (if pf
+	(message "%s" (semantic-format-tag-summarize pf nil t))
+      (message "No summary info availalble"))))
+
+;;; Variants
+;;
+;; Show all variants for the symbol under point.
+
+;;;###autoload
+(defun semantic-ia-show-variants (point)
+  "Display a list of all variants for the symbol under POINT."
+  (interactive "P")
+  (let* ((ctxt (semantic-analyze-current-context point))
+	 (comp nil))
+
+    ;; We really want to look at the function if we are on an
+    ;; argument.  Are there some additional rules we care about for
+    ;; changing the CTXT we look at?
+    (when (semantic-analyze-context-functionarg-p ctxt)
+      (goto-char (cdr (oref ctxt bounds)))
+      (setq ctxt (semantic-analyze-current-context (point))))
+
+    ;; Get the "completion list", but remove ALL filters to get the master list
+    ;; of all the possible things.
+    (setq comp (semantic-analyze-possible-completions ctxt 'no-unique 'no-tc))
+
+    ;; Special case for a single type.  List the constructors?
+    (when (and (= (length comp) 1) (semantic-tag-of-class-p (car comp) 'type))
+      (setq comp (semantic-find-tags-by-name (semantic-tag-name (car comp))
+					     (semantic-tag-type-members (car comp)))))
+
+    ;; Display the results.
+    (cond ((= (length comp) 0)
+	   (message "No Variants found."))
+	  ((= (length comp) 1)
+	   (message "%s" (semantic-format-tag-summarize (car comp) nil t)))
+	  (t
+	   (with-output-to-temp-buffer "*Symbol Variants*"
+	     (semantic-analyze-princ-sequence comp "" (current-buffer)))
+	   (shrink-window-if-larger-than-buffer
+	    (get-buffer-window "*Symbol Variants*")))
+	  )))
 
 ;;; FAST Jump
 ;;
@@ -358,18 +380,21 @@
       ;; The default tries to find a comment in front of the tag
       ;; and then strings off comment prefixes.
       (let ((doc (semantic-documentation-for-tag (car pf))))
-	(with-output-to-temp-buffer "*TAG DOCUMENTATION*"
-	  (princ "Tag: ")
-	  (princ (semantic-format-tag-prototype (car pf)))
-	  (princ "\n")
-	  (princ "\n")
-	  (princ "Snarfed Documentation: ")
-	  (princ "\n")
-	  (princ "\n")
-	  (if doc
-	      (princ doc)
-	    (princ "  Documentation unavailable."))
-	  )))
+	(if (or (null doc) (string= doc ""))
+	    (message "Doc unavailable for: %s"
+		     (semantic-format-tag-prototype (car pf)))
+	  (with-output-to-temp-buffer "*TAG DOCUMENTATION*"
+	    (princ "Tag: ")
+	    (princ (semantic-format-tag-prototype (car pf)))
+	    (princ "\n")
+	    (princ "\n")
+	    (princ "Snarfed Documentation: ")
+	    (princ "\n")
+	    (princ "\n")
+	    (if doc
+		(princ doc)
+	      (princ "  Documentation unavailable."))
+	    ))))
      (t
       (message "Unknown tag.")))
     ))
--- a/lisp/cedet/semantic/idle.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/idle.el	Wed Oct 13 22:40:51 2010 +0900
@@ -49,6 +49,7 @@
 (defvar eldoc-last-message)
 (declare-function eldoc-message "eldoc")
 (declare-function semantic-analyze-interesting-tag "semantic/analyze")
+(declare-function semantic-analyze-unsplit-name "semantic/analyze/fcn")
 (declare-function semantic-complete-analyze-inline-idle "semantic/complete")
 (declare-function semanticdb-deep-find-tags-by-name "semantic/db-find")
 (declare-function semanticdb-save-all-db-idle "semantic/db")
@@ -328,12 +329,18 @@
 ;;
 ;; Unlike the shorter timer, the WORK timer will kick of tasks that
 ;; may take a long time to complete.
-(defcustom semantic-idle-work-parse-neighboring-files-flag t
+(defcustom semantic-idle-work-parse-neighboring-files-flag nil
   "*Non-nil means to parse files in the same dir as the current buffer.
 Disable to prevent lots of excessive parsing in idle time."
   :group 'semantic
   :type 'boolean)
 
+(defcustom semantic-idle-work-update-headers-flag nil
+  "*Non-nil means to parse through header files in idle time.
+Disable to prevent idle time parsing of many files.  If completion
+is called that work will be done then instead."
+  :group 'semantic
+  :type 'boolean)
 
 (defun semantic-idle-work-for-one-buffer (buffer)
   "Do long-processing work for BUFFER.
@@ -346,6 +353,9 @@
 	    (semantic-idle-scheduler-refresh-tags)
 	    t)
 
+	  ;; Option to disable this work.
+	  semantic-idle-work-update-headers-flag
+
 	  ;; Force all our include files to get read in so we
 	  ;; are ready to provide good smart completion and idle
 	  ;; summary information
@@ -674,6 +684,11 @@
 ;;; SUMMARY MODE
 ;;
 ;; A mode similar to eldoc using semantic
+(defcustom semantic-idle-truncate-long-summaries t
+  "Truncate summaries that are too long to fit in the minibuffer.
+This can prevent minibuffer resizing in idle time."
+  :group 'semantic
+  :type 'boolean)
 
 (defcustom semantic-idle-summary-function
   'semantic-format-tag-summarize-with-file
@@ -725,21 +740,16 @@
   "Return a string message describing the current context.
 This function will disable loading of previously unloaded files
 by semanticdb as a time-saving measure."
-  (let (
-	(semanticdb-find-default-throttle
-	 (if (featurep 'semantic/db-find)
-	     (remq 'unloaded semanticdb-find-default-throttle)
-	   nil))
-	)
-    (save-excursion
-      ;; use whicever has success first.
-      (or
-       (semantic-idle-summary-current-symbol-keyword)
+  (semanticdb-without-unloaded-file-searches
+      (save-excursion
+	;; use whichever has success first.
+	(or
+	 (semantic-idle-summary-current-symbol-keyword)
 
-       (semantic-idle-summary-current-symbol-info-context)
+	 (semantic-idle-summary-current-symbol-info-context)
 
-       (semantic-idle-summary-current-symbol-info-brutish)
-       ))))
+	 (semantic-idle-summary-current-symbol-info-brutish)
+	 ))))
 
 (defvar semantic-idle-summary-out-of-context-faces
   '(
@@ -803,6 +813,14 @@
           (let ((w (1- (window-width (minibuffer-window)))))
             (if (> (length str) w)
                 (setq str (substring str 0 w)))))
+	;; I borrowed some bits from eldoc to shorten the
+	;; message.
+	(when semantic-idle-truncate-long-summaries
+	  (let ((ea-width (1- (window-width (minibuffer-window))))
+		(strlen (length str)))
+	    (when (> strlen ea-width)
+	      (setq str (substring str 0 ea-width)))))
+	;; Display it
         (eldoc-message str))))
 
 (define-minor-mode semantic-idle-summary-mode
@@ -868,12 +886,12 @@
 ;; of all uses of the symbol that is under the cursor.
 ;;
 ;; This is to mimic the Eclipse tool of a similar nature.
-(defvar semantic-idle-summary-highlight-face 'region
-  "Face used for the summary highlight.")
+(defvar semantic-idle-symbol-highlight-face 'region
+  "Face used for highlighting local symbols.")
 
-(defun semantic-idle-summary-maybe-highlight (tag)
-  "Perhaps add highlighting onto TAG.
-TAG was found as the thing under point.  If it happens to be
+(defun semantic-idle-symbol-maybe-highlight (tag)
+  "Perhaps add highlighting to the symbol represented by TAG.
+TAG was found as the symbol under point.  If it happens to be
 visible, then highlight it."
   (require 'pulse)
   (let* ((region (when (and (semantic-tag-p tag)
@@ -894,12 +912,12 @@
 		    (point) (get-buffer-window (current-buffer) 'visible))
 	       (if (< (semantic-overlay-end region) (point-at-eol))
 		   (pulse-momentary-highlight-overlay
-		    region semantic-idle-summary-highlight-face)
+		    region semantic-idle-symbol-highlight-face)
 		 ;; Not the same
 		 (pulse-momentary-highlight-region
 		  (semantic-overlay-start region)
 		  (point-at-eol)
-		  semantic-idle-summary-highlight-face)))
+		  semantic-idle-symbol-highlight-face)))
 	     ))
 	  ((vectorp region)
 	   (let ((start (aref region 0))
@@ -919,17 +937,19 @@
 		   (pulse-momentary-highlight-region
 		    start (if (<= end (point-at-eol)) end
 			    (point-at-eol))
-		    semantic-idle-summary-highlight-face)))
+		    semantic-idle-symbol-highlight-face)))
 	       ))))
     nil))
 
-(define-semantic-idle-service semantic-idle-tag-highlight
-  "Highlight the tag, and references of the symbol under point.
+(define-semantic-idle-service semantic-idle-local-symbol-highlight
+  "Highlight the tag and symbol references of the symbol under point.
 Call `semantic-analyze-current-context' to find the reference tag.
 Call `semantic-symref-hits-in-region' to identify local references."
   (require 'pulse)
   (when (semantic-idle-summary-useful-context-p)
-    (let* ((ctxt (semantic-analyze-current-context))
+    (let* ((ctxt
+	    (semanticdb-without-unloaded-file-searches
+		(semantic-analyze-current-context)))
 	   (Hbounds (when ctxt (oref ctxt bounds)))
 	   (target (when ctxt (car (reverse (oref ctxt prefix)))))
 	   (tag (semantic-current-tag))
@@ -939,7 +959,7 @@
       (when ctxt
 	;; Highlight the original tag?  Protect against problems.
 	(condition-case nil
-	    (semantic-idle-summary-maybe-highlight target)
+	    (semantic-idle-symbol-maybe-highlight target)
 	  (error nil))
 	;; Identify all hits in this current tag.
 	(when (semantic-tag-p target)
@@ -948,7 +968,7 @@
 	   target (lambda (start end prefix)
 		    (when (/= start (car Hbounds))
 		      (pulse-momentary-highlight-region
-		       start end semantic-idle-summary-highlight-face))
+		       start end semantic-idle-symbol-highlight-face))
 		    (semantic-throw-on-input 'symref-highlight)
 		    )
 	   (semantic-tag-start tag)
@@ -968,7 +988,7 @@
   (when (or (and (numberp arg) (< arg 0))
 	    (and (null arg) global-semantic-idle-scheduler-mode))
     (global-semantic-idle-summary-mode -1)
-    (global-semantic-idle-tag-highlight-mode -1)
+    (global-semantic-idle-local-symbol-highlight-mode -1)
     (global-semantic-idle-completions-mode -1))
   (setq global-semantic-idle-scheduler-mode
         (semantic-toggle-minor-mode-globally
@@ -980,25 +1000,23 @@
 ;; This mode uses tooltips to display a (hopefully) short list of possible
 ;; completions available for the text under point.  It provides
 ;; NO provision for actually filling in the values from those completions.
+(defun semantic-idle-completions-end-of-symbol-p ()
+  "Return non-nil if the cursor is at the END of a symbol.
+If the cursor is in the middle of a symbol, then we shouldn't be
+doing fancy completions."
+  (not (looking-at "\\w\\|\\s_")))
 
 (defun semantic-idle-completion-list-default ()
   "Calculate and display a list of completions."
-  (when (semantic-idle-summary-useful-context-p)
+  (when (and (semantic-idle-summary-useful-context-p)
+	     (semantic-idle-completions-end-of-symbol-p))
     ;; This mode can be fragile.  Ignore problems.
     ;; If something doesn't do what you expect, run
     ;; the below command by hand instead.
     (condition-case nil
-	(let (
-	      ;; Don't go loading in oodles of header libraries in
-	      ;; IDLE time.
-	      (semanticdb-find-default-throttle
-	       (if (featurep 'semantic/db-find)
-		   (remq 'unloaded semanticdb-find-default-throttle)
-		 nil))
-	      )
-	  ;; Use idle version.
-	  (require 'semantic/complete)
-	  (semantic-complete-analyze-inline-idle)
+	(semanticdb-without-unloaded-file-searches
+	    ;; Use idle version.
+	    (semantic-complete-analyze-inline-idle)
 	  )
       (error nil))
     ))
@@ -1026,6 +1044,347 @@
   ;; Add the ability to override sometime.
   (semantic-idle-completion-list-default))
 
+
+;;; Breadcrumbs for tag under point
+;;
+;; Service that displays a breadcrumbs indication of the tag under
+;; point and its parents in the header or mode line.
+;;
+
+(defcustom semantic-idle-breadcrumbs-display-function
+  #'semantic-idle-breadcrumbs--display-in-header-line
+  "Function to display the tag under point in idle time.
+This function should take a list of Semantic tags as its only
+argument. The tags are sorted according to their nesting order,
+starting with the outermost tag. The function should call
+`semantic-idle-breadcrumbs-format-tag-list-function' to convert
+the tag list into a string."
+  :group 'semantic
+  :type  '(choice
+	   (const    :tag "Display in header line"
+		     semantic-idle-breadcrumbs--display-in-header-line)
+	   (const    :tag "Display in mode line"
+		     semantic-idle-breadcrumbs--display-in-mode-line)
+	   (function :tag "Other function")))
+
+(defcustom semantic-idle-breadcrumbs-format-tag-list-function
+  #'semantic-idle-breadcrumbs--format-linear
+  "Function to format the list of tags containing point.
+This function should take a list of Semantic tags and an optional
+maximum length of the produced string as its arguments. The
+maximum length is a hint and can be ignored. When the maximum
+length is omitted, an unconstrained string should be
+produced. The tags are sorted according to their nesting order,
+starting with the outermost tag. Single tags should be formatted
+using `semantic-idle-breadcrumbs-format-tag-function' unless
+special formatting is required."
+  :group 'semantic
+  :type  '(choice
+	   (const    :tag "Format tags as list, innermost last"
+		     semantic-idle-breadcrumbs--format-linear)
+	   (const    :tag "Innermost tag with details, followed by remaining tags"
+		     semantic-idle-breadcrumbs--format-innermost-first)
+	   (function :tag "Other function")))
+
+(defcustom semantic-idle-breadcrumbs-format-tag-function
+  #'semantic-format-tag-abbreviate
+  "Function to call to format information about tags.
+This function should take a single argument, a Semantic tag, and
+return a string to display.
+Some useful functions are found in `semantic-format-tag-functions'."
+   :group 'semantic
+   :type  semantic-format-tag-custom-list)
+
+(defcustom semantic-idle-breadcrumbs-separator 'mode-specific
+  "Specify how to separate tags in the breadcrumbs string.
+An arbitrary string or a mode-specific scope nesting
+string (like, for example, \"::\" in C++, or \".\" in Java) can
+be used."
+  :group 'semantic
+  :type  '(choice
+	   (const  :tag "Use mode specific separator"
+		   mode-specific)
+	   (string :tag "Specify separator string")))
+
+(defcustom semantic-idle-breadcrumbs-header-line-prefix
+  semantic-stickyfunc-indent-string ;; TODO not optimal
+  "String used to indent the breadcrumbs string.
+Customize this string to match the space used by scrollbars and
+fringe."
+  :group 'semantic
+  :type  'string)
+
+(defvar semantic-idle-breadcrumbs-popup-menu nil
+  "Menu used when a tag displayed by `semantic-idle-breadcrumbs-mode' is clicked.")
+
+(defun semantic-idle-breadcrumbs--popup-menu (event)
+  "Popup a menu that displays things to do to the clicked tag.
+Argument EVENT describes the event that caused this function to
+be called."
+  (interactive "e")
+  (let ((old-window (selected-window))
+	(window     (semantic-event-window event)))
+    (select-window window t)
+    (semantic-popup-menu semantic-idle-breadcrumbs-popup-menu)
+    (select-window old-window)))
+
+(defmacro semantic-idle-breadcrumbs--tag-function (function)
+  "Return lambda expression calling FUNCTION when called from a popup."
+  `(lambda (event)
+     (interactive "e")
+     (let* ((old-window (selected-window))
+	    (window     (semantic-event-window event))
+	    (column     (car (nth 6 (nth 1 event)))) ;; TODO semantic-event-column?
+	    (tag        (progn
+			  (select-window window t)
+			  (plist-get
+			   (text-properties-at column header-line-format)
+			   'tag))))
+       (,function tag)
+       (select-window old-window)))
+  )
+
+;; TODO does this work for mode-line case?
+(defvar semantic-idle-breadcrumbs-popup-map
+  (let ((map (make-sparse-keymap)))
+    ;; mouse-1 goes to clicked tag
+    (define-key map
+      [ header-line mouse-1 ]
+      (semantic-idle-breadcrumbs--tag-function
+       semantic-go-to-tag))
+    ;; mouse-3 pops up a context menu
+    (define-key map
+      [ header-line mouse-3 ]
+      'semantic-idle-breadcrumbs--popup-menu)
+    map)
+  "Keymap for semantic idle breadcrumbs minor mode.")
+
+(easy-menu-define
+  semantic-idle-breadcrumbs-popup-menu
+  semantic-idle-breadcrumbs-popup-map
+  "Semantic Breadcrumbs Mode Menu"
+  (list
+   "Breadcrumb Tag"
+   (semantic-menu-item
+    (vector
+     "Go to Tag"
+     (semantic-idle-breadcrumbs--tag-function
+      semantic-go-to-tag)
+     :active t
+     :help  "Jump to this tag"))
+   ;; TODO these entries need minor changes (optional tag argument) in
+   ;; senator-copy-tag etc
+  ;;  (semantic-menu-item
+  ;;   (vector
+  ;;    "Copy Tag"
+  ;;    (semantic-idle-breadcrumbs--tag-function
+  ;;     senator-copy-tag)
+  ;;    :active t
+  ;;    :help   "Copy this tag"))
+  ;;   (semantic-menu-item
+  ;;    (vector
+  ;;     "Kill Tag"
+  ;;     (semantic-idle-breadcrumbs--tag-function
+  ;;      senator-kill-tag)
+  ;;     :active t
+  ;;     :help   "Kill tag text to the kill ring, and copy the tag to
+  ;; the tag ring"))
+  ;;   (semantic-menu-item
+  ;;    (vector
+  ;;     "Copy Tag to Register"
+  ;;     (semantic-idle-breadcrumbs--tag-function
+  ;;      senator-copy-tag-to-register)
+  ;;     :active t
+  ;;     :help   "Copy this tag"))
+  ;;   (semantic-menu-item
+  ;;    (vector
+  ;;     "Narrow to Tag"
+  ;;     (semantic-idle-breadcrumbs--tag-function
+  ;;      senator-narrow-to-defun)
+  ;;     :active t
+  ;;     :help   "Narrow to the bounds of the current tag"))
+  ;;   (semantic-menu-item
+  ;;    (vector
+  ;;     "Fold Tag"
+  ;;     (semantic-idle-breadcrumbs--tag-function
+  ;;      senator-fold-tag-toggle)
+  ;;     :active   t
+  ;;     :style    'toggle
+  ;;     :selected '(let ((tag (semantic-current-tag)))
+  ;; 		   (and tag (semantic-tag-folded-p tag)))
+  ;;     :help     "Fold the current tag to one line"))
+    "---"
+    (semantic-menu-item
+     (vector
+      "About this Header Line"
+      (lambda ()
+	(interactive)
+	(describe-function 'semantic-idle-breadcrumbs-mode))
+      :active t
+      :help   "Display help about this header line."))
+    )
+  )
+
+(define-semantic-idle-service semantic-idle-breadcrumbs
+  "Display breadcrumbs for the tag under point and its parents."
+  (let* ((scope    (semantic-calculate-scope))
+	 (tag-list (if scope
+		       ;; If there is a scope, extract the tag and its
+		       ;; parents.
+		       (append (oref scope parents)
+			       (when (oref scope tag)
+				 (list (oref scope tag))))
+		     ;; Fall back to tags by overlay
+		     (semantic-find-tag-by-overlay))))
+    ;; Display the tags.
+    (funcall semantic-idle-breadcrumbs-display-function tag-list)))
+
+(defun semantic-idle-breadcrumbs--display-in-header-line (tag-list)
+  "Display the tags in TAG-LIST in the header line of their buffer."
+  (let ((width (- (nth 2 (window-edges))
+		  (nth 0 (window-edges)))))
+    ;; Format TAG-LIST and put the formatted string into the header
+    ;; line.
+    (setq header-line-format
+	  (concat
+	   semantic-idle-breadcrumbs-header-line-prefix
+	   (if tag-list
+	       (semantic-idle-breadcrumbs--format-tag-list
+		tag-list
+		(- width
+		   (length semantic-idle-breadcrumbs-header-line-prefix)))
+	     (propertize
+	      "<not on tags>"
+	      'face
+	      'font-lock-comment-face)))))
+
+  ;; Update the header line.
+  (force-mode-line-update))
+
+(defun semantic-idle-breadcrumbs--display-in-mode-line (tag-list)
+  "Display the tags in TAG-LIST in the mode line of their buffer.
+TODO THIS FUNCTION DOES NOT WORK YET."
+
+  (error "This function does not work yet")
+
+  (let ((width (- (nth 2 (window-edges))
+		  (nth 0 (window-edges)))))
+    (setq mode-line-format
+	  (semantic-idle-breadcrumbs--format-tag-list tag-list width)))
+
+  (force-mode-line-update))
+
+(defun semantic-idle-breadcrumbs--format-tag-list (tag-list max-length)
+  "Format TAG-LIST using configured functions respecting MAX-LENGTH.
+If the initial formatting result is longer than MAX-LENGTH, it is
+shortened at the beginning."
+  ;; Format TAG-LIST using the configured formatting function.
+  (let* ((complete-format (funcall
+			   semantic-idle-breadcrumbs-format-tag-list-function
+			   tag-list max-length))
+	 ;; Determine length of complete format.
+	 (complete-length (length complete-format)))
+    ;; Shorten string if necessary.
+    (if (<= complete-length max-length)
+	complete-format
+      (concat "... "
+	      (substring
+	       complete-format
+	       (- complete-length (- max-length 4))))))
+  )
+
+(defun semantic-idle-breadcrumbs--format-linear
+  (tag-list &optional max-length)
+  "Format TAG-LIST as a linear list, starting with the outermost tag.
+MAX-LENGTH is not used."
+  (require 'semantic/analyze/fcn)
+  (let* ((format-pieces   (mapcar
+			   #'semantic-idle-breadcrumbs--format-tag
+			   tag-list))
+	 ;; Format tag list, putting configured separators between the
+	 ;; tags.
+	 (complete-format (cond
+			   ;; Mode specific separator.
+			   ((eq semantic-idle-breadcrumbs-separator
+				'mode-specific)
+			    (semantic-analyze-unsplit-name format-pieces))
+
+			   ;; Custom separator.
+			   ((stringp semantic-idle-breadcrumbs-separator)
+			    (mapconcat
+			     #'identity
+			     format-pieces
+			     semantic-idle-breadcrumbs-separator)))))
+    complete-format)
+  )
+
+(defun semantic-idle-breadcrumbs--format-innermost-first
+  (tag-list &optional max-length)
+  "Format TAG-LIST placing the innermost tag first, separated from its parents.
+If MAX-LENGTH is non-nil, the innermost tag is shortened."
+  (let* (;; Separate and format remaining tags. Calculate length of
+	 ;; resulting string.
+	 (rest-tags       (butlast tag-list))
+	 (rest-format     (if rest-tags
+			      (concat
+			       " | "
+			       (semantic-idle-breadcrumbs--format-linear
+				rest-tags))
+			    ""))
+	 (rest-length     (length rest-format))
+	 ;; Format innermost tag and calculate length of resulting
+	 ;; string.
+	 (inner-format    (semantic-idle-breadcrumbs--format-tag
+			   (car (last tag-list))
+			   #'semantic-format-tag-prototype))
+	 (inner-length    (length inner-format))
+	 ;; Calculate complete length and shorten string for innermost
+	 ;; tag if MAX-LENGTH is non-nil and the complete string is
+	 ;; too long.
+	 (complete-length (+ inner-length rest-length))
+	 (inner-short     (if (and max-length
+				   (<= complete-length max-length))
+			      inner-format
+			    (concat (substring
+				     inner-format
+				     0
+				     (- inner-length
+					(- complete-length max-length)
+					4))
+				    " ..."))))
+    ;; Concat both parts.
+    (concat inner-short rest-format))
+  )
+
+(defun semantic-idle-breadcrumbs--format-tag (tag &optional format-function)
+  "Format TAG using the configured function or FORMAT-FUNCTION.
+This function also adds text properties for help-echo, mouse
+highlighting and a keymap."
+  (let ((formatted (funcall
+		    (or format-function
+			semantic-idle-breadcrumbs-format-tag-function)
+		    tag nil t)))
+    (add-text-properties
+     0 (length formatted)
+     (list
+      'tag
+      tag
+      'help-echo
+      (format
+       "Tag %s
+Type: %s
+mouse-1: jump to tag
+mouse-3: popup context menu"
+       (semantic-tag-name tag)
+       (semantic-tag-class tag))
+      'mouse-face
+      'highlight
+      'keymap
+      semantic-idle-breadcrumbs-popup-map)
+     formatted)
+    formatted))
+
+
 (provide 'semantic/idle)
 
 ;; Local variables:
--- a/lisp/cedet/semantic/imenu.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/imenu.el	Wed Oct 13 22:40:51 2010 +0900
@@ -99,7 +99,7 @@
 Overriden to nil if `semantic-imenu-bucketize-file' is nil."
   :group 'semantic-imenu
   :type 'boolean)
-(make-variable-buffer-local 'semantic-imenu-bucketize-type-parts)
+(make-variable-buffer-local 'semantic-imenu-bucketize-type-members)
 (semantic-varalias-obsolete 'semantic-imenu-bucketize-type-parts
                             'semantic-imenu-bucketize-type-members "23.2")
 
@@ -235,7 +235,7 @@
   (setq imenu-default-goto-function 'semantic-imenu-goto-function)
   (prog1
       (if (and semantic-imenu-index-directory
-               (featurep 'semanticdb)
+               (featurep 'semantic/db)
                (semanticdb-minor-mode-p))
           (semantic-create-imenu-directory-index
 	   (or stream (semantic-fetch-tags-fast)))
--- a/lisp/cedet/semantic/lex-spp.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/lex-spp.el	Wed Oct 13 22:40:51 2010 +0900
@@ -173,10 +173,42 @@
       (setq semantic-lex-spp-dynamic-macro-symbol-obarray-stack
 	    (make-vector 13 0))))
 
+(defun semantic-lex-spp-value-valid-p (value)
+  "Return non-nil if VALUE is valid."
+  (or (null value)
+      (stringp value)
+      (and (consp value)
+	   (or (semantic-lex-token-p (car value))
+	       (eq (car (car value)) 'spp-arg-list)))))
+
+(defvar semantic-lex-spp-debug-symbol nil
+  "A symbol to break on if it is being set somewhere.")
+
+(defun semantic-lex-spp-enable-debug-symbol (sym)
+  "Enable debugging for symbol SYM.
+Disable debugging by entering nothing."
+  (interactive "sSymbol: ")
+  (if (string= sym "")
+      (setq semantic-lex-spp-debug-symbol nil)
+    (setq semantic-lex-spp-debug-symbol sym)))
+
+(defmacro semantic-lex-spp-validate-value (name value)
+  "Validate the NAME and VALUE of a macro before it is set."
+;  `(progn
+;     (when (not (semantic-lex-spp-value-valid-p ,value))
+;       (error "Symbol \"%s\" with bogus value %S" ,name ,value))
+;     (when (and semantic-lex-spp-debug-symbol
+;		(string= semantic-lex-spp-debug-symbol name))
+;       (debug))
+;     )
+  nil
+  )
+
 (defun semantic-lex-spp-symbol-set (name value &optional obarray-in)
   "Set value of spp symbol with NAME to VALUE and return VALUE.
 If optional OBARRAY-IN is non-nil, then use that obarray instead of
 the dynamic map."
+  (semantic-lex-spp-validate-value name value)
   (if (and (stringp value) (string= value "")) (setq value nil))
   (set (intern name (or obarray-in
 			(semantic-lex-spp-dynamic-map)))
@@ -192,6 +224,7 @@
 (defun semantic-lex-spp-symbol-push (name value)
   "Push macro NAME with VALUE into the map.
 Reverse with `semantic-lex-spp-symbol-pop'."
+  (semantic-lex-spp-validate-value name value)
   (let* ((map (semantic-lex-spp-dynamic-map))
 	 (stack (semantic-lex-spp-dynamic-map-stack))
 	 (mapsym (intern name map))
@@ -864,42 +897,45 @@
 			   semantic-lex-spp-expanded-macro-stack
 			   ))
 	 )
-    (with-current-buffer buf
-      (erase-buffer)
-      ;; Below is a painful hack to make sure everything is setup correctly.
-      (when (not (eq major-mode mode))
-	(save-match-data
+    (if (> semantic-lex-spp-hack-depth 5)
+	nil
+      (with-current-buffer buf
+	(erase-buffer)
+	;; Below is a painful hack to make sure everything is setup correctly.
+	(when (not (eq major-mode mode))
+	  (save-match-data
 
-	  ;; Protect against user-hooks that throw errors.
-	  (condition-case nil
-	      (funcall mode)
-	    (error nil))
+	    ;; Protect against user-hooks that throw errors.
+	    (condition-case nil
+		(funcall mode)
+	      (error nil))
+
+	    ;; Hack in mode-local
+	    (activate-mode-local-bindings)
 
-	  ;; Hack in mode-local
-	  (activate-mode-local-bindings)
-	  ;; CHEATER!  The following 3 lines are from
-	  ;; `semantic-new-buffer-fcn', but we don't want to turn
-	  ;; on all the other annoying modes for this little task.
-	  (setq semantic-new-buffer-fcn-was-run t)
-	  (semantic-lex-init)
-	  (semantic-clear-toplevel-cache)
-	  (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
-		       t)
-	  ))
+	    ;; CHEATER!  The following 3 lines are from
+	    ;; `semantic-new-buffer-fcn', but we don't want to turn
+	    ;; on all the other annoying modes for this little task.
+	    (setq semantic-new-buffer-fcn-was-run t)
+	    (semantic-lex-init)
+	    (semantic-clear-toplevel-cache)
+	    (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook
+			 t)
+	    ))
 
-      ;; Second Cheat: copy key variables regarding macro state from the
-      ;; the originating buffer we are parsing.  We need to do this every time
-      ;; since the state changes.
-      (dolist (V important-vars)
-	(set V (semantic-buffer-local-value V origbuff)))
-      (insert text)
-      (goto-char (point-min))
+	;; Second Cheat: copy key variables regarding macro state from the
+	;; the originating buffer we are parsing.  We need to do this every time
+	;; since the state changes.
+	(dolist (V important-vars)
+	  (set V (semantic-buffer-local-value V origbuff)))
+	(insert text)
+	(goto-char (point-min))
 
-      (setq fresh-toks (semantic-lex-spp-stream-for-macro (point-max))))
+	(setq fresh-toks (semantic-lex-spp-stream-for-macro (point-max))))
 
-    (dolist (tok fresh-toks)
-      (when (memq (semantic-lex-token-class tok) '(symbol semantic-list))
-	(setq toks (cons tok toks))))
+      (dolist (tok fresh-toks)
+	(when (memq (semantic-lex-token-class tok) '(symbol semantic-list))
+	  (setq toks (cons tok toks)))))
 
     (nreverse toks)))
 
--- a/lisp/cedet/semantic/mru-bookmark.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/mru-bookmark.el	Wed Oct 13 22:40:51 2010 +0900
@@ -246,7 +246,7 @@
   :group 'semantic
   :group 'semantic-modes
   :type 'boolean
-  :require 'semantic-util-modes
+  :require 'semantic/util-modes
   :initialize 'custom-initialize-default
   :set (lambda (sym val)
          (global-semantic-mru-bookmark-mode (if val 1 -1))))
--- a/lisp/cedet/semantic/scope.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/scope.el	Wed Oct 13 22:40:51 2010 +0900
@@ -67,7 +67,7 @@
 	       :documentation
 	       "The list of types currently in scope.
 For C++, this would contain anonymous namespaces known, and
-anything labled by a `using' statement.")
+anything labeled by a `using' statement.")
    (parents :initform nil
 	    :documentation
 	    "List of parents in scope w/in the body of this function.
@@ -239,8 +239,11 @@
 	   )
       ;; In case of arg lists or some-such, throw out non-types.
       (while (and stack (not (semantic-tag-of-class-p pparent 'type)))
-	(setq stack (cdr stack)
-	            pparent (car (cdr stack))))
+	(setq stack (cdr stack) pparent (car (cdr stack))))
+
+      ;; Remove duplicates
+      (while (member pparent scopetypes)
+	(setq stack (cdr stack) pparent (car (cdr stack))))
 
       ;; Step 1:
       ;;    Analyze the stack of tags we are nested in as parents.
@@ -611,7 +614,7 @@
 	  ;; to do any of the stuff related to variables and what-not.
 	  (setq tmpscope (semantic-scope-cache "mini"))
 	  (let* ( ;; Step 1:
-		 (scopetypes (semantic-analyze-scoped-types (point)))
+		 (scopetypes (cons type (semantic-analyze-scoped-types (point))))
 		 (parents (semantic-analyze-scope-nested-tags (point) scopetypes))
 		 ;;(parentinherited (semantic-analyze-scope-lineage-tags parents scopetypes))
 		 (lscope nil)
--- a/lisp/cedet/semantic/sort.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/sort.el	Wed Oct 13 22:40:51 2010 +0900
@@ -463,7 +463,7 @@
   )
 
 (defun semantic-tag-external-member-parent-default (tag)
-  "Return the name of TAGs parent only if TAG is not defined in it's parent."
+  "Return the name of TAGs parent only if TAG is not defined in its parent."
   ;; Use only the extra spec because a type has a parent which
   ;; means something completely different.
   (let ((tp (semantic-tag-get-attribute tag :parent)))
@@ -473,7 +473,7 @@
 (define-overloadable-function semantic-tag-external-member-p (parent tag)
   "Return non-nil if PARENT is the parent of TAG.
 TAG is an external member of PARENT when it is somehow tagged
-as having PARENT as it's parent.
+as having PARENT as its parent.
 PARENT and TAG must both be semantic tags.
 
 The default behavior, if not overridden with
--- a/lisp/cedet/semantic/symref.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/symref.el	Wed Oct 13 22:40:51 2010 +0900
@@ -71,6 +71,7 @@
 (declare-function data-debug-insert-object-slots "eieio-datadebug")
 (declare-function ede-toplevel "ede/files")
 (declare-function ede-project-root-directory "ede/files")
+(declare-function ede-up-directory "ede/files")
 
 ;;; Code:
 (defvar semantic-symref-tool 'detect
@@ -98,16 +99,27 @@
 
 If no tools are supported, then 'grep is assumed.")
 
+(defun semantic-symref-calculate-rootdir ()
+  "Calculate the root directory for a symref search.
+Start with and EDE project, or use the default directory."
+  (let* ((rootproj (when (and (featurep 'ede) ede-minor-mode)
+		     (ede-toplevel)))
+	 (rootdirbase (if rootproj
+			  (ede-project-root-directory rootproj)
+			default-directory)))
+    (if (and rootproj (condition-case nil
+			  ;; Hack for subprojects.
+			  (oref rootproj :metasubproject)
+			(error nil)))
+	(ede-up-directory rootdirbase)
+      rootdirbase)))
+
 (defun semantic-symref-detect-symref-tool ()
   "Detect the symref tool to use for the current buffer."
   (if (not (eq semantic-symref-tool 'detect))
       semantic-symref-tool
     ;; We are to perform a detection for the right tool to use.
-    (let* ((rootproj (when (and (featurep 'ede) ede-minor-mode)
-		       (ede-toplevel)))
-	   (rootdir (if rootproj
-			(ede-project-root-directory rootproj)
-		      default-directory))
+    (let* ((rootdir (semantic-symref-calculate-rootdir))
 	   (tools semantic-symref-tool-alist))
       (while (and tools (eq semantic-symref-tool 'detect))
 	(when (funcall (car (car tools)) rootdir)
--- a/lisp/cedet/semantic/symref/grep.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/symref/grep.el	Wed Oct 13 22:40:51 2010 +0900
@@ -30,10 +30,6 @@
 (require 'semantic/symref)
 (require 'grep)
 
-(defvar ede-minor-mode)
-(declare-function ede-toplevel "ede/files")
-(declare-function ede-project-root-directory "ede/files")
-
 ;;; Code:
 
 ;;; GREP
@@ -86,7 +82,7 @@
 			      " -o ")
 		   " \\)"))
 	  (t
-	   (error "Configuration for `semantic-symref-tool-grep' needed for %s" major-mode))
+	   (error "Customize `semantic-symref-filepattern-alist' for %s" major-mode))
 	  )))
 
 (defvar semantic-symref-grep-expand-keywords
@@ -119,6 +115,12 @@
     ;;(message "New command: %s" cmd)
     cmd))
 
+(defcustom semantic-symref-grep-shell "sh"
+  "The shell command to use for executing find/grep.
+This shell should support pipe redirect syntax."
+  :group 'semantic
+  :type 'string)
+
 (defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep))
   "Perform a search with Grep."
   ;; Grep doesn't support some types of searches.
@@ -129,19 +131,7 @@
   ;; Find the root of the project, and do a find-grep...
   (let* (;; Find the file patterns to use.
 	 (pat (cdr (assoc major-mode semantic-symref-filepattern-alist)))
-	 (rootdir (cond
-		   ;; Project root via EDE.
-		   ((eq (oref tool :searchscope) 'project)
-		    (let ((rootproj (when (and (featurep 'ede) ede-minor-mode)
-				      (ede-toplevel))))
-		      (if rootproj
-			  (ede-project-root-directory rootproj)
-			default-directory)))
-		   ;; Calculate the target files as just in
-		   ;; this directory... cause I'm lazy.
-		   ((eq (oref tool :searchscope) 'target)
-		    default-directory)
-		   ))
+	 (rootdir (semantic-symref-calculate-rootdir))
 	 (filepattern (semantic-symref-derive-find-filepatterns))
 	 ;; Grep based flags.
 	 (grepflags (cond ((eq (oref tool :resulttype) 'file)
@@ -168,10 +158,10 @@
 	  (let ((cmd (concat "find " default-directory " -type f " filepattern " -print0 "
 			     "| xargs -0 grep -H " grepflags "-e " greppat)))
 	    ;;(message "Old command: %s" cmd)
-	    (call-process "sh" nil b nil "-c" cmd)
+	    (call-process semantic-symref-grep-shell nil b nil "-c" cmd)
 	    )
 	(let ((cmd (semantic-symref-grep-use-template rootdir filepattern grepflags greppat)))
-	  (call-process "sh" nil b nil "-c" cmd))
+	  (call-process semantic-symref-grep-shell nil b nil "-c" cmd))
 	))
     (setq ans (semantic-symref-parse-tool-output tool b))
     ;; Return the answer
--- a/lisp/cedet/semantic/symref/list.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/symref/list.el	Wed Oct 13 22:40:51 2010 +0900
@@ -33,6 +33,7 @@
 
 (require 'semantic/symref)
 (require 'semantic/complete)
+(require 'semantic/senator)
 (require 'pulse)
 
 ;;; Code:
@@ -42,9 +43,9 @@
   "Find references to the current tag.
 This command uses the currently configured references tool within the
 current project to find references to the current tag.  The
-references are the organized by file and the name of the function
+references are organized by file and the name of the function
 they are used in.
-Display the references in`semantic-symref-results-mode'."
+Display the references in `semantic-symref-results-mode'."
   (interactive)
   (semantic-fetch-tags)
   (let ((ct (semantic-current-tag))
@@ -65,6 +66,24 @@
   "Find references to the symbol SYM.
 This command uses the currently configured references tool within the
 current project to find references to the input SYM.  The
+references are organized by file and the name of the function
+they are used in.
+Display the references in `semantic-symref-results-mode'."
+  (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep
+					 "Symrefs for: "))))
+  (semantic-fetch-tags)
+  (let ((res nil)
+	)
+    ;; Gather results and tags
+    (message "Gathering References...")
+    (setq res (semantic-symref-find-references-by-name sym))
+    (semantic-symref-produce-list-on-results res sym)))
+
+;;;###autoload
+(defun semantic-symref-regexp (sym)
+  "Find references to the a symbol regexp SYM.
+This command uses the currently configured references tool within the
+current project to find references to the input SYM.  The
 references are the organized by file and the name of the function
 they are used in.
 Display the references in`semantic-symref-results-mode'."
@@ -75,7 +94,7 @@
 	)
     ;; Gather results and tags
     (message "Gathering References...")
-    (setq res (semantic-symref-find-references-by-name sym))
+    (setq res (semantic-symref-find-text sym))
     (semantic-symref-produce-list-on-results res sym)))
 
 
@@ -110,11 +129,59 @@
     (define-key km "n" 'semantic-symref-list-next-line)
     (define-key km "p" 'semantic-symref-list-prev-line)
     (define-key km "q" 'semantic-symref-hide-buffer)
+    (define-key km "\C-c\C-e" 'semantic-symref-list-expand-all)
+    (define-key km "\C-c\C-r" 'semantic-symref-list-contract-all)
+    (define-key km "R" 'semantic-symref-list-rename-open-hits)
+    (define-key km "(" 'semantic-symref-list-create-macro-on-open-hit)
+    (define-key km "E" 'semantic-symref-list-call-macro-on-open-hits)
     km)
   "Keymap used in `semantic-symref-results-mode'.")
 
+(defvar semantic-symref-list-menu-entries
+  (list
+   "Symref"
+   (semantic-menu-item
+    ["Toggle Line Open"
+     semantic-symref-list-toggle-showing
+     :active t
+     :help "Toggle the current line open or closed."
+     ])
+   (semantic-menu-item
+    ["Expand All Entries"
+     semantic-symref-list-expand-all
+     :active t
+     :help "Expand every expandable entry."
+     ])
+   (semantic-menu-item
+    ["Contract All Entries"
+     semantic-symref-list-contract-all
+     :active t
+     :help "Close every expandable entry."
+     ])
+   (semantic-menu-item
+    ["Rename Symbol in Open hits"
+     semantic-symref-list-rename-open-hits
+     :active t
+     :help "Rename the searched for symbol in all hits that are currently open."
+     ])
+   )
+  "Menu entries for the Semantic Symref list mode.")
+
+(defvar semantic-symref-list-menu nil
+  "Menu keymap build from `semantic-symref-results-mode'.")
+
+(easy-menu-define semantic-symref-list-menu
+  semantic-symref-results-mode-map
+  "Symref Mode Menu"
+  semantic-symref-list-menu-entries)
+
+(defcustom semantic-symref-auto-expand-results nil
+  "Non-nil to expand symref results on buffer creation."
+  :group 'semantic-symref
+  :type 'boolean)
+
 (defcustom semantic-symref-results-mode-hook nil
-  "*Hook run when `semantic-symref-results-mode' starts."
+  "Hook run when `semantic-symref-results-mode' starts."
   :group 'semantic-symref
   :type 'hook)
 
@@ -189,6 +256,10 @@
 
       ))
 
+  ;; Auto expand
+  (when semantic-symref-auto-expand-results
+    (semantic-symref-list-expand-all))
+
   ;; Clean up the mess
   (toggle-read-only 1)
   (set-buffer-modified-p nil)
@@ -305,7 +376,8 @@
 	 (win (selected-window))
 	 )
     (switch-to-buffer-other-window buff)
-    (with-no-warnings (goto-line line))
+    (goto-char (point-min))
+    (forward-line (1- line))
     (pulse-momentary-highlight-one-line (point))
     (when (eq last-command-event ?\s) (select-window win))
     )
@@ -323,6 +395,158 @@
   (forward-line -1)
   (back-to-indentation))
 
+(defun semantic-symref-list-expand-all ()
+  "Expand all the nodes in the current buffer."
+  (interactive)
+  (let ((start (make-marker)))
+    (move-marker start (point))
+    (goto-char (point-min))
+    (while (re-search-forward "\\[[+]\\]" nil t)
+      (semantic-symref-list-toggle-showing))
+    ;; Restore position
+    (goto-char start)))
+
+(defun semantic-symref-list-contract-all ()
+  "Expand all the nodes in the current buffer."
+  (interactive)
+  (let ((start (make-marker)))
+    (move-marker start (point))
+    (goto-char (point-min))
+    (while (re-search-forward "\\[[-]\\]" nil t)
+      (semantic-symref-list-toggle-showing))
+    ;; Restore position
+    (goto-char start)))
+
+;;; UTILS
+;;
+;; List mode utils for understadning the current line
+
+(defun semantic-symref-list-on-hit-p ()
+  "Return the line number if the cursor is on a buffer line with a hit.
+Hits are the line of code from the buffer, not the tag summar or file lines."
+  (save-excursion
+    (end-of-line)
+    (let* ((ol (car (semantic-overlays-at (1- (point)))))) ;; trust this for now
+      (when ol (semantic-overlay-get ol 'line)))))
+
+
+;;; Keyboard Macros on a Hit
+;;
+;; Record a macro on a hit, and store in a special way for execution later.
+(defun semantic-symref-list-create-macro-on-open-hit ()
+  "Record a keyboard macro at the location of the hit in the current list.
+Under point should be one hit for the active keyword.  Move
+cursor to the beginning of that symbol, then record a macro as if
+`kmacro-start-macro' was pressed.  Use `kmacro-end-macro',
+{kmacro-end-macro} to end the macro, and return to the symbol found list."
+  (interactive)
+  (let* ((oldsym (oref (oref semantic-symref-current-results
+			    :created-by)
+		      :searchfor))
+	 (ol (save-excursion
+	       (end-of-line)
+	       (car (semantic-overlays-at (1- (point))))))
+	 (tag (when ol (semantic-overlay-get ol 'tag)))
+	 (line (when ol (semantic-overlay-get ol 'line))))
+    (when (not line)
+      (error "Cannot create macro on a non-hit line"))
+    ;; Go there, and do something useful.
+    (switch-to-buffer-other-window (semantic-tag-buffer tag))
+    (goto-char (point-min))
+    (forward-line (1- line))
+    (when (not (re-search-forward (regexp-quote oldsym) (point-at-eol) t))
+      (error "Cannot find hit.  Cannot record macro"))
+    (goto-char (match-beginning 0))
+    ;; Cursor is now in the right location.  Start recording a macro.
+    (kmacro-start-macro nil)
+    ;; Notify the user
+    (message "Complete with C-x ).  Use E in the symref buffer to call this macro.")))
+
+(defun semantic-symref-list-call-macro-on-open-hits ()
+  "Call the most recently created keyboard macro on each hit.
+Cursor is placed at the beginning of the symbol found, even if
+there is more than one symbol on the current line.  The
+previously recorded macro is then executed."
+  (interactive)
+  (save-window-excursion
+    (let ((count (semantic-symref-list-map-open-hits
+		  (lambda ()
+		    (switch-to-buffer (current-buffer))
+		    (kmacro-call-macro nil)))))
+      (semantic-symref-list-update-open-hits)
+      (message "Executed Macro %d times." count))))
+
+;;; REFACTORING EDITS
+;;
+;; Utilities and features for refactoring across a list of hits.
+;;
+(defun semantic-symref-list-rename-open-hits (newname)
+  "Rename the discovered symbol references to NEWNAME.
+Only renames the locations that are open in the symref list.
+Closed items will be skipped."
+  (interactive
+   (list (read-string "Rename to: "
+		      (oref (oref semantic-symref-current-results
+				  :created-by)
+			    :searchfor))))
+  (let ((count (semantic-symref-list-map-open-hits
+		(lambda () (replace-match newname nil t)))))
+    (semantic-symref-list-update-open-hits)
+    (message "Renamed %d occurrences." count)))
+
+;;; REFACTORING UTILITIES
+;;
+;; Refactoring tools want to operate on only the "good" stuff the
+;; user selected.
+(defun semantic-symref-list-map-open-hits (function)
+  "For every open hit in the symref buffer, perform FUNCTION.
+The `match-data' will be set to a successful hit of the searched for symbol.
+Return the number of occurrences FUNCTION was operated upon."
+
+  ;; First Pass in this function - a straight rename.
+  ;; Second Pass - Allow context specification based on
+  ;;               class members. (Not Done)
+
+  (let ((oldsym (oref (oref semantic-symref-current-results
+			    :created-by)
+		      :searchfor))
+	(count 0))
+    (save-excursion
+      (goto-char (point-min))
+      (while (not (eobp))
+	;; Is this line a "hit" line?
+	(let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
+	       (tag (when ol (semantic-overlay-get ol 'tag)))
+	       (line (when ol (semantic-overlay-get ol 'line))))
+	  (when line
+	    ;; The "line" means we have an open hit.
+	    (with-current-buffer (semantic-tag-buffer tag)
+	      (goto-char (point-min))
+	      (forward-line (1- line))
+	      (beginning-of-line)
+	      (while (re-search-forward (regexp-quote oldsym) (point-at-eol) t)
+		(setq count (1+ count))
+		(save-excursion ;; Leave cursor after the matched name.
+		  (goto-char (match-beginning 0)) ;; Go to beginning of that sym
+		  (funcall function))))))
+	;; Go to the next line
+	(forward-line 1)
+	(end-of-line)))
+    count))
+
+(defun semantic-symref-list-update-open-hits ()
+  "Update the text for all the open hits in the symref list."
+  (save-excursion
+    (goto-char (point-min))
+    (while (re-search-forward "\\[-\\]" nil t)
+      (end-of-line)
+      (let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
+	     (tag (when ol (semantic-overlay-get ol 'tag))))
+	;; If there is a tag, then close/open it.
+	(when tag
+	  (semantic-symref-list-toggle-showing)
+	  (semantic-symref-list-toggle-showing))))))
+
 (provide 'semantic/symref/list)
 
 ;; Local variables:
--- a/lisp/cedet/semantic/tag.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/tag.el	Wed Oct 13 22:40:51 2010 +0900
@@ -53,7 +53,7 @@
 (declare-function semantic-fetch-tags "semantic")
 (declare-function semantic-clear-toplevel-cache "semantic")
 
-(defconst semantic-tag-version "2.0pre7"
+(defconst semantic-tag-version "2.0"
   "Version string of semantic tags made with this code.")
 
 (defconst semantic-tag-incompatible-version "1.0"
@@ -221,6 +221,7 @@
           ;; beginning of TAG.
           (or (and (>= (point) start) (< (point) end))
               (goto-char start))
+          (require 'semantic/ctxt)
           (semantic-ctxt-current-mode)))))
 
 (defsubst semantic--tag-attributes-cdr (tag)
@@ -687,18 +688,24 @@
 ;;
 (defun semantic-tag-deep-copy-one-tag (tag &optional filter)
   "Make a deep copy of TAG, applying FILTER to each child-tag.
-Properties and overlay info are not copied.
-FILTER takes TAG as an argument, and should returns a semantic-tag.
+No properties are copied except for :filename.
+Overlay will be a vector.
+FILTER takes TAG as an argument, and should return a `semantic-tag'.
 It is safe for FILTER to modify the input tag and return it."
   (when (not filter) (setq filter 'identity))
   (when (not (semantic-tag-p tag))
     (signal 'wrong-type-argument (list tag 'semantic-tag-p)))
-  (funcall filter (list (semantic-tag-name tag)
-                        (semantic-tag-class tag)
-                        (semantic--tag-deep-copy-attributes
-			 (semantic-tag-attributes tag) filter)
-                        nil
-                        nil)))
+  (let ((ol (semantic-tag-overlay tag))
+	(fn (semantic-tag-file-name tag)))
+    (funcall filter (list (semantic-tag-name tag)
+			  (semantic-tag-class tag)
+			  (semantic--tag-deep-copy-attributes
+			   (semantic-tag-attributes tag) filter)
+			  ;; Only copy the filename property
+			  (when fn (list :filename fn))
+			  ;; Only setup a vector if we had an overlay.
+			  (when ol (vector (semantic-tag-start tag)
+					   (semantic-tag-end tag)))))))
 
 (defun semantic--tag-deep-copy-attributes (attrs &optional filter)
   "Make a deep copy of ATTRS, applying FILTER to each child-tag.
@@ -877,7 +884,7 @@
   "Return the parent of the function that TAG describes.
 That is the value of the `:parent' attribute.
 A function has a parent if it is a method of a class, and if the
-function does not appear in body of it's parent class."
+function does not appear in body of its parent class."
   (semantic-tag-named-parent tag))
 
 (defsubst semantic-tag-function-destructor-p (tag)
--- a/lisp/cedet/semantic/texi.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/texi.el	Wed Oct 13 22:40:51 2010 +0900
@@ -591,12 +591,16 @@
 ;;     ;; Test for doc string
 ;;     (unless docstring
 ;;       (error "Could not find documentation for %s" (semantic-tag-name tag)))
+;;
+;;     (require 'srecode)
+;;     (require 'srecode-texi)
+;;
 ;;     ;; If we have a string, do the replacement.
 ;;     (delete-region (semantic-tag-start tag)
 ;; 		   (semantic-tag-end tag))
 ;;     ;; Use useful functions from the docaument library.
-;;     (require 'document)
-;;     (document-insert-texinfo doctag (semantic-tag-buffer doctag))
+;;    (srecode-texi-insert-tag-as-doc doctag)
+;;    ;(semantic-insert-foreign-tag doctag)
 ;;     ))
 
 ;; (defun semantic-texi-update-doc-from-source (&optional tag)
--- a/lisp/cedet/semantic/util-modes.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/util-modes.el	Wed Oct 13 22:40:51 2010 +0900
@@ -939,6 +939,13 @@
   "List of tag classes which stickyfunc will display in the header line.")
 (make-variable-buffer-local 'semantic-stickyfunc-sticky-classes)
 
+(defcustom semantic-stickyfunc-show-only-functions-p nil
+  "Non-nil means don't show lines that aren't part of a tag.
+If this is nil, then comments or other text between tags that is
+1 line above the top of the current window will be shown."
+  :group 'semantic
+  :type 'boolean)
+
 (defun semantic-stickyfunc-tag-to-stick ()
   "Return the tag to stick at the current point."
   (let ((tags (nreverse (semantic-find-tag-by-overlay (point)))))
@@ -955,45 +962,51 @@
   "Make the function at the top of the current window sticky.
 Capture its function declaration, and place it in the header line.
 If there is no function, disable the header line."
-  (let ((str
-	 (save-excursion
-	   (goto-char (window-start (selected-window)))
-	   (forward-line -1)
-	   (end-of-line)
-	   ;; Capture this function
-	   (let* ((tag (semantic-stickyfunc-tag-to-stick)))
-	     ;; TAG is nil if there was nothing of the appropriate type there.
-	     (if (not tag)
-		 ;; Set it to be the text under the header line
-		 (buffer-substring (point-at-bol) (point-at-eol))
-	       ;; Get it
-	       (goto-char (semantic-tag-start tag))
-               ;; Klaus Berndl <klaus.berndl@sdm.de>:
-               ;; goto the tag name; this is especially needed for languages
-               ;; like c++ where a often used style is like:
-               ;;     void
-               ;;     ClassX::methodM(arg1...)
-               ;;     {
-               ;;       ...
-               ;;     }
-               ;; Without going to the tag-name we would get"void" in the
-               ;; header line which is IMHO not really useful
-               (search-forward (semantic-tag-name tag) nil t)
-	       (buffer-substring (point-at-bol) (point-at-eol))
-	       ))))
-	(start 0))
-    (while (string-match "%" str start)
-      (setq str (replace-match "%%" t t str 0)
-	    start (1+ (match-end 0)))
-      )
-    ;; In 21.4 (or 22.1) the heder doesn't expand tabs.  Hmmmm.
-    ;; We should replace them here.
-    ;;
-    ;; This hack assumes that tabs are kept smartly at tab boundaries
-    ;; instead of in a tab boundary where it might only represent 4 spaces.
-    (while (string-match "\t" str start)
-      (setq str (replace-match "        " t t str 0)))
-    str))
+  (save-excursion
+    (goto-char (window-start (selected-window)))
+    (let* ((noshow (bobp))
+	   (str
+	    (progn
+	      (forward-line -1)
+	      (end-of-line)
+	      ;; Capture this function
+	      (let* ((tag (semantic-stickyfunc-tag-to-stick)))
+		;; TAG is nil if there was nothing of the appropriate type there.
+		(if (not tag)
+		    ;; Set it to be the text under the header line
+		    (if noshow
+			""
+		      (if semantic-stickyfunc-show-only-functions-p ""
+			(buffer-substring (point-at-bol) (point-at-eol))
+			))
+		  ;; Go get the first line of this tag.
+		  (goto-char (semantic-tag-start tag))
+		  ;; Klaus Berndl <klaus.berndl@sdm.de>:
+		  ;; goto the tag name; this is especially needed for languages
+		  ;; like c++ where a often used style is like:
+		  ;;     void
+		  ;;     ClassX::methodM(arg1...)
+		  ;;     {
+		  ;;       ...
+		  ;;     }
+		  ;; Without going to the tag-name we would get"void" in the
+		  ;; header line which is IMHO not really useful
+		  (search-forward (semantic-tag-name tag) nil t)
+		  (buffer-substring (point-at-bol) (point-at-eol))
+		  ))))
+	   (start 0))
+      (while (string-match "%" str start)
+	(setq str (replace-match "%%" t t str 0)
+	      start (1+ (match-end 0)))
+	)
+      ;; In 21.4 (or 22.1) the header doesn't expand tabs.  Hmmmm.
+      ;; We should replace them here.
+      ;;
+      ;; This hack assumes that tabs are kept smartly at tab boundaries
+      ;; instead of in a tab boundary where it might only represent 4 spaces.
+      (while (string-match "\t" str start)
+	(setq str (replace-match "        " t t str 0)))
+      str)))
 
 (defun semantic-stickyfunc-menu (event)
   "Popup a menu that can help a user understand stickyfunc-mode.
--- a/lisp/cedet/semantic/util.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/util.el	Wed Oct 13 22:40:51 2010 +0900
@@ -132,44 +132,6 @@
 (semantic-alias-obsolete 'semantic-something-to-stream
 			 'semantic-something-to-tag-table "23.2")
 
-;;; Recursive searching through dependency trees
-;;
-;; This will depend on the general searching APIS defined above.
-;; but will add full recursion through the dependencies list per
-;; stream.
-(defun semantic-recursive-find-nonterminal-by-name (name buffer)
-  "Recursively find the first occurrence of NAME.
-Start search with BUFFER.  Recurse through all dependencies till found.
-The return item is of the form (BUFFER TOKEN) where BUFFER is the buffer
-in which TOKEN (the token found to match NAME) was found.
-
-THIS ISN'T USED IN SEMANTIC.  DELETE ME SOON."
-  (with-current-buffer buffer
-    (let* ((stream (semantic-fetch-tags))
-	   (includelist (or (semantic-find-tags-by-class 'include stream)
-			    "empty.silly.thing"))
-	   (found (semantic-find-first-tag-by-name name stream))
-	   (unfound nil))
-      (while (and (not found) includelist)
-	(let ((fn (semantic-dependency-tag-file (car includelist))))
-	  (if (and fn (not (member fn unfound)))
-	      (with-current-buffer (save-match-data
-                                     (find-file-noselect fn))
-		(message "Scanning %s" (buffer-file-name))
-		(setq stream (semantic-fetch-tags))
-		(setq found (semantic-find-first-tag-by-name name stream))
-		(if found
-		    (setq found (cons (current-buffer) (list found)))
-		  (setq includelist
-			(append includelist
-				(semantic-find-tags-by-class
-				 'include stream))))
-		(setq unfound (cons fn unfound)))))
-	(setq includelist (cdr includelist)))
-      found)))
-(make-obsolete 'semantic-recursive-find-nonterminal-by-name
-	       "Do not use this function." "23.2")
-
 ;;; Completion APIs
 ;;
 ;; These functions provide minibuffer reading/completion for lists of
@@ -315,11 +277,12 @@
 	(princ "Buffer specific configuration items:\n")
 	(let ((vars '(major-mode
 		      semantic-case-fold
-		      semantic-expand-nonterminal
+		      semantic-tag-expand-function
 		      semantic-parser-name
 		      semantic-parse-tree-state
 		      semantic-lex-analyzer
 		      semantic-lex-reset-hooks
+		      semantic-lex-syntax-modifications
 		      )))
 	  (dolist (V vars)
 	    (semantic-describe-buffer-var-helper V buff)))
@@ -334,7 +297,8 @@
 		      semantic-after-toplevel-cache-change-hook
 		      semantic-before-toplevel-cache-flush-hook
 		      semantic-dump-parse
-
+		      semantic-type-relation-separator-character
+		      semantic-command-separation-character
 		      )))
 	  (dolist (V vars)
 	    (semantic-describe-buffer-var-helper V buff)))
@@ -344,34 +308,6 @@
 	)))
   )
 
-(defun semantic-current-tag-interactive (p)
-  "Display the current token.
-Argument P is the point to search from in the current buffer."
-  (interactive "d")
-  (require 'semantic/find)
-  (let ((tok (semantic-brute-find-innermost-tag-by-position
-	      p (current-buffer))))
-    (message (mapconcat 'semantic-abbreviate-nonterminal tok ","))
-    (car tok))
-  )
-
-(defun semantic-hack-search ()
-  "Display info about something under the cursor using generic methods."
-  (interactive)
-  (require 'semantic/find)
-  (let ((strm (cdr (semantic-fetch-tags)))
-	(res nil))
-    (setq res (semantic-brute-find-tag-by-position (point) strm))
-    (if res
-	(progn
-	  (pop-to-buffer "*SEMANTIC HACK RESULTS*")
-	  (require 'pp)
-	  (erase-buffer)
-	  (insert (pp-to-string res) "\n")
-	  (goto-char (point-min))
-	  (shrink-window-if-larger-than-buffer))
-      (message "nil"))))
-
 (defun semantic-assert-valid-token (tok)
   "Assert that TOK is a valid token."
   (if (semantic-tag-p tok)
@@ -415,7 +351,8 @@
 			      'unmatched)))
 	    (setq o (cons (car over) o)))
 	  (setq over (cdr over)))
-	(message "Remaining overlays: %S" o)))
+	(when (called-interactively-p 'any)
+	  (message "Remaining overlays: %S" o))))
   over)
 
 ;;; Interactive commands (from Senator).
--- a/lisp/cedet/semantic/wisent/python-wy.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/semantic/wisent/python-wy.el	Wed Oct 13 22:40:51 2010 +0900
@@ -35,6 +35,7 @@
 (defconst wisent-python-wy--keyword-table
   (semantic-lex-make-keyword-table
    '(("and" . AND)
+     ("as" . AS)
      ("assert" . ASSERT)
      ("break" . BREAK)
      ("class" . CLASS)
@@ -72,6 +73,7 @@
      ("pass" summary "Statement that does nothing")
      ("or" summary "Binary logical 'or' operator")
      ("not" summary "Unary boolean negation operator")
+     ("lambda" summary "Create anonymous function")
      ("is" summary "Binary operator that tests for object equality")
      ("in" summary "Part of 'for' statement ")
      ("import" summary "Load specified modules")
@@ -86,10 +88,11 @@
      ("elif" summary "Shorthand for 'else if' following an 'if' statement")
      ("del" summary "Delete specified objects, i.e., undo what assignment did")
      ("def" summary "Define a new function")
-     ("continue" summary "Skip to the next interation of enclosing 'for' or 'while' loop")
+     ("continue" summary "Skip to the next iteration of enclosing 'for' or 'while' loop")
      ("class" summary "Define a new class")
      ("break" summary "Terminate 'for' or 'while' loop")
      ("assert" summary "Raise AssertionError exception if <expr> is false")
+     ("as" summary "EXPR as NAME makes value of EXPR available as variable NAME")
      ("and" summary "Logical AND binary operator ... ")))
   "Table of language keywords.")
 
@@ -172,7 +175,7 @@
     (eval-when-compile
       (require 'semantic/wisent/comp))
     (wisent-compile-grammar
-     '((BACKSLASH NEWLINE INDENT DEDENT INDENT_BLOCK PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK LTLTEQ GTGTEQ EXPEQ DIVDIVEQ DIVDIV LTLT GTGT EXPONENT EQ GE LE PLUSEQ MINUSEQ MULTEQ DIVEQ MODEQ AMPEQ OREQ HATEQ LTGT NE HAT LT GT AMP MULT DIV MOD PLUS MINUS PERIOD TILDE BAR COLON SEMICOLON COMMA ASSIGN BACKQUOTE STRING_LITERAL NUMBER_LITERAL NAME AND ASSERT BREAK CLASS CONTINUE DEF DEL ELIF ELSE EXCEPT EXEC FINALLY FOR FROM GLOBAL IF IMPORT IN IS LAMBDA NOT OR PASS PRINT RAISE RETURN TRY WHILE YIELD)
+     '((BACKSLASH NEWLINE INDENT DEDENT INDENT_BLOCK PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK LTLTEQ GTGTEQ EXPEQ DIVDIVEQ DIVDIV LTLT GTGT EXPONENT EQ GE LE PLUSEQ MINUSEQ MULTEQ DIVEQ MODEQ AMPEQ OREQ HATEQ LTGT NE HAT LT GT AMP MULT DIV MOD PLUS MINUS PERIOD TILDE BAR COLON SEMICOLON COMMA ASSIGN BACKQUOTE STRING_LITERAL NUMBER_LITERAL NAME AND AS ASSERT BREAK CLASS CONTINUE DEF DEL ELIF ELSE EXCEPT EXEC FINALLY FOR FROM GLOBAL IF IMPORT IN IS LAMBDA NOT OR PASS PRINT RAISE RETURN TRY WHILE YIELD)
        nil
        (goal
 	((NEWLINE))
@@ -280,6 +283,9 @@
 	((testlist)
 	 nil))
        (yield_stmt
+	((YIELD)
+	 (wisent-raw-tag
+	  (semantic-tag-new-code $1 nil)))
 	((YIELD testlist)
 	 (wisent-raw-tag
 	  (semantic-tag-new-code $1 nil))))
@@ -320,14 +326,14 @@
 	((import_as_name_list COMMA import_as_name)
 	 nil))
        (import_as_name
-	((NAME name_name_opt)
+	((NAME as_name_opt)
 	 nil))
        (dotted_as_name
-	((dotted_name name_name_opt)))
-       (name_name_opt
+	((dotted_name as_name_opt)))
+       (as_name_opt
 	(nil)
-	((NAME NAME)
-	 nil))
+	((AS NAME)
+	 (identity $2)))
        (dotted_name
 	((NAME))
 	((dotted_name PERIOD NAME)
--- a/lisp/cedet/srecode.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode.el	Wed Oct 13 22:40:51 2010 +0900
@@ -40,7 +40,7 @@
 (require 'mode-local)
 (load "srecode/loaddefs" nil 'nomessage)
 
-(defvar srecode-version "1.0pre7"
+(defvar srecode-version "1.0"
   "Current version of the Semantic Recoder.")
 
 ;;; Code:
--- a/lisp/cedet/srecode/compile.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/compile.el	Wed Oct 13 22:40:51 2010 +0900
@@ -35,19 +35,17 @@
 (require 'semantic)
 (require 'eieio)
 (require 'eieio-base)
-(require 'srecode)
 (require 'srecode/table)
+(require 'srecode/dictionary)
 
 (declare-function srecode-template-inserter-newline-child-p "srecode/insert"
 		  t t)
-(declare-function srecode-create-section-dictionary "srecode/dictionary")
-(declare-function srecode-dictionary-compound-variable "srecode/dictionary")
 
 ;;; Code:
 
 ;;; Template Class
 ;;
-;; Templatets describe a patter of text that can be inserted into a
+;; Templates describe a pattern of text that can be inserted into a
 ;; buffer.
 ;;
 (defclass srecode-template (eieio-named)
@@ -213,6 +211,7 @@
 	(mode nil)
 	(application nil)
 	(priority nil)
+	(project nil)
 	(vars nil)
 	)
 
@@ -256,6 +255,8 @@
 		     (setq application (read firstvalue)))
 		    ((string= name "priority")
 		     (setq priority (read firstvalue)))
+		    ((string= name "project")
+		     (setq project firstvalue))
 		    (t
 		     ;; Assign this into some table of variables.
 		     (setq vars (cons (cons name firstvalue) vars))
@@ -297,12 +298,19 @@
     ;; Calculate priority
     ;;
     (if (not priority)
-	(let ((d (file-name-directory (buffer-file-name)))
-	      (sd (file-name-directory (locate-library "srecode")))
-	      (defaultdelta (if (eq mode 'default) 20 0)))
-	  (if (string= d sd)
-	      (setq priority (+ 80 defaultdelta))
-	    (setq priority (+ 30 defaultdelta)))
+	(let ((d (expand-file-name (file-name-directory (buffer-file-name))))
+	      (sd (expand-file-name (file-name-directory (locate-library "srecode"))))
+	      (defaultdelta (if (eq mode 'default) 0 10)))
+	  ;; @TODO :   WHEN INTEGRATING INTO EMACS
+	  ;;   The location of Emacs default templates needs to be specified
+	  ;;   here to also have a lower priority.
+	  (if (string-match (concat "^" sd) d)
+	      (setq priority (+ 30 defaultdelta))
+	    ;; If the user created template is for a project, then
+	    ;; don't add as much as if it is unique to just some user.
+	    (if (stringp project)
+		(setq priority (+ 50 defaultdelta))
+	      (setq priority (+ 80 defaultdelta))))
 	  (message "Templates %s has estimated priority of %d"
 		   (file-name-nondirectory (buffer-file-name))
 		   priority))
@@ -311,56 +319,56 @@
 	       priority))
 
     ;; Save it up!
-    (srecode-compile-template-table table mode priority application vars)
+    (srecode-compile-template-table table mode priority application project vars)
     )
 )
 
-(defun srecode-compile-one-template-tag (tag STATE)
-  "Compile a template tag TAG into an srecode template class.
-STATE is the current compile state as an object `srecode-compile-state'."
-  (require 'srecode/dictionary)
-  (let* ((context (oref STATE context))
-	 (codeout  (srecode-compile-split-code
-		    tag (semantic-tag-get-attribute tag :code)
-		    STATE))
-	 (code (cdr codeout))
-	 (args (semantic-tag-function-arguments tag))
-	 (binding (semantic-tag-get-attribute tag :binding))
-	 (rawdicts (semantic-tag-get-attribute tag :dictionaries))
-	 (sdicts (srecode-create-section-dictionary rawdicts STATE))
-	 (addargs nil)
-	 )
-;    (message "Compiled %s to %d codes with %d args and %d prompts."
-;	     (semantic-tag-name tag)
-;	     (length code)
-;	     (length args)
-;	     (length prompts))
-    (while args
-      (setq addargs (cons (intern (car args)) addargs))
-      (when (eq (car addargs) :blank)
-	;; If we have a wrap, then put wrap inserters on both
-	;; ends of the code.
-	(setq code (append
-		    (list (srecode-compile-inserter "BLANK"
-						    "\r"
-						    STATE
-						    :secondname nil
-						    :where 'begin))
-		    code
-		    (list (srecode-compile-inserter "BLANK"
-						    "\r"
-						    STATE
-						    :secondname nil
-						    :where 'end))
-			  )))
-      (setq args (cdr args)))
+(defun srecode-compile-one-template-tag (tag state)
+  "Compile a template tag TAG into a srecode template object.
+STATE is the current compile state as an object of class
+`srecode-compile-state'."
+  (let* ((context   (oref state context))
+	 (code      (cdr (srecode-compile-split-code
+			  tag (semantic-tag-get-attribute tag :code)
+			  state)))
+	 (args      (semantic-tag-function-arguments tag))
+	 (binding   (semantic-tag-get-attribute tag :binding))
+	 (dict-tags (semantic-tag-get-attribute tag :dictionaries))
+	 (root-dict (when dict-tags
+		      (srecode-create-dictionaries-from-tags
+		       dict-tags state)))
+	 (addargs))
+    ;; Examine arguments.
+    (dolist (arg args)
+      (let ((symbol (intern arg)))
+	(push symbol addargs)
+
+	;; If we have a wrap, then put wrap inserters on both ends of
+	;; the code.
+	(when (eq symbol :blank)
+	  (setq code (append
+		      (list (srecode-compile-inserter
+			     "BLANK"
+			     "\r"
+			     state
+			     :secondname nil
+			     :where 'begin))
+		      code
+		      (list (srecode-compile-inserter
+			     "BLANK"
+			     "\r"
+			     state
+			     :secondname nil
+			     :where 'end)))))))
+
+    ;; Construct and return the template object.
     (srecode-template (semantic-tag-name tag)
-		      :context context
-		      :args (nreverse addargs)
-		      :dictionary sdicts
-		      :binding binding
-		      :code code)
-    ))
+		      :context    context
+		      :args       (nreverse addargs)
+		      :dictionary root-dict
+		      :binding    binding
+		      :code       code))
+  )
 
 (defun srecode-compile-do-hard-newline-p (comp)
   "Examine COMP to decide if the upcoming newline should be hard.
@@ -514,12 +522,13 @@
       (if (not new) (error "SRECODE: Unknown macro code %S" key))
       new)))
 
-(defun srecode-compile-template-table (templates mode priority application vars)
+(defun srecode-compile-template-table (templates mode priority application project vars)
   "Compile a list of TEMPLATES into an semantic recode table.
 The table being compiled is for MODE, or the string \"default\".
 PRIORITY is a numerical value that indicates this tables location
 in an ordered search.
 APPLICATION is the name of the application these templates belong to.
+PROJECT is a directory name which these templates scope to.
 A list of defined variables VARS provides a variable table."
   (let ((namehash (make-hash-table :test 'equal
 				   :size (length templates)))
@@ -549,6 +558,9 @@
 
 	(setq lp (cdr lp))))
 
+    (when (stringp project)
+      (setq project (expand-file-name project)))
+
     (let* ((table (srecode-mode-table-new mode (buffer-file-name)
 		   :templates (nreverse templates)
 		   :namehash namehash
@@ -556,7 +568,8 @@
 		   :variables vars
 		   :major-mode mode
 		   :priority priority
-		   :application application))
+		   :application application
+		   :project project))
 	   (tmpl (oref table templates)))
       ;; Loop over all the templates, and xref.
       (while tmpl
--- a/lisp/cedet/srecode/cpp.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/cpp.el	Wed Oct 13 22:40:51 2010 +0900
@@ -26,6 +26,27 @@
 
 ;;; Code:
 
+(require 'srecode)
+(require 'srecode/dictionary)
+(require 'srecode/semantic)
+(require 'semantic/tag)
+
+;;; Customization
+;;
+
+(defgroup srecode-cpp nil
+  "C++-specific Semantic Recoder settings."
+  :group 'srecode)
+
+(defcustom srecode-cpp-namespaces
+  '("std" "boost")
+  "List expansion candidates for the :using-namespaces argument.
+A dictionary entry of the named PREFIX_NAMESPACE with the value
+NAMESPACE:: is created for each namespace unless the current
+buffer contains a using NAMESPACE; statement "
+  :group 'srecode-cpp
+  :type  '(repeat string))
+
 ;;; :cpp ARGUMENT HANDLING
 ;;
 ;; When a :cpp argument is required, fill the dictionary with
@@ -33,10 +54,6 @@
 ;;
 ;; Error if not in a C++ mode.
 
-(require 'srecode)
-(require 'srecode/dictionary)
-(require 'srecode/semantic)
-
 ;;;###autoload
 (defun srecode-semantic-handle-:cpp (dict)
   "Add macros into the dictionary DICT based on the current c++ file.
@@ -59,6 +76,23 @@
     )
   )
 
+(defun srecode-semantic-handle-:using-namespaces (dict)
+  "Add macros into the dictionary DICT based on used namespaces.
+Adds the following:
+PREFIX_NAMESPACE - for each NAMESPACE in `srecode-cpp-namespaces'."
+  (let ((tags (semantic-find-tags-by-class
+	       'using (semantic-fetch-tags))))
+    (dolist (name srecode-cpp-namespaces)
+      (let ((variable (format "PREFIX_%s" (upcase name)))
+	    (prefix   (format "%s::"      name)))
+	(srecode-dictionary-set-value dict variable prefix)
+	(dolist (tag tags)
+	  (when (and (eq (semantic-tag-get-attribute tag :kind)
+			 'namespace)
+		     (string= (semantic-tag-name tag) name))
+	    (srecode-dictionary-set-value dict variable ""))))))
+  )
+
 (define-mode-local-override srecode-semantic-apply-tag-to-dict
   c++-mode (tag-wrapper dict)
   "Apply C++ specific features from TAG-WRAPPER into DICT.
@@ -97,6 +131,7 @@
 	 (srecode-semantic-tag (semantic-tag-name value-tag)
 			       :prime value-tag)
 	 value-dict))
+
       ;; Discriminate using statements referring to namespaces and
       ;; types.
       (when (eq (semantic-tag-get-attribute tag :kind) 'namespace)
@@ -111,7 +146,8 @@
       ;; when they make sense. My best bet would be
       ;; (semantic-tag-function-parent tag), but it is not there, when
       ;; the function is defined in the scope of a class.
-      (let ((member    't)
+      (let ((member t)
+	    (templates (semantic-tag-get-attribute tag :template))
 	    (modifiers (semantic-tag-modifiers tag)))
 
 	;; Add modifiers into the dictionary
@@ -120,6 +156,9 @@
 				dict "MODIFIERS")))
 	    (srecode-dictionary-set-value modifier-dict "NAME" modifier)))
 
+	;; Add templates into child dictionaries.
+	(srecode-cpp-apply-templates dict templates)
+
 	;; When the function is a member function, it can have
 	;; additional modifiers.
 	(when member
@@ -133,11 +172,40 @@
 	  ;; entry.
 	  (when (semantic-tag-get-attribute tag :pure-virtual-flag)
 	    (srecode-dictionary-show-section dict "PURE"))
-	  )
-	))
+	  )))
+
+     ;;
+     ;; CLASS
+     ;;
+     ((eq class 'type)
+      ;; For classes, add template parameters.
+      (when (or (semantic-tag-of-type-p tag "class")
+		(semantic-tag-of-type-p tag "struct"))
+
+	;; Add templates into child dictionaries.
+	(let ((templates (semantic-tag-get-attribute tag :template)))
+	  (srecode-cpp-apply-templates dict templates))))
      ))
   )
 
+
+;;; Helper functions
+;;
+
+(defun srecode-cpp-apply-templates (dict templates)
+  "Add section dictionaries for TEMPLATES to DICT."
+  (when templates
+    (let ((templates-dict (srecode-dictionary-add-section-dictionary
+			   dict "TEMPLATES")))
+      (dolist (template templates)
+	(let ((template-dict (srecode-dictionary-add-section-dictionary
+			      templates-dict "ARGS")))
+	  (srecode-semantic-apply-tag-to-dict
+	   (srecode-semantic-tag (semantic-tag-name template)
+				 :prime template)
+	   template-dict)))))
+  )
+
 (provide 'srecode/cpp)
 
 ;; Local variables:
--- a/lisp/cedet/srecode/dictionary.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/dictionary.el	Wed Oct 13 22:40:51 2010 +0900
@@ -37,6 +37,7 @@
 (declare-function srecode-compile-parse-inserter "srecode/compile")
 (declare-function srecode-dump-code-list "srecode/compile")
 (declare-function srecode-load-tables-for-mode "srecode/find")
+(declare-function srecode-template-table-in-project-p "srecode/find")
 (declare-function srecode-insert-code-stream "srecode/insert")
 (declare-function data-debug-new-buffer "data-debug")
 (declare-function data-debug-insert-object-slots "eieio-datadebug")
@@ -157,40 +158,49 @@
 If BUFFER-OR-PARENT is t, then this dictionary should not be
 associated with a buffer or parent."
   (save-excursion
+    ;; Handle the parent
     (let ((parent nil)
 	  (buffer nil)
 	  (origin nil)
 	  (initfrombuff nil))
-      (cond ((bufferp buffer-or-parent)
-	     (set-buffer buffer-or-parent)
-	     (setq buffer buffer-or-parent
-		   origin (buffer-name buffer-or-parent)
-		   initfrombuff t))
-	    ((srecode-dictionary-child-p buffer-or-parent)
-	     (setq parent buffer-or-parent
-		   buffer (oref buffer-or-parent buffer)
-		   origin (concat (object-name buffer-or-parent) " in "
-				  (if buffer (buffer-name buffer)
-				    "no buffer")))
-	     (when buffer
-	       (set-buffer buffer)))
-	    ((eq buffer-or-parent t)
-	     (setq buffer nil
-		   origin "Unspecified Origin"))
-	    (t
-	     (setq buffer (current-buffer)
-		   origin (concat "Unspecified.  Assume "
-				  (buffer-name buffer))
-		   initfrombuff t)
-	     )
-	    )
+      (cond
+       ;; Parent is a buffer
+       ((bufferp buffer-or-parent)
+	(set-buffer buffer-or-parent)
+	(setq buffer buffer-or-parent
+	      origin (buffer-name buffer-or-parent)
+	      initfrombuff t))
+
+       ;; Parent is another dictionary
+       ((srecode-dictionary-child-p buffer-or-parent)
+	(setq parent buffer-or-parent
+	      buffer (oref buffer-or-parent buffer)
+	      origin (concat (object-name buffer-or-parent) " in "
+			     (if buffer (buffer-name buffer)
+			       "no buffer")))
+	(when buffer
+	  (set-buffer buffer)))
+
+       ;; No parent
+       ((eq buffer-or-parent t)
+	(setq buffer nil
+	      origin "Unspecified Origin"))
+
+       ;; Default to unspecified parent
+       (t
+	(setq buffer (current-buffer)
+	      origin (concat "Unspecified.  Assume "
+			     (buffer-name buffer))
+	      initfrombuff t)))
+
+      ;; Create the new dictionary object.
       (let ((dict (srecode-dictionary
 		   major-mode
-		   :buffer buffer
-		   :parent parent
-		   :namehash  (make-hash-table :test 'equal
-					       :size 20)
-		   :origin origin)))
+		   :buffer   buffer
+		   :parent   parent
+		   :namehash (make-hash-table :test 'equal
+					      :size 20)
+		   :origin   origin)))
 	;; Only set up the default variables if we are being built
 	;; directroy for a particular buffer.
 	(when initfrombuff
@@ -211,34 +221,37 @@
 TPL is an object representing a compiled template file."
   (when tpl
     (let ((tabs (oref tpl :tables)))
+      (require 'srecode/find) ; For srecode-template-table-in-project-p
       (while tabs
-	(let ((vars (oref (car tabs) variables)))
-	  (while vars
-	    (srecode-dictionary-set-value
-	     dict (car (car vars)) (cdr (car vars)))
-	    (setq vars (cdr vars))))
-	(setq tabs (cdr tabs))))))
+	(when (srecode-template-table-in-project-p (car tabs))
+	  (let ((vars (oref (car tabs) variables)))
+	    (while vars
+	      (srecode-dictionary-set-value
+	       dict (car (car vars)) (cdr (car vars)))
+	      (setq vars (cdr vars)))))
+  	(setq tabs (cdr tabs))))))
 
 
 (defmethod srecode-dictionary-set-value ((dict srecode-dictionary)
 					 name value)
   "In dictionary DICT, set NAME to have VALUE."
   ;; Validate inputs
-  (if (not (stringp name))
-      (signal 'wrong-type-argument (list name 'stringp)))
+  (unless (stringp name)
+    (signal 'wrong-type-argument (list name 'stringp)))
+
   ;; Add the value.
   (with-slots (namehash) dict
     (puthash name value namehash))
   )
 
 (defmethod srecode-dictionary-add-section-dictionary ((dict srecode-dictionary)
-						      name &optional show-only)
+						      name &optional show-only force)
   "In dictionary DICT, add a section dictionary for section macro NAME.
 Return the new dictionary.
 
-You can add several dictionaries to the same section macro.
-For each dictionary added to a macro, the block of codes in the
-template will be repeated.
+You can add several dictionaries to the same section entry.
+For each dictionary added to a variable, the block of codes in
+the template will be repeated.
 
 If optional argument SHOW-ONLY is non-nil, then don't add a new dictionary
 if there is already one in place.  Also, don't add FIRST/LAST entries.
@@ -255,10 +268,11 @@
 Adding a new dictionary will alter these values in previously
 inserted dictionaries."
   ;; Validate inputs
-  (if (not (stringp name))
-      (signal 'wrong-type-argument (list name 'stringp)))
+  (unless (stringp name)
+    (signal 'wrong-type-argument (list name 'stringp)))
+
   (let ((new (srecode-create-dictionary dict))
-	(ov (srecode-dictionary-lookup-name dict name)))
+	(ov  (srecode-dictionary-lookup-name dict name t)))
 
     (when (not show-only)
       ;; Setup the FIRST/NOTFIRST and LAST/NOTLAST entries.
@@ -275,7 +289,9 @@
 	(srecode-dictionary-show-section new "LAST"))
       )
 
-    (when (or (not show-only) (null ov))
+    (when (or force
+	      (not show-only)
+	      (null ov))
       (srecode-dictionary-set-value dict name (append ov (list new))))
     ;; Return the new sub-dictionary.
     new))
@@ -283,8 +299,9 @@
 (defmethod srecode-dictionary-show-section ((dict srecode-dictionary) name)
   "In dictionary DICT, indicate that the section NAME should be exposed."
   ;; Validate inputs
-  (if (not (stringp name))
-      (signal 'wrong-type-argument (list name 'stringp)))
+  (unless (stringp name)
+    (signal 'wrong-type-argument (list name 'stringp)))
+
   ;; Showing a section is just like making a section dictionary, but
   ;; with no dictionary values to add.
   (srecode-dictionary-add-section-dictionary dict name t)
@@ -294,51 +311,120 @@
   "In dictionary DICT, indicate that the section NAME should be hidden."
   ;; We need to find the has value, and then delete it.
   ;; Validate inputs
-  (if (not (stringp name))
-      (signal 'wrong-type-argument (list name 'stringp)))
+  (unless (stringp name)
+    (signal 'wrong-type-argument (list name 'stringp)))
+
   ;; Add the value.
   (with-slots (namehash) dict
     (remhash name namehash))
   nil)
 
-(defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict)
-  "Merge into DICT the dictionary entries from OTHERDICT."
+(defmethod srecode-dictionary-add-entries ((dict srecode-dictionary)
+					   entries &optional state)
+  "Add ENTRIES to DICT.
+
+ENTRIES is a list of even length of dictionary entries to
+add. ENTRIES looks like this:
+
+  (NAME_1 VALUE_1 NAME_2 VALUE_2 ...)
+
+The following rules apply:
+ * NAME_N is a string
+and for values
+ * If VALUE_N is t, the section NAME_N is shown.
+ * If VALUE_N is a string, an ordinary value is inserted.
+ * If VALUE_N is a dictionary, it is inserted as entry NAME_N.
+ * Otherwise, a compound variable is created for VALUE_N.
+
+The optional argument STATE has to non-nil when compound values
+are inserted. An error is signaled if ENTRIES contains compound
+values but STATE is nil."
+  (while entries
+    (let ((name  (nth 0 entries))
+	  (value (nth 1 entries)))
+      (cond
+       ;; Value is t; show a section.
+       ((eq value t)
+	(srecode-dictionary-show-section dict name))
+
+       ;; Value is a simple string; create an ordinary dictionary
+       ;; entry
+       ((stringp value)
+	(srecode-dictionary-set-value dict name value))
+
+       ;; Value is a dictionary; insert as child dictionary.
+       ((srecode-dictionary-child-p value)
+	(srecode-dictionary-merge
+	 (srecode-dictionary-add-section-dictionary dict name)
+	 value t))
+
+       ;; Value is some other object; create a compound value.
+       (t
+	(unless state
+	  (error "Cannot insert compound values without state."))
+
+	(srecode-dictionary-set-value
+	 dict name
+	 (srecode-dictionary-compound-variable
+	  name :value value :state state)))))
+    (setq entries (nthcdr 2 entries)))
+  dict)
+
+(defmethod srecode-dictionary-merge ((dict srecode-dictionary) otherdict
+				     &optional force)
+  "Merge into DICT the dictionary entries from OTHERDICT.
+Unless the optional argument FORCE is non-nil, values in DICT are
+not modified, even if there are values of the same names in
+OTHERDICT."
   (when otherdict
     (maphash
      (lambda (key entry)
-       ;; Only merge in the new values if there was no old value.
+       ;; The new values is only merged in if there was no old value
+       ;; or FORCE is non-nil.
+       ;;
        ;; This protects applications from being whacked, and basically
        ;; makes these new section dictionary entries act like
        ;; "defaults" instead of overrides.
-       (when (not (srecode-dictionary-lookup-name dict key))
-	 (cond ((and (listp entry) (srecode-dictionary-p (car entry)))
-		;; A list of section dictionaries.
-		;; We need to merge them in.
-		(while entry
-		  (let ((new-sub-dict
-			 (srecode-dictionary-add-section-dictionary
-			  dict key)))
-		    (srecode-dictionary-merge new-sub-dict (car entry)))
-		  (setq entry (cdr entry)))
-		  )
+       (when (or force
+		 (not (srecode-dictionary-lookup-name dict key t)))
+	 (cond
+	  ;; A list of section dictionaries. We need to merge them in.
+	  ((and (listp entry)
+		(srecode-dictionary-p (car entry)))
+	   (dolist (sub-dict entry)
+	     (srecode-dictionary-merge
+	      (srecode-dictionary-add-section-dictionary
+	       dict key t t)
+	      sub-dict force)))
 
-	       (t
-		(srecode-dictionary-set-value dict key entry)))
-	       ))
+	  ;; Other values can be set directly.
+	  (t
+	   (srecode-dictionary-set-value dict key entry)))))
      (oref otherdict namehash))))
 
 (defmethod srecode-dictionary-lookup-name ((dict srecode-dictionary)
-					   name)
-  "Return information about the current DICT's value for NAME."
+					   name &optional non-recursive)
+  "Return information about DICT's value for NAME.
+DICT is a dictionary, and NAME is a string that is treated as the
+name of an entry in the dictionary. If such an entry exists, its
+value is returned. Otherwise, nil is returned. Normally, the
+lookup is recursive in the sense that the parent of DICT is
+searched for NAME if it is not found in DICT.  This recursive
+lookup can be disabled by the optional argument NON-RECURSIVE.
+
+This function derives values for some special NAMEs, such as
+'FIRST' and 'LAST'."
   (if (not (slot-boundp dict 'namehash))
       nil
-    ;; Get the value of this name from the dictionary
-    (or (with-slots (namehash) dict
-	  (gethash name namehash))
-	(and (not (member name '("FIRST" "LAST" "NOTFIRST" "NOTLAST")))
-	     (oref dict parent)
-	     (srecode-dictionary-lookup-name (oref dict parent) name))
-	)))
+    ;; Get the value of this name from the dictionary or its parent
+    ;; unless the lookup should be non-recursive.
+    (with-slots (namehash parent) dict
+      (or (gethash name namehash)
+	  (and (not non-recursive)
+	       (not (member name '("FIRST" "LAST" "NOTFIRST" "NOTLAST")))
+	       parent
+	       (srecode-dictionary-lookup-name parent name)))))
+  )
 
 (defmethod srecode-root-dictionary ((dict srecode-dictionary))
   "For dictionary DICT, return the root dictionary.
@@ -431,10 +517,22 @@
 	   (start (point))
 	   (name (oref sti :object-name)))
 
-      (if (or (not dv) (string= dv ""))
-	  (insert name)
-	(insert dv))
+      (cond
+       ;; No default value.
+       ((not dv) (insert name))
+       ;; A compound value as the default?  Recurse.
+       ((srecode-dictionary-compound-value-child-p dv)
+	(srecode-compound-toString dv function dictionary))
+       ;; A string that is empty?  Use the name.
+       ((and (stringp dv) (string= dv ""))
+	(insert name))
+       ;; Insert strings
+       ((stringp dv) (insert dv))
+       ;; Some other issue
+       (t
+	(error "Unknown default value for value %S" name)))
 
+      ;; Create a field from the inserter.
       (srecode-field name :name name
 		     :start start
 		     :end (point)
@@ -482,6 +580,53 @@
 	(setq sectiondicts (cdr sectiondicts)))
       new)))
 
+(defun srecode-create-dictionaries-from-tags (tags state)
+  "Create a dictionary with entries according to TAGS.
+
+TAGS should be in the format produced by the template file
+grammar. That is
+
+TAGS = (ENTRY_1 ENTRY_2 ...)
+
+where
+
+ENTRY_N = (NAME ENTRY_N_1 ENTRY_N_2 ...) | TAG
+
+where TAG is a semantic tag of class 'variable. The (NAME ... )
+form creates a child dictionary which is stored under the name
+NAME. The TAG form creates a value entry or section dictionary
+entry whose name is the name of the tag.
+
+STATE is the current compiler state."
+  (let ((dict    (srecode-create-dictionary t))
+	(entries (apply #'append
+			(mapcar
+			 (lambda (entry)
+			   (cond
+			    ;; Entry is a tag
+			    ((semantic-tag-p entry)
+			     (let ((name  (semantic-tag-name entry))
+				   (value (semantic-tag-variable-default entry)))
+			       (list name
+				     (if (and (listp value)
+					      (= (length value) 1)
+					      (stringp (car value)))
+					 (car value)
+				       value))))
+
+			    ;; Entry is a nested dictionary
+			    (t
+			     (let ((name    (car entry))
+				   (entries (cdr entry)))
+			       (list name
+				     (srecode-create-dictionaries-from-tags
+				      entries state))))))
+			 tags))))
+    (srecode-dictionary-add-entries
+     dict entries state)
+    dict)
+  )
+
 ;;; DUMP DICTIONARY
 ;;
 ;; Make a dictionary, and dump it's contents.
--- a/lisp/cedet/srecode/fields.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/fields.el	Wed Oct 13 22:40:51 2010 +0900
@@ -35,6 +35,8 @@
 ;; Each field has 2 overlays.  The second overlay allows control in
 ;; the character just after the field, but does not highlight it.
 
+;; @TODO - Cancel an old field array if a new one is about to be created!
+
 ;; Keep this library independent of SRecode proper.
 (require 'eieio)
 
@@ -43,6 +45,10 @@
   "While inserting a set of fields, collect in this variable.
 Once an insertion set is done, these fields will be activated.")
 
+
+;;; Customization
+;;
+
 (defface srecode-field-face
   '((((class color) (background dark))
      (:underline "green"))
@@ -51,6 +57,11 @@
   "*Face used to specify editable fields from a template."
   :group 'semantic-faces)
 
+(defcustom srecode-fields-exit-confirmation nil
+  "Ask for confirmation before leaving field editing mode."
+  :group 'srecode
+  :type  'boolean)
+
 ;;; BASECLASS
 ;;
 ;; Fields and the template region share some basic overlay features.
@@ -237,7 +248,7 @@
 	(remove-hook 'post-command-hook 'srecode-field-post-command t)
       (if (srecode-point-in-region-p ar)
 	  nil ;; Keep going
-	;; We moved out of the temlate.  Cancel the edits.
+	;; We moved out of the template.  Cancel the edits.
 	(srecode-delete ar)))
     ))
 
@@ -429,7 +440,8 @@
 (defun srecode-field-exit-ask ()
   "Ask if the user wants to exit field-editing mini-mode."
   (interactive)
-  (when (y-or-n-p "Exit field-editing mode? ")
+  (when (or (not srecode-fields-exit-confirmation)
+	    (y-or-n-p "Exit field-editing mode? "))
     (srecode-delete (srecode-active-template-region))))
 
 
--- a/lisp/cedet/srecode/find.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/find.el	Wed Oct 13 22:40:51 2010 +0900
@@ -92,6 +92,23 @@
 	))
     ))
 
+;;; PROJECT
+;;
+;; Find if a template table has a project set, and if so, is the
+;; current buffer in that project.
+(defmethod srecode-template-table-in-project-p ((tab srecode-template-table))
+  "Return non-nil if the table TAB can be used in the current project.
+If TAB has a :project set, check that the directories match.
+If TAB is nil, then always return t."
+  (let ((proj (oref tab :project)))
+    ;; Return t if the project wasn't set.
+    (if (not proj) t
+      ;; If the project directory was set, lets check it.
+      (let ((dd (expand-file-name default-directory))
+	    (projexp (regexp-quote (directory-file-name proj))))
+	(if (string-match (concat "^" projexp) dd)
+	    t nil)))))
+
 ;;; SEARCH
 ;;
 ;; Find a given template based on name, and features of the current
@@ -103,13 +120,14 @@
 Optional argument CONTEXT specifies that the template should part
 of a particular context.
 The APPLICATION argument is unused."
-  (if context
-      ;; If a context is specified, then look it up there.
-      (let ((ctxth (gethash context (oref tab contexthash))))
-	(when ctxth
-	  (gethash template-name ctxth)))
-    ;; No context, perhaps a merged name?
-    (gethash template-name (oref tab namehash))))
+  (when (srecode-template-table-in-project-p tab)
+    (if context
+	;; If a context is specified, then look it up there.
+	(let ((ctxth (gethash context (oref tab contexthash))))
+	  (when ctxth
+	    (gethash template-name ctxth)))
+      ;; No context, perhaps a merged name?
+      (gethash template-name (oref tab namehash)))))
 
 (defmethod srecode-template-get-table ((tab srecode-mode-table)
 				       template-name &optional
@@ -144,32 +162,33 @@
   "Find in the template name in table TAB, the template with BINDING.
 Optional argument CONTEXT specifies that the template should part
 of a particular context."
-  (let* ((keyout nil)
-	 (hashfcn (lambda (key value)
-		    (when (and (slot-boundp value 'binding)
-			       (oref value binding)
-			       (= (aref (oref value binding) 0) binding))
-		      (setq keyout key))))
-	 (contextstr (cond ((listp context)
-			    (car-safe context))
-			   ((stringp context)
-			    context)
-			   (t nil)))
-	 )
-    (if context
-	(let ((ctxth (gethash contextstr (oref tab contexthash))))
-	  (when ctxth
-	    ;; If a context is specified, then look it up there.
-	    (maphash hashfcn ctxth)
-	    ;; Context hashes EXCLUDE the context prefix which
-	    ;; we need to include, so concat it here
-	    (when keyout
-	      (setq keyout (concat contextstr ":" keyout)))
-	    )))
-    (when (not keyout)
-      ;; No context, or binding in context.  Try full hash.
-      (maphash hashfcn (oref tab namehash)))
-    keyout))
+  (when (srecode-template-table-in-project-p tab)
+    (let* ((keyout nil)
+	   (hashfcn (lambda (key value)
+		      (when (and (slot-boundp value 'binding)
+				 (oref value binding)
+				 (= (aref (oref value binding) 0) binding))
+			(setq keyout key))))
+	   (contextstr (cond ((listp context)
+			      (car-safe context))
+			     ((stringp context)
+			      context)
+			     (t nil)))
+	   )
+      (if context
+	  (let ((ctxth (gethash contextstr (oref tab contexthash))))
+	    (when ctxth
+	      ;; If a context is specified, then look it up there.
+	      (maphash hashfcn ctxth)
+	      ;; Context hashes EXCLUDE the context prefix which
+	      ;; we need to include, so concat it here
+	      (when keyout
+		(setq keyout (concat contextstr ":" keyout)))
+	      )))
+      (when (not keyout)
+	;; No context, or binding in context.  Try full hash.
+	(maphash hashfcn (oref tab namehash)))
+      keyout)))
 
 (defmethod srecode-template-get-table-for-binding
   ((tab srecode-mode-table) binding &optional context application)
@@ -220,7 +239,8 @@
 	   )
       (while tabs
 	;; Exclude templates for a perticular application.
-	(when (not (oref (car tabs) :application))
+	(when (and (not (oref (car tabs) :application))
+		   (srecode-template-table-in-project-p (car tabs)))
 	  (maphash (lambda (key temp)
 		     (puthash key temp mhash)
 		     )
--- a/lisp/cedet/srecode/getset.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/getset.el	Wed Oct 13 22:40:51 2010 +0900
@@ -55,8 +55,9 @@
       (error "No templates for inserting get/set"))
 
   ;; Step 1: Try to derive the tag for the class we will use
+  (semantic-fetch-tags)
   (let* ((class (or class-in (srecode-auto-choose-class (point))))
-	 (tagstart (semantic-tag-start class))
+	 (tagstart (when class (semantic-tag-start class)))
 	 (inclass (eq (semantic-current-tag-of-class 'type) class))
 	 (field nil)
 	 )
--- a/lisp/cedet/srecode/insert.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/insert.el	Wed Oct 13 22:40:51 2010 +0900
@@ -26,6 +26,9 @@
 ;; Manage the insertion process for a template.
 ;;
 
+(eval-when-compile
+  (require 'cl)) ;; for `lexical-let'
+
 (require 'srecode/compile)
 (require 'srecode/find)
 (require 'srecode/dictionary)
@@ -49,7 +52,7 @@
 NOTE: The field feature does not yet work with XEmacs."
   :group 'srecode
   :type '(choice (const :tag "Ask" ask)
-		 (cons :tag "Field" field)))
+		 (const :tag "Field" field)))
 
 (defvar srecode-insert-with-fields-in-progress nil
   "Non-nil means that we are actively inserting a template with fields.")
@@ -86,7 +89,6 @@
 				    (car dict-entries)
 				    (car (cdr dict-entries)))
       (setq dict-entries (cdr (cdr dict-entries))))
-    ;;(srecode-resolve-arguments temp newdict)
     (srecode-insert-fcn temp newdict)
     ;; Don't put code here.  We need to return the end-mark
     ;; for this insertion step.
@@ -100,6 +102,10 @@
   ;; Perform the insertion.
   (let ((standard-output (or stream (current-buffer)))
 	(end-mark nil))
+    ;; Merge any template entries into the input dictionary.
+    (when (slot-boundp template 'dictionary)
+      (srecode-dictionary-merge dictionary (oref template dictionary)))
+
     (unless skipresolver
       ;; Make sure the semantic tags are up to date.
       (semantic-fetch-tags)
@@ -110,7 +116,7 @@
 	;; If there is a buffer, turn off various hooks.  This will cause
 	;; the mod hooks to be buffered up during the insert, but
 	;; prevent tools like font-lock from fontifying mid-template.
-	;; Especialy important during insertion of complex comments that
+	;; Especially important during insertion of complex comments that
 	;; cause the new font-lock to comment-color stuff after the inserted
 	;; comment.
 	;;
@@ -239,6 +245,9 @@
 (defmethod srecode-insert-method ((st srecode-template) dictionary)
   "Insert the srecoder template ST."
   ;; Merge any template entries into the input dictionary.
+  ;; This may happen twice since some templates arguments need
+  ;; these dictionary values earlier, but these values always
+  ;; need merging for template inserting in other templates.
   (when (slot-boundp st 'dictionary)
     (srecode-dictionary-merge dictionary (oref st dictionary)))
   ;; Do an insertion.
@@ -264,7 +273,7 @@
 ;; Specific srecode inserters.
 ;; The base class is from srecode-compile.
 ;;
-;; Each inserter handles various macro codes from the temlate.
+;; Each inserter handles various macro codes from the template.
 ;; The `code' slot specifies a character used to identify which
 ;; inserter is to be created.
 ;;
@@ -471,7 +480,7 @@
 	;;    (setq val (format "%S" val))))
 	))
     ;; Output the dumb thing unless the type of thing specifically
-    ;; did the inserting forus.
+    ;; did the inserting for us.
     (when do-princ
       (princ val))))
 
@@ -498,7 +507,8 @@
 The prompt text used is derived from the previous PROMPT command in the
 template file.")
 
-(defmethod srecode-inserter-apply-state ((ins srecode-template-inserter-ask) STATE)
+(defmethod srecode-inserter-apply-state
+  ((ins srecode-template-inserter-ask) STATE)
   "For the template inserter INS, apply information from STATE.
 Loop over the prompts to see if we have a match."
   (let ((prompts (oref STATE prompts))
@@ -669,7 +679,13 @@
   )
 
 (defvar srecode-template-inserter-point-override nil
-  "When non-nil, the point inserter will do this function instead.")
+  "Point-positioning method for the SRecode template inserter.
+When nil, perform normal point-positioning behavior.
+When the value is a cons cell (DEPTH . FUNCTION), call FUNCTION
+instead, unless the template nesting depth, measured
+by (length (oref srecode-template active)), is greater than
+DEPTH.")
+
 
 (defclass srecode-template-inserter-point (srecode-template-inserter)
   ((key :initform ?^
@@ -702,15 +718,20 @@
 				  dictionary)
   "Insert the STI inserter.
 Save point in the class allocated 'point' slot.
-If `srecode-template-inserter-point-override' then this generalized
-marker will do something else.  See `srecode-template-inserter-include-wrap'
-as an example."
-  (if srecode-template-inserter-point-override
+If `srecode-template-inserter-point-override' non-nil then this
+generalized marker will do something else.  See
+`srecode-template-inserter-include-wrap' as an example."
+  ;; If `srecode-template-inserter-point-override' is non-nil, its car
+  ;; is the maximum template nesting depth for which the override is
+  ;; valid. Compare this to the actual template nesting depth and
+  ;; maybe use the override function which is stored in the cdr.
+  (if (and srecode-template-inserter-point-override
+	   (<= (length (oref srecode-template active))
+	       (car srecode-template-inserter-point-override)))
       ;; Disable the old override while we do this.
-      (let ((over srecode-template-inserter-point-override)
+      (let ((over (cdr srecode-template-inserter-point-override))
 	    (srecode-template-inserter-point-override nil))
-	(funcall over dictionary)
-	)
+	(funcall over dictionary))
     (oset sti point (point-marker))
     ))
 
@@ -751,9 +772,15 @@
 The template to insert is stored in SLOT."
   (let ((dicts (srecode-dictionary-lookup-name
 		dictionary (oref sti :object-name))))
+    (when (not (listp dicts))
+      (error "Cannot insert section %S from non-section variable."
+	     (oref sti :object-name)))
     ;; If there is no section dictionary, then don't output anything
     ;; from this section.
     (while dicts
+      (when (not (srecode-dictionary-p (car dicts)))
+	(error "Cannot insert section %S from non-section variable."
+	       (oref sti :object-name)))
       (srecode-insert-subtemplate sti (car dicts) slot)
       (setq dicts (cdr dicts)))))
 
@@ -853,39 +880,44 @@
     ;; If there was no template name, throw an error
     (if (not templatenamepart)
 	(error "Include macro %s needs a template name" (oref sti :object-name)))
-    ;; Find the template by name, and save it.
-    (if (or (not (slot-boundp sti 'includedtemplate))
-	    (not (oref sti includedtemplate)))
-	(let ((tmpl (srecode-template-get-table (srecode-table)
-						templatenamepart))
-	      (active (oref srecode-template active))
-	      ctxt)
+
+    ;; NOTE: We used to cache the template and not look it up a second time,
+    ;; but changes in the template tables can change which template is
+    ;; eventually discovered, so now we always lookup that template.
+
+    ;; Calculate and store the discovered template
+    (let ((tmpl (srecode-template-get-table (srecode-table)
+					    templatenamepart))
+	  (active (oref srecode-template active))
+	  ctxt)
+      (when (not tmpl)
+	;; If it isn't just available, scan back through
+	;; the active template stack, searching for a matching
+	;; context.
+	(while (and (not tmpl) active)
+	  (setq ctxt (oref (car active) context))
+	  (setq tmpl (srecode-template-get-table (srecode-table)
+						 templatenamepart
+						 ctxt))
 	  (when (not tmpl)
-	    ;; If it isn't just available, scan back through
-	    ;; the active template stack, searching for a matching
-	    ;; context.
-	    (while (and (not tmpl) active)
-	      (setq ctxt (oref (car active) context))
-	      (setq tmpl (srecode-template-get-table (srecode-table)
-						     templatenamepart
-						     ctxt))
-	      (when (not tmpl)
-		(when (slot-boundp (car active) 'table)
-		  (let ((app (oref (oref (car active) table) application)))
-		    (when app
-		      (setq tmpl (srecode-template-get-table
-				  (srecode-table)
-				  templatenamepart
-				  ctxt app)))
-		    )))
-	      (setq active (cdr active)))
-	    (when (not tmpl)
-	      ;; If it wasn't in this context, look to see if it
-	      ;; defines its own context
-	      (setq tmpl (srecode-template-get-table (srecode-table)
-						     templatenamepart)))
-	    )
-	  (oset sti :includedtemplate tmpl)))
+	    (when (slot-boundp (car active) 'table)
+	      (let ((app (oref (oref (car active) table) application)))
+		(when app
+		  (setq tmpl (srecode-template-get-table
+			      (srecode-table)
+			      templatenamepart
+			      ctxt app)))
+		)))
+	  (setq active (cdr active)))
+	(when (not tmpl)
+	  ;; If it wasn't in this context, look to see if it
+	  ;; defines it's own context
+	  (setq tmpl (srecode-template-get-table (srecode-table)
+						 templatenamepart)))
+	)
+
+      ;; Store the found template into this object for later use.
+      (oset sti :includedtemplate tmpl))
 
     (if (not (oref sti includedtemplate))
 	;; @todo - Call into a debugger to help find the template in question.
@@ -955,23 +987,31 @@
 template where a ^ inserter occurs."
   ;; Step 1: Look up the included inserter
   (srecode-insert-include-lookup sti dictionary)
-  ;; Step 2: Temporarilly override the point inserter.
-  (let* ((vaguely-unique-name sti)
-	 (srecode-template-inserter-point-override
-	  (lambda (dict2)
-	    (if (srecode-dictionary-lookup-name
-		 dict2 (oref vaguely-unique-name :object-name))
-		;; Insert our sectional part with looping.
-		(srecode-insert-method-helper
-		 vaguely-unique-name dict2 'template)
-	      ;; Insert our sectional part just once.
-	      (srecode-insert-subtemplate vaguely-unique-name
-					  dict2 'template))
-	   )))
+  ;; Step 2: Temporarily override the point inserter.
+  ;; We bind `srecode-template-inserter-point-override' to a cons cell
+  ;; (DEPTH . FUNCTION) that has the maximum template nesting depth,
+  ;; for which the override is valid, in DEPTH and a lambda function
+  ;; which implements the wrap insertion behavior in FUNCTION. The
+  ;; maximum valid nesting depth is just the current depth + 1.
+  (let ((srecode-template-inserter-point-override
+	 (lexical-let ((inserter1 sti))
+	   (cons
+	    ;; DEPTH
+	    (+ (length (oref srecode-template active)) 1)
+	    ;; FUNCTION
+	    (lambda (dict)
+	      (let ((srecode-template-inserter-point-override nil))
+		(if (srecode-dictionary-lookup-name
+		     dict (oref inserter1 :object-name))
+		    ;; Insert our sectional part with looping.
+		    (srecode-insert-method-helper
+		     inserter1 dict 'template)
+		  ;; Insert our sectional part just once.
+		  (srecode-insert-subtemplate
+		   inserter1 dict 'template))))))))
     ;; Do a regular insertion for an include, but with our override in
     ;; place.
-    (call-next-method)
-    ))
+    (call-next-method)))
 
 (provide 'srecode/insert)
 
--- a/lisp/cedet/srecode/map.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/map.el	Wed Oct 13 22:40:51 2010 +0900
@@ -295,8 +295,14 @@
 
     ;; 2) Do we not have a current map?  If so load.
     (when (not srecode-current-map)
-      (setq srecode-current-map
-	    (eieio-persistent-read srecode-map-save-file))
+      (condition-case nil
+	  (setq srecode-current-map
+		(eieio-persistent-read srecode-map-save-file))
+	(error
+	 ;; There was an error loading the old map.  Create a new one.
+	 (setq srecode-current-map
+	       (srecode-map "SRecode Map"
+			    :file srecode-map-save-file))))
       )
 
     )
--- a/lisp/cedet/srecode/mode.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/mode.el	Wed Oct 13 22:40:51 2010 +0900
@@ -125,7 +125,13 @@
      ["Dump Dictionary"
       srecode-dictionary-dump
       :active t
-      :help "Calculate a dump a dictionary for point."
+      :help "Calculate and dump a dictionary for point."
+      ])
+    (semantic-menu-item
+     ["Show Macro Help"
+      srecode-macro-help
+      :active t
+      :help "Display the different types of macros available."
       ])
     )
    )
@@ -223,43 +229,44 @@
       (setq context (car-safe (srecode-calculate-context)))
 
       (while subtab
-	(setq ltab (oref (car subtab) templates))
-	(while ltab
-	  (setq temp (car ltab))
-
-	  ;; Do something with this template.
+	(when (srecode-template-table-in-project-p (car subtab))
+	  (setq ltab (oref (car subtab) templates))
+	  (while ltab
+	    (setq temp (car ltab))
 
-	  (let* ((ctxt (oref temp context))
-		 (ctxtcons (assoc ctxt alltabs))
-		 (bind (if (slot-boundp temp 'binding)
-			   (oref temp binding)))
-		 (name (object-name-string temp)))
+	    ;; Do something with this template.
+
+	    (let* ((ctxt (oref temp context))
+		   (ctxtcons (assoc ctxt alltabs))
+		   (bind (if (slot-boundp temp 'binding)
+			     (oref temp binding)))
+		   (name (object-name-string temp)))
 
-	    (when (not ctxtcons)
-	      (if (string= context ctxt)
-		  ;; If this context is not in the current list of contexts
-		  ;; is equal to the current context, then manage the
-		  ;; active list instead
-		  (setq active
-			(setq ctxtcons (or active (cons ctxt nil))))
-		;; This is not an active context, add it to alltabs.
-		(setq ctxtcons (cons ctxt nil))
-		(setq alltabs (cons ctxtcons alltabs))))
+	      (when (not ctxtcons)
+		(if (string= context ctxt)
+		    ;; If this context is not in the current list of contexts
+		    ;; is equal to the current context, then manage the
+		    ;; active list instead
+		    (setq active
+			  (setq ctxtcons (or active (cons ctxt nil))))
+		  ;; This is not an active context, add it to alltabs.
+		  (setq ctxtcons (cons ctxt nil))
+		  (setq alltabs (cons ctxtcons alltabs))))
 
-	    (let ((new (vector
-			(if bind
-			    (concat name "   (" bind ")")
-			  name)
-			`(lambda () (interactive)
-			   (srecode-insert (concat ,ctxt ":" ,name)))
-			t)))
+	      (let ((new (vector
+			  (if bind
+			      (concat name "   (" bind ")")
+			    name)
+			  `(lambda () (interactive)
+			     (srecode-insert (concat ,ctxt ":" ,name)))
+			  t)))
 
-	      (setcdr ctxtcons (cons
-				new
-				(cdr ctxtcons)))))
+		(setcdr ctxtcons (cons
+				  new
+				  (cdr ctxtcons)))))
 
-	  (setq ltab (cdr ltab)))
-	(setq subtab (cdr subtab)))
+	    (setq ltab (cdr ltab))))
+  	(setq subtab (cdr subtab)))
 
       ;; Now create the menu
       (easy-menu-filter-return
@@ -300,6 +307,7 @@
 This command will insert whichever srecode template has a binding
 to the current key."
   (interactive)
+  (srecode-load-tables-for-mode major-mode)
   (let* ((k last-command-event)
 	 (ctxt (srecode-calculate-context))
 	 ;; Find the template with the binding K
--- a/lisp/cedet/srecode/semantic.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/semantic.el	Wed Oct 13 22:40:51 2010 +0900
@@ -91,7 +91,7 @@
 to be augmented.")
 
 (define-overload srecode-semantic-apply-tag-to-dict (tagobj dict)
-  "Insert fewatures of TAGOBJ into the dictionary DICT.
+  "Insert features of TAGOBJ into the dictionary DICT.
 TAGOBJ is an object of class `srecode-semantic-tag'.  This class
 is a compound inserter value.
 DICT is a dictionary object.
@@ -195,7 +195,7 @@
 ;;; :tag ARGUMENT HANDLING
 ;;
 ;; When a :tag argument is required, identify the current :tag,
-;; and apply it's parts into the dictionary.
+;; and apply its parts into the dictionary.
 (defun srecode-semantic-handle-:tag (dict)
   "Add macros into the dictionary DICT based on the current :tag."
   ;; We have a tag, start adding "stuff" into the dictionary.
@@ -305,8 +305,8 @@
 
 For various conditions, this function looks for a template with
 the name CLASS-tag, where CLASS is the tag class.  If it cannot
-find that, it will look for that template in the
-`declaration'context (if the current context was not `declaration').
+find that, it will look for that template in the `declaration'
+context (if the current context was not `declaration').
 
 If PROTOTYPE is specified, it will first look for templates with
 the name CLASS-tag-prototype, or CLASS-prototype as above.
@@ -382,7 +382,7 @@
       (error "Cannot find template %s in %s for inserting tag %S"
 	     errtype top (semantic-format-tag-summarize tag)))
 
-    ;; Resolve Arguments
+    ;; Resolve arguments
     (let ((srecode-semantic-selected-tag tag))
       (srecode-resolve-arguments temp dict))
 
--- a/lisp/cedet/srecode/table.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/table.el	Wed Oct 13 22:40:51 2010 +0900
@@ -31,6 +31,7 @@
 (require 'srecode)
 
 (declare-function srecode-load-tables-for-mode "srecode/find")
+(declare-function srecode-template-table-in-project-p "srecode/find")
 
 ;;; Code:
 
@@ -74,6 +75,12 @@
 When there are multiple template files with similar names, templates with
 the highest priority are scanned last, allowing them to override values in
 previous template files.")
+   (project :initarg :project
+	    :type (or null string)
+	    :documentation
+	    "Scope some project files to a specific project.
+The value is a directory which forms the root of a particular project,
+or a subset of a particular project.")
    ;;
    ;; Parsed Data from the template file
    ;;
@@ -224,6 +231,12 @@
   (when (oref tab :application)
     (princ "\nApplication: ")
     (princ (oref tab :application)))
+  (when (oref tab :project)
+    (require 'srecode/find) ; For srecode-template-table-in-project-p
+    (princ "\nProject Directory: ")
+    (princ (oref tab :project))
+    (when (not (srecode-template-table-in-project-p tab))
+      (princ "\n   ** Not Usable in this file. **")))
   (princ "\n\nVariables:\n")
   (let ((vars (oref tab variables)))
     (while vars
--- a/lisp/cedet/srecode/texi.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cedet/srecode/texi.el	Wed Oct 13 22:40:51 2010 +0900
@@ -175,10 +175,17 @@
 
 (define-mode-local-override semantic-insert-foreign-tag
   texinfo-mode (foreign-tag)
-  "Insert TAG from a foreign buffer in TAGFILE.
+  "Insert FOREIGN-TAG from a foreign buffer in TAGFILE.
 Assume TAGFILE is a source buffer, and create a documentation
 thingy from it using the `document' tool."
-  (let ((srecode-semantic-selected-tag foreign-tag))
+  (srecode-texi-insert-tag-as-doc foreign-tag))
+
+(defun srecode-texi-insert-tag-as-doc (tag)
+  "Insert TAG into the current buffer with SRecode."
+  (when (not (eq major-mode 'texinfo-mode))
+    (error "Can only insert tags into texinfo in texinfo mode"))
+  (let ((srecode-semantic-selected-tag tag))
+    (srecode-load-tables-for-mode major-mode)
     ;; @todo - choose of the many types of tags to insert,
     ;; or put all that logic into srecode.
     (srecode-insert "declaration:function")))
--- a/lisp/composite.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/composite.el	Wed Oct 13 22:40:51 2010 +0900
@@ -210,7 +210,7 @@
 
 If it is a string, the elements are alternate characters.  In
 this case, TAB element has a special meaning.  If the first
-characer is TAB, the glyphs are displayed with left padding space
+character is TAB, the glyphs are displayed with left padding space
 so that no pixel overlaps with the previous column.  If the last
 character is TAB, the glyphs are displayed with right padding
 space so that no pixel overlaps with the following column.
--- a/lisp/cus-start.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/cus-start.el	Wed Oct 13 22:40:51 2010 +0900
@@ -266,6 +266,14 @@
 		      (const control) (const meta)
 		      (const alt) (const hyper)
 		      (const super)) "23.1")
+	     (ns-right-alternate-modifier
+	      ns
+	      (choice (const :tag "No modifier (work as alternate/option)" none)
+		      (const :tag "Use the value of ns-alternate-modifier"
+			     left)
+		      (const control) (const meta)
+		      (const alt) (const hyper)
+		      (const super)) "23.3")
 	     (ns-function-modifier
 	      ns
 	      (choice (const :tag "No modifier (work as function)" none)
--- a/lisp/desktop.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/desktop.el	Wed Oct 13 22:40:51 2010 +0900
@@ -226,7 +226,7 @@
 The base name of the file is specified in `desktop-base-file-name'."
   :type '(repeat directory)
   :group 'desktop
-  :version "22.1")
+  :version "23.2")                      ; user-emacs-directory added
 
 (defcustom desktop-missing-file-warning nil
   "If non-nil, offer to recreate the buffer of a deleted file.
--- a/lisp/dired.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/dired.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1177,7 +1177,7 @@
 The positions have the form (BUFFER-POSITION WINDOW-POSITIONS).
 
 BUFFER-POSITION is the point position in the current dired buffer.
-The buffer position have the form (BUFFER DIRED-FILENAME BUFFER-POINT).
+It has the form (BUFFER DIRED-FILENAME BUFFER-POINT).
 
 WINDOW-POSITIONS are current positions in all windows displaying
 this dired buffer.  The window positions have the form (WINDOW
--- a/lisp/disp-table.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/disp-table.el	Wed Oct 13 22:40:51 2010 +0900
@@ -109,11 +109,27 @@
 
 ;;;###autoload
 (defun standard-display-8bit (l h)
-  "Display characters in the range L to H literally."
+  "Display characters representing raw bytes in the range L to H literally.
+
+On a terminal display, each character in the range is displayed
+by sending the corresponding byte directly to the terminal.
+
+On a graphic display, each character in the range is displayed
+using the default font by a glyph whose code is the corresponding
+byte.
+
+Note that ASCII printable characters (SPC to TILDA) are displayed
+in the default way after this call."
   (or standard-display-table
       (setq standard-display-table (make-display-table)))
+  (if (> h 255)
+      (setq h 255))
   (while (<= l h)
-    (aset standard-display-table l (if (or (< l ?\s) (>= l 127)) (vector l)))
+    (if (< l 128)
+	(aset standard-display-table l
+	      (if (or (< l ?\s) (= l 127)) (vector l)))
+      (let ((c (unibyte-char-to-multibyte l)))
+	(aset standard-display-table c (vector c))))
     (setq l (1+ l))))
 
 ;;;###autoload
@@ -235,9 +251,12 @@
 	  (and (null arg)
 	       (char-table-p standard-display-table)
 	       ;; Test 161, because 160 displays as a space.
-	       (equal (aref standard-display-table 161) [161])))
+	       (equal (aref standard-display-table
+			    (unibyte-char-to-multibyte 161))
+		      (vector (unibyte-char-to-multibyte 161)))))
       (progn
-	(standard-display-default 160 255)
+	(standard-display-default
+	 (unibyte-char-to-multibyte 160) (unibyte-char-to-multibyte 255))
 	(unless (or (memq window-system '(x w32 ns)))
 	  (and (terminal-coding-system)
 	       (set-terminal-coding-system nil))))
--- a/lisp/dnd.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/dnd.el	Wed Oct 13 22:40:51 2010 +0900
@@ -154,10 +154,11 @@
       (let* ((decoded-f (decode-coding-string
 			 f
 			 (or file-name-coding-system
-			     default-file-name-coding-system)))
-	     (try-f (if (file-readable-p decoded-f) decoded-f f)))
-	(when (file-readable-p try-f) try-f)))))
-
+			     default-file-name-coding-system))))
+	(setq f (cond ((file-readable-p decoded-f) decoded-f)
+		      ((file-readable-p f) f)
+		      (t nil)))))
+    f))
 
 (defun dnd-open-local-file (uri action)
   "Open a local file.
--- a/lisp/emacs-lisp/byte-opt.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/byte-opt.el	Wed Oct 13 22:40:51 2010 +0900
@@ -381,9 +381,11 @@
 		form))
 	  ((or (byte-code-function-p fn)
 	       (eq 'lambda (car-safe fn)))
-           (byte-optimize-form-code-walker
-            (byte-compile-unfold-lambda form)
-            for-effect))
+	   (let ((newform (byte-compile-unfold-lambda form)))
+	     (if (eq newform form)
+		 ;; Some error occurred, avoid infinite recursion
+		 form
+	       (byte-optimize-form-code-walker newform for-effect))))
 	  ((memq fn '(let let*))
 	   ;; recursively enter the optimizer for the bindings and body
 	   ;; of a let or let*.  This for depth-firstness: forms that
--- a/lisp/emacs-lisp/byte-run.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/byte-run.el	Wed Oct 13 22:40:51 2010 +0900
@@ -108,10 +108,11 @@
 
 (defvar advertised-signature-table (make-hash-table :test 'eq :weakness 'key))
 
-(defun set-advertised-calling-convention (function signature)
+(defun set-advertised-calling-convention (function signature when)
   "Set the advertised SIGNATURE of FUNCTION.
 This will allow the byte-compiler to warn the programmer when she uses
-an obsolete calling convention."
+an obsolete calling convention.  WHEN specifies since when the calling
+convention was modified."
   (puthash (indirect-function function) signature
            advertised-signature-table))
 
@@ -132,7 +133,7 @@
   obsolete-name)
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.
- 'make-obsolete '(obsolete-name current-name when))
+ 'make-obsolete '(obsolete-name current-name when) "23.1")
 
 (defmacro define-obsolete-function-alias (obsolete-name current-name
 						   &optional when docstring)
@@ -153,7 +154,7 @@
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.
  'define-obsolete-function-alias
- '(obsolete-name current-name when &optional docstring))
+ '(obsolete-name current-name when &optional docstring) "23.1")
 
 (defun make-obsolete-variable (obsolete-name current-name &optional when)
   "Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
@@ -175,7 +176,7 @@
   obsolete-name)
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.
- 'make-obsolete-variable '(obsolete-name current-name when))
+ 'make-obsolete-variable '(obsolete-name current-name when) "23.1")
 
 (defmacro define-obsolete-variable-alias (obsolete-name current-name
 						 &optional when docstring)
@@ -210,7 +211,7 @@
 (set-advertised-calling-convention
  ;; New code should always provide the `when' argument.
  'define-obsolete-variable-alias
- '(obsolete-name current-name when &optional docstring))
+ '(obsolete-name current-name when &optional docstring) "23.1")
 
 ;; FIXME This is only defined in this file because the variable- and
 ;; function- versions are too.  Unlike those two, this one is not used
--- a/lisp/emacs-lisp/cl-compat.el	Sun Aug 29 14:22:52 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
-
-;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Dave Gillespie <daveg@synaptics.com>
-;; Version: 2.02
-;; Keywords: extensions
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; These are extensions to Emacs Lisp that provide a degree of
-;; Common Lisp compatibility, beyond what is already built-in
-;; in Emacs Lisp.
-;;
-;; This package was written by Dave Gillespie; it is a complete
-;; rewrite of Cesar Quiroz's original cl.el package of December 1986.
-;;
-;; This package works with Emacs 18, Emacs 19, and Lucid Emacs 19.
-;;
-;; Bug reports, comments, and suggestions are welcome!
-
-;; This file contains emulations of internal routines of the older
-;; CL package which users may have called directly from their code.
-;; Use (require 'cl-compat) to get these routines.
-
-;; See cl.el for Change Log.
-
-
-;;; Code:
-
-;; This used to be:
-;; (or (featurep 'cl) (require 'cl))
-;; which just has the effect of fooling the byte-compiler into not
-;; loading cl when compiling.  However, that leads to some bogus
-;; compiler warnings.  Loading cl when compiling cannot do any harm,
-;; because for a long time bootstrap-emacs contained 'cl, due to being
-;; dumped from uncompiled files that eval-when-compile'd cl.  So every
-;; file was compiled with 'cl loaded.
-(require 'cl)
-
-
-;;; Keyword routines not supported by new package.
-
-(defmacro defkeyword (x &optional doc)
-  (list* 'defconst x (list 'quote x) (and doc (list doc))))
-
-(defun keyword-of (sym)
-  (or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
-
-
-;;; Multiple values.  Note that the new package uses a different
-;;; convention for multiple values.  The following definitions
-;;; emulate the old convention; all function names have been changed
-;;; by capitalizing the first letter: Values, Multiple-value-*,
-;;; to avoid conflict with the new-style definitions in cl-macs.
-
-(put 'Multiple-value-bind  'lisp-indent-function 2)
-(put 'Multiple-value-setq  'lisp-indent-function 2)
-(put 'Multiple-value-call  'lisp-indent-function 1)
-(put 'Multiple-value-prog1 'lisp-indent-function 1)
-
-(defvar *mvalues-values* nil)
-
-(defun Values (&rest val-forms)
-  (setq *mvalues-values* val-forms)
-  (car val-forms))
-
-(defun Values-list (val-forms)
-  (apply 'values val-forms))
-
-(defmacro Multiple-value-list (form)
-  (list 'let* (list '(*mvalues-values* nil) (list '*mvalues-temp* form))
-	'(or (and (eq *mvalues-temp* (car *mvalues-values*)) *mvalues-values*)
-	     (list *mvalues-temp*))))
-
-(defmacro Multiple-value-call (function &rest args)
-  (list 'apply function
-	(cons 'append
-	      (mapcar (function (lambda (x) (list 'Multiple-value-list x)))
-		      args))))
-
-(defmacro Multiple-value-bind (vars form &rest body)
-  (list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
-
-(defmacro Multiple-value-setq (vars form)
-  (list 'multiple-value-setq vars (list 'Multiple-value-list form)))
-
-(defmacro Multiple-value-prog1 (form &rest body)
-  (list 'prog1 form (list* 'let '((*mvalues-values* nil)) body)))
-
-
-;;; Routines for parsing keyword arguments.
-
-(defun build-klist (arglist keys &optional allow-others)
-  (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
-    (or allow-others
-	(let ((bad (set-difference (mapcar 'car res) keys)))
-	  (if bad (error "Bad keywords: %s not in %s" bad keys))))
-    res))
-
-(defun extract-from-klist (klist key &optional def)
-  (let ((res (assq key klist))) (if res (cdr res) def)))
-
-(defun keyword-argument-supplied-p (klist key)
-  (assq key klist))
-
-(defun elt-satisfies-test-p (item elt klist)
-  (let ((test-not (cdr (assq ':test-not klist)))
-	(test (cdr (assq ':test klist)))
-	(key (cdr (assq ':key klist))))
-    (if key (setq elt (funcall key elt)))
-    (if test-not (not (funcall test-not item elt))
-      (funcall (or test 'eql) item elt))))
-
-
-;;; Rounding functions with old-style multiple value returns.
-
-(defun cl-floor (a &optional b) (Values-list (floor* a b)))
-(defun cl-ceiling (a &optional b) (Values-list (ceiling* a b)))
-(defun cl-round (a &optional b) (Values-list (round* a b)))
-(defun cl-truncate (a &optional b) (Values-list (truncate* a b)))
-
-(defun safe-idiv (a b)
-  (let* ((q (/ (abs a) (abs b)))
-         (s (* (signum a) (signum b))))
-    (Values q (- a (* s q b)) s)))
-
-
-;; Internal routines.
-
-(defun pair-with-newsyms (oldforms)
-  (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
-    (Values (mapcar* 'list newsyms oldforms) newsyms)))
-
-(defun zip-lists (evens odds)
-  (mapcan 'list evens odds))
-
-(defun unzip-lists (list)
-  (let ((e nil) (o nil))
-    (while list
-      (setq e (cons (car list) e) o (cons (cadr list) o) list (cddr list)))
-    (Values (nreverse e) (nreverse o))))
-
-(defun reassemble-argslists (list)
-  (let ((n (apply 'min (mapcar 'length list))) (res nil))
-    (while (>= (setq n (1- n)) 0)
-      (setq res (cons (mapcar (function (lambda (x) (elt x n))) list) res)))
-    res))
-
-(defun duplicate-symbols-p (list)
-  (let ((res nil))
-    (while list
-      (if (memq (car list) (cdr list)) (setq res (cons (car list) res)))
-      (setq list (cdr list)))
-    res))
-
-
-;;; Setf internals.
-
-(defun setnth (n list x)
-  (setcar (nthcdr n list) x))
-
-(defun setnthcdr (n list x)
-  (setcdr (nthcdr (1- n) list) x))
-
-(defun setelt (seq n x)
-  (if (consp seq) (setcar (nthcdr n seq) x) (aset seq n x)))
-
-
-;;; Functions omitted: case-clausify, check-do-stepforms, check-do-endforms,
-;;; extract-do-inits, extract-do[*]-steps, select-stepping-forms,
-;;; elt-satisfies-if[-not]-p, with-keyword-args, mv-bind-clausify,
-;;; all names with embedded `$'.
-
-
-(provide 'cl-compat)
-
-;; Local variables:
-;; byte-compile-warnings: (not cl-functions)
-;; End:
-
-;; arch-tag: 9996bb4f-aaf5-4592-b436-bf64759a3163
-;;; cl-compat.el ends here
--- a/lisp/emacs-lisp/eieio.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/eieio.el	Wed Oct 13 22:40:51 2010 +0900
@@ -5,7 +5,7 @@
 ;;   2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
-;; Version: 0.2
+;; Version: 1.3
 ;; Keywords: OO, lisp
 
 ;; This file is part of GNU Emacs.
@@ -31,6 +31,11 @@
 ;; Emacs running environment.
 ;;
 ;; See eieio.texi for complete documentation on using this package.
+;;
+;; Note: the implementation of the c3 algorithm is based on:
+;;   Kim Barrett et al.: A Monotonic Superclass Linearization for Dylan
+;;   Retrieved from:
+;;   http://192.220.96.201/dylan/linearization-oopsla96.html
 
 ;; There is funny stuff going on with typep and deftype.  This
 ;; is the only way I seem to be able to make this stuff load properly.
@@ -44,7 +49,7 @@
   (require 'cl)
   (require 'eieio-comp))
 
-(defvar eieio-version "1.2"
+(defvar eieio-version "1.3"
   "Current version of EIEIO.")
 
 (defun eieio-version ()
@@ -79,7 +84,7 @@
   "*This hook is executed, then cleared each time `defclass' is called.")
 
 (defvar eieio-error-unsupported-class-tags nil
-  "*Non-nil to throw an error if an encountered tag us unsupported.
+  "Non-nil to throw an error if an encountered tag is unsupported.
 This may prevent classes from CLOS applications from being used with EIEIO
 since EIEIO does not support all CLOS tags.")
 
@@ -170,6 +175,13 @@
 (defconst method-generic-after 6 "Index into generic :after tag on a method.")
 (defconst method-num-slots 7 "Number of indexes into a method's vector.")
 
+(defsubst eieio-specialized-key-to-generic-key (key)
+  "Convert a specialized KEY into a generic method key."
+  (cond ((eq key method-static) 0) ;; don't convert
+	((< key method-num-lists) (+ key 3)) ;; The conversion
+	(t key) ;; already generic.. maybe.
+	))
+
 ;; How to specialty compile stuff.
 (autoload 'byte-compile-file-form-defmethod "eieio-comp"
   "This function is used to byte compile methods in a nice way.")
@@ -243,8 +255,7 @@
        ))
 
 (defmacro class-option-assoc (list option)
-  "Return from LIST the found OPTION.
-Return nil if it doesn't exist."
+  "Return from LIST the found OPTION, or nil if it doesn't exist."
   `(car-safe (cdr (memq ,option ,list))))
 
 (defmacro class-option (class option)
@@ -518,7 +529,7 @@
 
     ;; Make sure the method invocation order  is a valid value.
     (let ((io (class-option-assoc options :method-invocation-order)))
-      (when (and io (not (member io '(:depth-first :breadth-first))))
+      (when (and io (not (member io '(:depth-first :breadth-first :c3))))
 	(error "Method invocation order %s is not allowed" io)
 	))
 
@@ -800,11 +811,11 @@
 (defun eieio-perform-slot-validation-for-default (slot spec value skipnil)
   "For SLOT, signal if SPEC does not match VALUE.
 If SKIPNIL is non-nil, then if VALUE is nil return t instead."
-  (let ((val (eieio-default-eval-maybe value)))
-    (if (and (not eieio-skip-typecheck)
-	     (not (and skipnil (null val)))
-	     (not (eieio-perform-slot-validation spec val)))
-	(signal 'invalid-slot-type (list slot spec val)))))
+  (if (and (not (eieio-eval-default-p value))
+	   (not eieio-skip-typecheck)
+	   (not (and skipnil (null value)))
+	   (not (eieio-perform-slot-validation spec value)))
+      (signal 'invalid-slot-type (list slot spec value))))
 
 (defun eieio-add-new-slot (newc a d doc type cust label custg print prot init alloc
 				 &optional defaultoverride skipnil)
@@ -1340,7 +1351,7 @@
       (if (= key -1)
 	  (signal 'wrong-type-argument (list :static 'non-class-arg)))
       ;; generics are higher
-      (setq key (+ key 3)))
+      (setq key (eieio-specialized-key-to-generic-key key)))
     ;; Put this lambda into the symbol so we can find it
     (if (byte-code-function-p (car-safe body))
 	(eieiomt-add method (car-safe body) key argclass)
@@ -1516,13 +1527,21 @@
 	 (eieio-default-eval-maybe val))
        obj cl 'oref-default))))
 
+(defsubst eieio-eval-default-p (val)
+  "Whether the default value VAL should be evaluated for use."
+  (and (consp val) (symbolp (car val)) (fboundp (car val))))
+
 (defun eieio-default-eval-maybe (val)
   "Check VAL, and return what `oref-default' would provide."
-  ;; check for quoted things, and unquote them
-  (if (and (listp val) (eq (car val) 'quote))
-      (car (cdr val))
-    ;; return it verbatim
-    val))
+  (cond
+   ;; Is it a function call?  If so, evaluate it.
+   ((eieio-eval-default-p val)
+    (eval val))
+   ;;;; check for quoted things, and unquote them
+   ;;((and (consp val) (eq (car val) 'quote))
+   ;; (car (cdr val)))
+   ;; return it verbatim
+   (t val)))
 
 ;;; Object Set macros
 ;;
@@ -1678,6 +1697,116 @@
   (if (not (class-p class)) (signal 'wrong-type-argument (list 'class-p class)))
   (class-children-fast class))
 
+(defun eieio-c3-candidate (class remaining-inputs)
+  "Returns CLASS if it can go in the result now, otherwise nil"
+  ;; Ensure CLASS is not in any position but the first in any of the
+  ;; element lists of REMAINING-INPUTS.
+  (and (not (let ((found nil))
+	      (while (and remaining-inputs (not found))
+		(setq found (member class (cdr (car remaining-inputs)))
+		      remaining-inputs (cdr remaining-inputs)))
+	      found))
+       class))
+
+(defun eieio-c3-merge-lists (reversed-partial-result remaining-inputs)
+  "Merge REVERSED-PARTIAL-RESULT REMAINING-INPUTS in a consistent order, if possible.
+If a consistent order does not exist, signal an error."
+  (if (let ((tail remaining-inputs)
+	    (found nil))
+	(while (and tail (not found))
+	  (setq found (car tail) tail (cdr tail)))
+	(not found))
+      ;; If all remaining inputs are empty lists, we are done.
+      (nreverse reversed-partial-result)
+    ;; Otherwise, we try to find the next element of the result. This
+    ;; is achieved by considering the first element of each
+    ;; (non-empty) input list and accepting a candidate if it is
+    ;; consistent with the rests of the input lists.
+    (let* ((found nil)
+	   (tail remaining-inputs)
+	   (next (progn
+		   (while (and tail (not found))
+		     (setq found (and (car tail)
+				      (eieio-c3-candidate (caar tail)
+							  remaining-inputs))
+			   tail (cdr tail)))
+		   found)))
+      (if next
+	  ;; The graph is consistent so far, add NEXT to result and
+	  ;; merge input lists, dropping NEXT from their heads where
+	  ;; applicable.
+	  (eieio-c3-merge-lists
+	   (cons next reversed-partial-result)
+	   (mapcar (lambda (l) (if (eq (first l) next) (rest l) l))
+		   remaining-inputs))
+	;; The graph is inconsistent, give up
+	(signal 'inconsistent-class-hierarchy (list remaining-inputs))))))
+
+(defun eieio-class-precedence-dfs (class)
+  "Return all parents of CLASS in depth-first order."
+  (let* ((parents (class-parents-fast class))
+	 (classes (copy-sequence
+		   (apply #'append
+			  (list class)
+			  (or
+			   (mapcar
+			    (lambda (parent)
+			      (cons parent
+				    (eieio-class-precedence-dfs parent)))
+			    parents)
+			   '((eieio-default-superclass))))))
+	 (tail classes))
+    ;; Remove duplicates.
+    (while tail
+      (setcdr tail (delq (car tail) (cdr tail)))
+      (setq tail (cdr tail)))
+    classes))
+
+(defun eieio-class-precedence-bfs (class)
+  "Return all parents of CLASS in breadth-first order."
+  (let ((result)
+	(queue (or (class-parents-fast class)
+		   '(eieio-default-superclass))))
+    (while queue
+      (let ((head (pop queue)))
+	(unless (member head result)
+	  (push head result)
+	  (unless (eq head 'eieio-default-superclass)
+	    (setq queue (append queue (or (class-parents-fast head)
+					  '(eieio-default-superclass))))))))
+    (cons class (nreverse result)))
+  )
+
+(defun eieio-class-precedence-c3 (class)
+  "Return all parents of CLASS in c3 order."
+  (let ((parents (class-parents-fast class)))
+    (eieio-c3-merge-lists
+     (list class)
+     (append
+      (or
+       (mapcar
+	(lambda (x)
+	  (eieio-class-precedence-c3 x))
+	parents)
+       '((eieio-default-superclass)))
+      (list parents))))
+  )
+
+(defun class-precedence-list (class)
+  "Return (transitively closed) list of parents of CLASS.
+The order, in which the parents are returned depends on the
+method invocation orders of the involved classes."
+  (if (or (null class) (eq class 'eieio-default-superclass))
+      nil
+    (case (class-method-invocation-order class)
+      (:depth-first
+       (eieio-class-precedence-dfs class))
+      (:breadth-first
+       (eieio-class-precedence-bfs class))
+      (:c3
+       (eieio-class-precedence-c3 class))))
+  )
+
 ;; Official CLOS functions.
 (defalias 'class-direct-superclasses 'class-parents)
 (defalias 'class-direct-subclasses 'class-children)
@@ -1715,7 +1844,8 @@
 	    p (cdr p)))
     (if child t)))
 
-(defun object-slots (obj) "Return list of slots available in OBJ."
+(defun object-slots (obj)
+  "Return list of slots available in OBJ."
   (if (not (eieio-object-p obj)) (signal 'wrong-type-argument (list 'eieio-object-p obj)))
   (aref (class-v (object-class-fast obj)) class-public-a))
 
@@ -2009,14 +2139,26 @@
 	    keys (append (make-list (length tlambdas) method-before) keys))
       )
 
-    ;; If there were no methods found, then there could be :static methods.
-    (when (not lambdas)
+    (if mclass
+	;; For the case of a class,
+	;; if there were no methods found, then there could be :static methods.
+	(when (not lambdas)
+	  (setq tlambdas
+		(eieio-generic-form method method-static mclass))
+	  (setq lambdas (cons tlambdas lambdas)
+		keys (cons method-static keys)
+		primarymethodlist  ;; Re-use even with bad name here
+		(eieiomt-method-list method method-static mclass)))
+      ;; For the case of no class (ie - mclass == nil) then there may
+      ;; be a primary method.
       (setq tlambdas
-	    (eieio-generic-form method method-static mclass))
-      (setq lambdas (cons tlambdas lambdas)
-	    keys (cons method-static keys)
-	    primarymethodlist  ;; Re-use even with bad name here
-	    (eieiomt-method-list method method-static mclass)))
+	    (eieio-generic-form method method-primary nil))
+      (when tlambdas
+	(setq lambdas (cons tlambdas lambdas)
+	      keys (cons method-primary keys)
+	      primarymethodlist
+	      (eieiomt-method-list method method-primary nil)))
+      )
 
     (run-hook-with-args 'eieio-pre-method-execution-hooks
 			primarymethodlist)
@@ -2143,37 +2285,23 @@
 If CLASS is nil, then an empty list of methods should be returned."
   ;; Note: eieiomt - the MT means MethodTree.  See more comments below
   ;; for the rest of the eieiomt methods.
-  (let ((lambdas nil)
-	(mclass (list class)))
-    (while mclass
-      ;; Note: a nil can show up in the class list once we start
-      ;;       searching through the method tree.
-      (when (car mclass)
-	;; lookup the form to use for the PRIMARY object for the next level
-	(let ((tmpl (eieio-generic-form method key (car mclass))))
-	  (when (or (not lambdas)
-		    ;; This prevents duplicates coming out of the
-		    ;; class method optimizer.  Perhaps we should
-		    ;; just not optimize before/afters?
-		    (not (eq (car tmpl) (car (car lambdas)))))
-	    (setq lambdas (cons tmpl lambdas))
-	    (if (null (car lambdas))
-		(setq lambdas (cdr lambdas))))))
-      ;; Add new classes to mclass.  Since our input might not be a class
-      ;; protect against that.
-      (if (car mclass)
-	  ;; If there is a class, append any methods it may provide
-	  ;; to the remainder of the class list.
-	  (let ((io (class-method-invocation-order (car mclass))))
-	    (if (eq io :depth-first)
-		;; Depth first.
-		(setq mclass (append (eieiomt-next (car mclass)) (cdr mclass)))
-	      ;; Breadth first.
-	      (setq mclass (append (cdr mclass) (eieiomt-next (car mclass)))))
-	    )
-	;; Advance to next entry in mclass if it is nil.
-	(setq mclass (cdr mclass)))
-      )
+
+  ;; Collect lambda expressions stored for the class and its parent
+  ;; classes.
+  (let (lambdas)
+    (dolist (ancestor (class-precedence-list class))
+      ;; Lookup the form to use for the PRIMARY object for the next level
+      (let ((tmpl (eieio-generic-form method key ancestor)))
+	(when (and tmpl
+		   (or (not lambdas)
+		       ;; This prevents duplicates coming out of the
+		       ;; class method optimizer.  Perhaps we should
+		       ;; just not optimize before/afters?
+		       (not (member tmpl lambdas))))
+	  (push tmpl lambdas))))
+
+    ;; Return collected lambda. For :after methods, return in current
+    ;; order (most general class last); Otherwise, reverse order.
     (if (eq key method-after)
 	lambdas
       (nreverse lambdas))))
@@ -2207,6 +2335,7 @@
 	(apply 'no-next-method (car newargs) (cdr newargs))
       (let* ((eieio-generic-call-next-method-list
 	      (cdr eieio-generic-call-next-method-list))
+	     (eieio-generic-call-arglst newargs)
 	     (scoped-class (cdr next))
 	     (fcn (car next))
 	     )
@@ -2299,32 +2428,18 @@
 
 (defun eieiomt-sym-optimize (s)
   "Find the next class above S which has a function body for the optimizer."
-  ;; (message "Optimizing %S" s)
-  (let* ((es (intern-soft (symbol-name s))) ;external symbol of class
-	 (io (class-method-invocation-order es))
-	 (ov nil)
-	 (cont t))
-    ;; This converts ES from a single symbol to a list of parent classes.
-    (setq es (eieiomt-next es))
-    ;; Loop over ES, then its children individually.
-    ;; We can have multiple hits only at one level of the parent tree.
-    (while (and es cont)
-      (setq ov (intern-soft (symbol-name (car es)) eieiomt-optimizing-obarray))
-      (if (fboundp ov)
-	  (progn
-	    (set s ov)			;store ov as our next symbol
-	    (setq cont nil))
-	(if (eq io :depth-first)
-	    ;; Pre-pend the subclasses of (car es) so we get
-	    ;; DEPTH FIRST optimization.
-	    (setq es (append (eieiomt-next (car es)) (cdr es)))
-	  ;; Else, we are breadth first.
-	  ;; (message "Class %s is breadth first" es)
-	  (setq es (append (cdr es) (eieiomt-next (car es))))
-	  )))
-    ;; If there is no nearest call, then set our value to nil
-    (if (not es) (set s nil))
-    ))
+  ;; Set the value to nil in case there is no nearest cell.
+  (set s nil)
+  ;; Find the nearest cell that has a function body. If we find one,
+  ;; we replace the nil from above.
+  (let ((external-symbol (intern-soft (symbol-name s))))
+    (catch 'done
+      (dolist (ancestor (rest (class-precedence-list external-symbol)))
+	(let ((ov (intern-soft (symbol-name ancestor)
+			       eieiomt-optimizing-obarray)))
+	  (when (fboundp ov)
+	    (set s ov) ;; store ov as our next symbol
+	    (throw 'done ancestor)))))))
 
 (defun eieio-generic-form (method key class)
  "Return the lambda form belonging to METHOD using KEY based upon CLASS.
@@ -2333,7 +2448,7 @@
 The first time a form is requested from a symbol, an optimized path
 is memorized for faster future use."
  (let ((emto (aref (get method 'eieio-method-obarray)
-		   (if class key (+ key 3)))))
+		   (if class key (eieio-specialized-key-to-generic-key key)))))
    (if (class-p class)
        ;; 1) find our symbol
        (let ((cs (intern-soft (symbol-name class) emto)))
@@ -2366,7 +2481,7 @@
 	       nil)))
      ;; for a generic call, what is a list, is the function body we want.
      (let ((emtl (aref (get method 'eieio-method-tree)
-		       (if class key (+ key 3)))))
+ 		       (if class key (eieio-specialized-key-to-generic-key key)))))
        (if emtl
 	   ;; The car of EMTL is supposed to be a class, which in this
 	   ;; case is nil, so skip it.
@@ -2431,6 +2546,11 @@
 (put 'unbound-slot 'error-conditions '(unbound-slot error nil))
 (put 'unbound-slot 'error-message "Unbound slot")
 
+(intern "inconsistent-class-hierarchy")
+(put 'inconsistent-class-hierarchy 'error-conditions
+     '(inconsistent-class-hierarchy error nil))
+(put 'inconsistent-class-hierarchy 'error-message "Inconsistent class hierarchy")
+
 ;;; Here are some CLOS items that need the CL package
 ;;
 
@@ -2526,6 +2646,17 @@
 	   (slot (aref scoped-class class-public-a))
 	   (defaults (aref scoped-class class-public-d)))
       (while slot
+	;; For each slot, see if we need to evaluate it.
+	;;
+	;; Paul Landes said in an email:
+	;; > CL evaluates it if it can, and otherwise, leaves it as
+	;; > the quoted thing as you already have.  This is by the
+	;; > Sonya E. Keene book and other things I've look at on the
+	;; > web.
+	(let ((dflt (eieio-default-eval-maybe (car defaults))))
+	  (when (not (eq dflt (car defaults)))
+	    (eieio-oset this (car slot) dflt) ))
+	;; Next.
 	(setq slot (cdr slot)
 	      defaults (cdr defaults))))
     ;; Shared initialize will parse our slots for us.
--- a/lisp/emacs-lisp/float-sup.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/float-sup.el	Wed Oct 13 22:40:51 2010 +0900
@@ -34,25 +34,25 @@
 
 ;; provide an easy hook to tell if we are running with floats or not.
 ;; define pi and e via math-lib calls. (much less prone to killer typos.)
-(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")
+(defconst float-pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")
+(defconst pi float-pi "Obsolete since Emacs-23.3.  Use `float-pi' instead.")
 
-;; It's too inconvenient to make `e' a constant because it's used as
-;; a temporary variable all the time.
-(defvar e (exp 1) "The value of e (2.7182818...).")
+(defconst float-e (exp 1) "The value of e (2.7182818...).")
+(defvar e float-e "Obsolete since Emacs-23.3.  Use `float-e' instead.")
 
-(defconst degrees-to-radians (/ pi 180.0)
+(defconst degrees-to-radians (/ float-pi 180.0)
   "Degrees to radian conversion constant.")
-(defconst radians-to-degrees (/ 180.0 pi)
+(defconst radians-to-degrees (/ 180.0 float-pi)
   "Radian to degree conversion constant.")
 
 ;; these expand to a single multiply by a float when byte compiled
 
 (defmacro degrees-to-radians (x)
   "Convert ARG from degrees to radians."
-  (list '* (/ pi 180.0) x))
+  (list '* degrees-to-radians x))
 (defmacro radians-to-degrees (x)
   "Convert ARG from radians to degrees."
-  (list '* (/ 180.0 pi) x))
+  (list '* radians-to-degrees x))
 
 (provide 'lisp-float-type)
 
--- a/lisp/emacs-lisp/lisp.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/lisp.el	Wed Oct 13 22:40:51 2010 +0900
@@ -632,37 +632,37 @@
 (defun lisp-completion-at-point (&optional predicate)
   "Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
   ;; FIXME: the `end' could be after point?
-  (let* ((end (point))
-         (beg (with-syntax-table emacs-lisp-mode-syntax-table
-                (save-excursion
+  (with-syntax-table emacs-lisp-mode-syntax-table
+    (let* ((end (point))
+           (beg (save-excursion
                   (backward-sexp 1)
                   (while (= (char-syntax (following-char)) ?\')
                     (forward-char 1))
-                  (point))))
-         (predicate
-          (or predicate
-              (save-excursion
-                (goto-char beg)
-                (if (not (eq (char-before) ?\())
-                    (lambda (sym)	;why not just nil ?   -sm
-                      (or (boundp sym) (fboundp sym)
-                          (symbol-plist sym)))
-                  ;; Looks like a funcall position.  Let's double check.
-                  (if (condition-case nil
-                          (progn (up-list -2) (forward-char 1)
-                                 (eq (char-after) ?\())
-                        (error nil))
-                      ;; If the first element of the parent list is an open
-                      ;; parenthesis we are probably not in a funcall position.
-                      ;; Maybe a `let' varlist or something.
-                      nil
-                    ;; Else, we assume that a function name is expected.
-                    'fboundp))))))
-    (list beg end obarray
-          :predicate predicate
-          :annotate-function
+                  (point)))
+           (predicate
+            (or predicate
+                (save-excursion
+                  (goto-char beg)
+                  (if (not (eq (char-before) ?\())
+                      (lambda (sym)          ;why not just nil ?   -sm
+                        (or (boundp sym) (fboundp sym)
+                            (symbol-plist sym)))
+                    ;; Looks like a funcall position.  Let's double check.
+                    (if (condition-case nil
+                            (progn (up-list -2) (forward-char 1)
+                                   (eq (char-after) ?\())
+                          (error nil))
+                        ;; If the first element of the parent list is an open
+                        ;; paren we are probably not in a funcall position.
+                        ;; Maybe a `let' varlist or something.
+                        nil
+                      ;; Else, we assume that a function name is expected.
+                      'fboundp))))))
+      (list beg end obarray
+            :predicate predicate
+            :annotate-function
             (unless (eq predicate 'fboundp)
-              (lambda (str) (if (fboundp (intern-soft str)) " <f>"))))))
+              (lambda (str) (if (fboundp (intern-soft str)) " <f>")))))))
 
 ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
 ;;; lisp.el ends here
--- a/lisp/emacs-lisp/lmenu.el	Sun Aug 29 14:22:52 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,443 +0,0 @@
-;;; lmenu.el --- emulate Lucid's menubar support
-
-;; Copyright (C) 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Keywords: emulations obsolete
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-
-;; First, emulate the Lucid menubar support in GNU Emacs 19.
-
-;; Arrange to use current-menubar to set up part of the menu bar.
-
-(defvar current-menubar)
-(defvar lucid-menubar-map)
-(defvar lucid-failing-menubar)
-
-(defvar recompute-lucid-menubar 'recompute-lucid-menubar)
-(defun recompute-lucid-menubar ()
-  (define-key lucid-menubar-map [menu-bar]
-    (condition-case nil
-	(make-lucid-menu-keymap "menu-bar" current-menubar)
-      (error (message "Invalid data in current-menubar moved to lucid-failing-menubar")
-	     (sit-for 1)
-	     (setq lucid-failing-menubar current-menubar
-		   current-menubar nil))))
-  (setq lucid-menu-bar-dirty-flag nil))
-
-(defvar lucid-menubar-map (make-sparse-keymap))
-(or (assq 'current-menubar minor-mode-map-alist)
-    (setq minor-mode-map-alist
-	  (cons (cons 'current-menubar lucid-menubar-map)
-		minor-mode-map-alist)))
-
-;; XEmacs compatibility
-(defun set-menubar-dirty-flag ()
-  (force-mode-line-update)
-  (setq lucid-menu-bar-dirty-flag t))
-
-(defvar add-menu-item-count 0)
-
-;; This is a variable whose value is always nil.
-(defvar make-lucid-menu-keymap-disable nil)
-
-;; Return a menu keymap corresponding to a Lucid-style menu list
-;; MENU-ITEMS, and with name MENU-NAME.
-(defun make-lucid-menu-keymap (menu-name menu-items)
-  (let ((menu (make-sparse-keymap menu-name)))
-    ;; Process items in reverse order,
-    ;; since the define-key loop reverses them again.
-    (setq menu-items (reverse menu-items))
-    (while menu-items
-      (let ((item (car menu-items))
-	    command name callback)
-	(cond ((stringp item)
-	       (setq command nil)
-	       (setq name (if (string-match "^-+$" item) "" item)))
-	      ((consp item)
-	       (setq command (make-lucid-menu-keymap (car item) (cdr item)))
-	       (setq name (car item)))
-	      ((vectorp item)
-	       (setq command (make-symbol (format "menu-function-%d"
-						  add-menu-item-count))
-		     add-menu-item-count (1+ add-menu-item-count)
-		     name (aref item 0)
-		     callback (aref item 1))
-	       (if (symbolp callback)
-		   (fset command callback)
-		 (fset command (list 'lambda () '(interactive) callback)))
-	       (put command 'menu-alias t)
-	       (let ((i 2))
-		 (while (< i (length item))
-		   (cond
-		    ((eq (aref item i) ':active)
-		     (put command 'menu-enable
-			  (or (aref item (1+ i))
-			      'make-lucid-menu-keymap-disable))
-		     (setq i (+ 2 i)))
-		    ((eq (aref item i) ':suffix)
-		     ;; unimplemented
-		     (setq i (+ 2 i)))
-		    ((eq (aref item i) ':keys)
-		     ;; unimplemented
-		     (setq i (+ 2 i)))
-		    ((eq (aref item i) ':style)
-		     ;; unimplemented
-		     (setq i (+ 2 i)))
-		    ((eq (aref item i) ':selected)
-		     ;; unimplemented
-		     (setq i (+ 2 i)))
-		    ((and (symbolp (aref item i))
-			  (= ?: (string-to-char (symbol-name (aref item i)))))
-		     (error "Unrecognized menu item keyword: %S"
-			    (aref item i)))
-		    ((= i 2)
-		     ;; old-style format: active-p &optional suffix
-		     (put command 'menu-enable
-			  (or (aref item i) 'make-lucid-menu-keymap-disable))
-		     ;; suffix is unimplemented
-		     (setq i (length item)))
-		    (t
-		     (error "Unexpected menu item value: %S"
-			    (aref item i))))))))
-	(if (null command)
-	    ;; Handle inactive strings specially--allow any number
-	    ;; of identical ones.
-	    (setcdr menu (cons (list nil name) (cdr menu)))
-	  (if name
-	      (define-key menu (vector (intern name)) (cons name command)))))
-      (setq menu-items (cdr menu-items)))
-    menu))
-
-(declare-function x-popup-dialog "xmenu.c" (position contents &optional header))
-
-;; XEmacs compatibility function
-(defun popup-dialog-box (data)
-  "Pop up a dialog box.
-A dialog box description is a list.
-
- - The first element of the list is a string to display in the dialog box.
- - The rest of the elements are descriptions of the dialog box's buttons.
-   Each one is a vector of three elements:
-   - The first element is the text of the button.
-   - The second element is the `callback'.
-   - The third element is t or nil, whether this button is selectable.
-
-If the `callback' of a button is a symbol, then it must name a command.
-It will be invoked with `call-interactively'.  If it is a list, then it is
-evaluated with `eval'.
-
-One (and only one) of the buttons may be nil.  This marker means that all
-following buttons should be flushright instead of flushleft.
-
-The syntax, more precisely:
-
-   form		:=  <something to pass to `eval'>
-   command	:=  <a symbol or string, to pass to `call-interactively'>
-   callback 	:=  command | form
-   active-p	:=  <t, nil, or a form to evaluate to decide whether this
-		    button should be selectable>
-   name		:=  <string>
-   partition	:=  'nil'
-   button	:=  '['  name callback active-p ']'
-   dialog	:=  '(' name [ button ]+ [ partition [ button ]+ ] ')'"
-  (let ((name (car data))
-	(tail (cdr data))
-	converted
-	choice meaning)
-    (while tail
-      (if (null (car tail))
-	  (setq converted (cons nil converted))
-	(let ((item (aref (car tail) 0))
-	      (callback (aref (car tail) 1))
-	      (enable (aref (car tail) 2)))
-	  (setq converted
-		(cons (if enable (cons item callback) item)
-		      converted))))
-      (setq tail (cdr tail)))
-    (setq choice (x-popup-dialog t (cons name (nreverse converted))))
-    (if choice
-	(if (symbolp choice)
-	    (call-interactively choice)
-	  (eval choice)))))
-
-;; This is empty because the usual elements of the menu bar
-;; are provided by menu-bar.el instead.
-;; It would not make sense to duplicate them here.
-(defconst default-menubar nil)
-
-;; XEmacs compatibility
-(defun set-menubar (menubar)
-  "Set the default menubar to be menubar."
-  (setq-default current-menubar (copy-sequence menubar))
-  (set-menubar-dirty-flag))
-
-;; XEmacs compatibility
-(defun set-buffer-menubar (menubar)
-  "Set the buffer-local menubar to be menubar."
-  (make-local-variable 'current-menubar)
-  (setq current-menubar (copy-sequence menubar))
-  (set-menubar-dirty-flag))
-
-
-;;; menu manipulation functions
-
-;; XEmacs compatibility
-(defun find-menu-item (menubar item-path-list &optional parent)
-  "Searches MENUBAR for item given by ITEM-PATH-LIST.
-Returns (ITEM . PARENT), where PARENT is the immediate parent of
- the item found.
-Signals an error if the item is not found."
-  (or parent (setq item-path-list (mapcar 'downcase item-path-list)))
-  (if (not (consp menubar))
-      nil
-    (let ((rest menubar)
-	  result)
-      (while rest
-	(if (and (car rest)
-		 (equal (car item-path-list)
-			(downcase (if (vectorp (car rest))
-				      (aref (car rest) 0)
-				    (if (stringp (car rest))
-					(car rest)
-				      (car (car rest)))))))
-	    (setq result (car rest) rest nil)
-	  (setq rest (cdr rest))))
-      (if (cdr item-path-list)
-	  (if (consp result)
-	      (find-menu-item (cdr result) (cdr item-path-list) result)
-	    (if result
-		(signal 'error (list "not a submenu" result))
-	      (signal 'error (list "no such submenu" (car item-path-list)))))
-	(cons result parent)))))
-
-
-;; XEmacs compatibility
-(defun disable-menu-item (path)
-  "Make the named menu item be unselectable.
-PATH is a list of strings which identify the position of the menu item in
-the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
-under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
-menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
-  (let* ((menubar current-menubar)
-	 (pair (find-menu-item menubar path))
-	 (item (car pair))
-	 (menu (cdr pair)))
-    (or item
-	(signal 'error (list (if menu "No such menu item" "No such menu")
-			     path)))
-    (if (consp item) (error "can't disable menus, only menu items"))
-    (aset item 2 nil)
-    (set-menubar-dirty-flag)
-    item))
-
-
-;; XEmacs compatibility
-(defun enable-menu-item (path)
-  "Make the named menu item be selectable.
-PATH is a list of strings which identify the position of the menu item in
-the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
-under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
-menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
-  (let* ((menubar current-menubar)
-	 (pair (find-menu-item menubar path))
-	 (item (car pair))
-	 (menu (cdr pair)))
-    (or item
-	(signal 'error (list (if menu "No such menu item" "No such menu")
-			     path)))
-    (if (consp item) (error "%S is a menu, not a menu item" path))
-    (aset item 2 t)
-    (set-menubar-dirty-flag)
-    item))
-
-
-(defun add-menu-item-1 (item-p menu-path item-name item-data enabled-p before)
-  (if before (setq before (downcase before)))
-  (let* ((menubar current-menubar)
-	 (menu (condition-case ()
-		   (car (find-menu-item menubar menu-path))
-		 (error nil)))
-	 (item (if (listp menu)
-		   (car (find-menu-item (cdr menu) (list item-name)))
-		 (signal 'error (list "not a submenu" menu-path)))))
-    (or menu
-	(let ((rest menu-path)
-	      (so-far menubar))
-	  (while rest
-;;;	    (setq menu (car (find-menu-item (cdr so-far) (list (car rest)))))
-	    (setq menu
-		  (if (eq so-far menubar)
-		      (car (find-menu-item so-far (list (car rest))))
-		    (car (find-menu-item (cdr so-far) (list (car rest))))))
-	    (or menu
-		(let ((rest2 so-far))
-		  (or rest2
-		      (error "Trying to modify a menu that doesn't exist"))
-		  (while (and (cdr rest2) (car (cdr rest2)))
-		    (setq rest2 (cdr rest2)))
-		  (setcdr rest2
-			  (nconc (list (setq menu (list (car rest))))
-				 (cdr rest2)))))
-	    (setq so-far menu)
-	    (setq rest (cdr rest)))))
-    (or menu (setq menu menubar))
-    (if item
-	nil	; it's already there
-      (if item-p
-	  (setq item (vector item-name item-data enabled-p))
-	(setq item (cons item-name item-data)))
-      ;; if BEFORE is specified, try to add it there.
-      (if before
-	  (setq before (car (find-menu-item menu (list before)))))
-      (let ((rest menu)
-	    (added-before nil))
-	(while rest
-	  (if (eq before (car (cdr rest)))
-	      (progn
-		(setcdr rest (cons item (cdr rest)))
-		(setq rest nil added-before t))
-	    (setq rest (cdr rest))))
-	(if (not added-before)
-	    ;; adding before the first item on the menubar itself is harder
-	    (if (and (eq menu menubar) (eq before (car menu)))
-		(setq menu (cons item menu)
-		      current-menubar menu)
-	      ;; otherwise, add the item to the end.
-	      (nconc menu (list item))))))
-    (if item-p
-	(progn
-	  (aset item 1 item-data)
-	  (aset item 2 (not (null enabled-p))))
-      (setcar item item-name)
-      (setcdr item item-data))
-    (set-menubar-dirty-flag)
-    item))
-
-;; XEmacs compatibility
-(defun add-menu-item (menu-path item-name function enabled-p &optional before)
-  "Add a menu item to some menu, creating the menu first if necessary.
-If the named item exists already, it is changed.
-MENU-PATH identifies the menu under which the new menu item should be inserted.
- It is a list of strings; for example, (\"File\") names the top-level \"File\"
- menu.  (\"File\" \"Foo\") names a hypothetical submenu of \"File\".
-ITEM-NAME is the string naming the menu item to be added.
-FUNCTION is the command to invoke when this menu item is selected.
- If it is a symbol, then it is invoked with `call-interactively', in the same
- way that functions bound to keys are invoked.  If it is a list, then the
- list is simply evaluated.
-ENABLED-P controls whether the item is selectable or not.
-BEFORE, if provided, is the name of a menu item before which this item should
- be added, if this item is not on the menu already.  If the item is already
- present, it will not be moved."
-  (or menu-path (error "must specify a menu path"))
-  (or item-name (error "must specify an item name"))
-  (add-menu-item-1 t menu-path item-name function enabled-p before))
-
-
-;; XEmacs compatibility
-(defun delete-menu-item (path)
-  "Remove the named menu item from the menu hierarchy.
-PATH is a list of strings which identify the position of the menu item in
-the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
-under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
-menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
-  (let* ((menubar current-menubar)
-	 (pair (find-menu-item menubar path))
-	 (item (car pair))
-	 (menu (or (cdr pair) menubar)))
-    (if (not item)
-	nil
-      ;; the menubar is the only special case, because other menus begin
-      ;; with their name.
-      (if (eq menu current-menubar)
-	  (setq current-menubar (delq item menu))
-	(delq item menu))
-      (set-menubar-dirty-flag)
-      item)))
-
-
-;; XEmacs compatibility
-(defun relabel-menu-item (path new-name)
-  "Change the string of the specified menu item.
-PATH is a list of strings which identify the position of the menu item in
-the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
-under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
-menu item called \"Item\" under the \"Foo\" submenu of \"Menu\".
-NEW-NAME is the string that the menu item will be printed as from now on."
-  (or (stringp new-name)
-      (setq new-name (signal 'wrong-type-argument (list 'stringp new-name))))
-  (let* ((menubar current-menubar)
-	 (pair (find-menu-item menubar path))
-	 (item (car pair))
-	 (menu (cdr pair)))
-    (or item
-	(signal 'error (list (if menu "No such menu item" "No such menu")
-			     path)))
-    (if (and (consp item)
-	     (stringp (car item)))
-	(setcar item new-name)
-      (aset item 0 new-name))
-    (set-menubar-dirty-flag)
-    item))
-
-;; XEmacs compatibility
-(defun add-menu (menu-path menu-name menu-items &optional before)
-  "Add a menu to the menubar or one of its submenus.
-If the named menu exists already, it is changed.
-MENU-PATH identifies the menu under which the new menu should be inserted.
- It is a list of strings; for example, (\"File\") names the top-level \"File\"
- menu.  (\"File\" \"Foo\") names a hypothetical submenu of \"File\".
- If MENU-PATH is nil, then the menu will be added to the menubar itself.
-MENU-NAME is the string naming the menu to be added.
-MENU-ITEMS is a list of menu item descriptions.
- Each menu item should be a vector of three elements:
-   - a string, the name of the menu item;
-   - a symbol naming a command, or a form to evaluate;
-   - and a form whose value determines whether this item is selectable.
-BEFORE, if provided, is the name of a menu before which this menu should
- be added, if this menu is not on its parent already.  If the menu is already
- present, it will not be moved."
-  (or menu-name (error "must specify a menu name"))
-  (or menu-items (error "must specify some menu items"))
-  (add-menu-item-1 nil menu-path menu-name menu-items t before))
-
-
-
-(defvar put-buffer-names-in-file-menu t)
-
-
-;; Don't unconditionally enable menu bars; leave that up to the user.
-;;(let ((frames (frame-list)))
-;;  (while frames
-;;    (modify-frame-parameters (car frames) '((menu-bar-lines . 1)))
-;;    (setq frames (cdr frames))))
-;;(or (assq 'menu-bar-lines default-frame-alist)
-;;    (setq default-frame-alist
-;;	  (cons '(menu-bar-lines . 1) default-frame-alist)))
-
-(set-menubar default-menubar)
-
-(provide 'lmenu)
-
-;; arch-tag: 7051c396-2837-435a-ae11-b2d2e2af8fc1
-;;; lmenu.el ends here
--- a/lisp/emacs-lisp/rx.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/rx.el	Wed Oct 13 22:40:51 2010 +0900
@@ -427,7 +427,7 @@
 	    (mapcar (lambda (e)
 		      (cond
 		       ((= (car e) (cdr e)) (list (car e)))
-		       ;; ((= (1+ (car e)) (cdr e)) (list (car e) (cdr e)))
+		       ((= (1+ (car e)) (cdr e)) (list (car e) (cdr e)))
 		       ((list e))))
 		    l))
      (delete-dups str))))
@@ -545,7 +545,10 @@
 			    ((numberp e) (string e))
 			    ((consp e)
 			     (if (and (= (1+ (car e)) (cdr e))
-				      (null (memq (car e) '(?\] ?-))))
+                                      ;; rx-any-condense-range should
+                                      ;; prevent this case from happening.
+				      (null (memq (car e) '(?\] ?-)))
+                                      (null (memq (cdr e) '(?\] ?-))))
 				 (string (car e) (cdr e))
 			       (string (car e) ?- (cdr e))))
 			    (e)))
--- a/lisp/emacs-lisp/shadow.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/emacs-lisp/shadow.el	Wed Oct 13 22:40:51 2010 +0900
@@ -24,7 +24,7 @@
 
 ;;; Commentary:
 
-;; The functions in this file detect (`find-emacs-lisp-shadows')
+;; The functions in this file detect (`load-path-shadows-find')
 ;; and display (`list-load-path-shadows') potential load-path
 ;; problems that arise when Emacs Lisp files "shadow" each other.
 ;;
@@ -53,16 +53,19 @@
 
 (defgroup lisp-shadow nil
   "Locate Emacs Lisp file shadowings."
-  :prefix "shadows-"
+  :prefix "load-path-shadows-"
   :group 'lisp)
 
-(defcustom shadows-compare-text-p nil
+(define-obsolete-variable-alias 'shadows-compare-text-p
+  'load-path-shadows-compare-text "23.3")
+
+(defcustom load-path-shadows-compare-text nil
   "If non-nil, then shadowing files are reported only if their text differs.
 This is slower, but filters out some innocuous shadowing."
   :type 'boolean
   :group 'lisp-shadow)
 
-(defun find-emacs-lisp-shadows (&optional path)
+(defun load-path-shadows-find (&optional path)
   "Return a list of Emacs Lisp files that create shadows.
 This function does the work for `list-load-path-shadows'.
 
@@ -124,11 +127,11 @@
 		;; Report it unless the files are identical.
 		(let ((base1 (concat (cdr orig-dir) "/" file))
 		      (base2 (concat dir "/" file)))
-		  (if (not (and shadows-compare-text-p
-				(shadow-same-file-or-nonexistent
+		  (if (not (and load-path-shadows-compare-text
+				(load-path-shadows-same-file-or-nonexistent
 				 (concat base1 ".el") (concat base2 ".el"))
 				;; This is a bit strict, but safe.
-				(shadow-same-file-or-nonexistent
+				(load-path-shadows-same-file-or-nonexistent
 				 (concat base1 ".elc") (concat base2 ".elc"))))
 		      (setq shadows
 			    (append shadows (list base1 base2)))))
@@ -138,9 +141,12 @@
     ;; Return the list of shadowings.
     shadows))
 
+(define-obsolete-function-alias 'find-emacs-lisp-shadows
+  'load-path-shadows-find "23.3")
+
 ;; Return true if neither file exists, or if both exist and have identical
 ;; contents.
-(defun shadow-same-file-or-nonexistent (f1 f2)
+(defun load-path-shadows-same-file-or-nonexistent (f1 f2)
   (let ((exists1 (file-exists-p f1))
 	(exists2 (file-exists-p f2)))
     (or (and (not exists1) (not exists2))
@@ -193,7 +199,7 @@
 considered to shadow a later file XXX.el, and vice-versa.
 
 Shadowings are located by calling the (non-interactive) companion
-function, `find-emacs-lisp-shadows'."
+function, `load-path-shadows-find'."
   (interactive)
   (let* ((path (copy-sequence load-path))
 	(tem path)
@@ -217,7 +223,7 @@
 		  (setq tem nil)))
 	    (setq tem (cdr tem)))))
 
-    (let* ((shadows (find-emacs-lisp-shadows path))
+    (let* ((shadows (load-path-shadows-find path))
 	   (n (/ (length shadows) 2))
 	   (msg (format "%s Emacs Lisp load-path shadowing%s found"
 			(if (zerop n) "No" (concat "\n" (number-to-string n)))
--- a/lisp/erc/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/erc/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,7 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* erc-xdcc.el (erc-xdcc-help-text): Fix typo in docstring.
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/lisp/erc/erc-xdcc.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/erc/erc-xdcc.el	Wed Oct 13 22:40:51 2010 +0900
@@ -56,7 +56,7 @@
      (erc-current-nick) " XDCC send #\" to get a particular file number."))
   "*Help text sent in response to XDCC help command.
 A list of messages, each consisting of strings and expressions, expressions
-being evaluated and should return stings."
+being evaluated and should return strings."
   :group 'erc-dcc
   :type '(repeat (repeat :tag "Message" (choice string sexp))))
 
--- a/lisp/files.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/files.el	Wed Oct 13 22:40:51 2010 +0900
@@ -66,9 +66,9 @@
 via absolute symbolic links.  Make TO the name of the link, and FROM
 the name it is linked to."
   :type '(repeat (cons :format "%v"
-		       :value ("" . "")
+		       :value ("\\`" . "")
 		       (regexp :tag "From")
-		       (regexp :tag "To")))
+		       (string :tag "To")))
   :group 'abbrev
   :group 'find-file)
 
--- a/lisp/font-lock.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/font-lock.el	Wed Oct 13 22:40:51 2010 +0900
@@ -560,6 +560,8 @@
 we recommend setting `syntax-begin-function' instead.
 
 This is normally set via `font-lock-defaults'.")
+(make-obsolete-variable 'font-lock-beginning-of-syntax-function
+                        'syntax-begin-function "23.3")
 
 (defvar font-lock-mark-block-function nil
   "*Non-nil means use this function to mark a block of text.
--- a/lisp/gnus/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/gnus/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,12 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* nnmail.el (nnmail-fancy-expiry-targets): Fix typo in docstring.
+
+2010-09-21  Glenn Morris  <rgm@gnu.org>
+
+	* message.el (message-output): Use gnus-output-to-rmail if a buffer is
+	visiting the fcc file in rmail-mode.
+
 2010-04-22  Andreas Seltenreich  <seltenreich@gmx.de>
 
 	* message.el (message-generate-headers): Record insertion of optional
--- a/lisp/gnus/ChangeLog.2	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/gnus/ChangeLog.2	Wed Oct 13 22:40:51 2010 +0900
@@ -2603,7 +2603,7 @@
 
 	* message.el (message-use-idna): Use mm-coding-system-p.
 	(message-tokenize-header, message-make-organization)
-	(message-make-from):  Use with-temp-buffer.
+	(message-make-from): Use with-temp-buffer.
 	(message-set-work-buffer): Deleted.
 	(message-fill-paragraph): Use `if' not `and' for compiler warning.
 	(message-check-news-header-syntax): Remove useless lambda.
@@ -5550,7 +5550,7 @@
 
 	* gnus-audio.el (gnus-audio-au-player): Use executable-find.
 
-2003-01-13  Jhair Tocancipa Triana  <jhair_tocancipa@@gmx.net>
+2003-01-13  Jhair Tocancipa Triana  <jhair_tocancipa@gmx.net>
 
 	* gnus-audio.el (gnus-audio-au-player, gnus-audio-wav-player): Use
 	  /usr/bin/play as default player.
@@ -5643,7 +5643,7 @@
 
 2003-01-12  Raymond Scholz  <ray-2003@zonix.de>
 
-	* gnus-msg.el (gnus-confirm-mail-reply-to-news):  May be a
+	* gnus-msg.el (gnus-confirm-mail-reply-to-news): May be a
 	regexp or a function too.
 	(gnus-confirm-treat-mail-like-news): New variable.  Ask for
 	confirmation even if the original article is mail.
@@ -12167,7 +12167,7 @@
 2001-12-05 12:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
 	* gnus-group.el (gnus-group-find-new-groups): Fix doc.
-	From:  Stefan Monnier  <monnier@cs.yale.edu>
+	From: Stefan Monnier  <monnier@cs.yale.edu>
 
 2001-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
@@ -14682,7 +14682,7 @@
 	* gnus-eform.el (gnus-edit-form-done): Return nil if end-of-file.
 
 2001-07-16 12:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
-	From:  Stefan Monnier  <monnier@cs.yale.edu>
+	From: Stefan Monnier  <monnier@cs.yale.edu>
 
 	* message.el (message-mode): Use define-derived-mode.
 	(message-tab): message-completion-alist.
@@ -16855,7 +16855,7 @@
 
 	* gnus-msg.el (gnus-summary-mail-forward): ???
 
-	* message.el (message-forward):  Move mime-to-mml here.
+	* message.el (message-forward): Move mime-to-mml here.
 
 2000-12-20 02:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
@@ -17157,7 +17157,7 @@
 
 	* nnheader.el: Wrap subst-char-in-string def in eval-and-compile.
 	Put some defvars in eval-when-compile.
-	(gnus-intersection, gnus-sorted-complement):  Autoload.
+	(gnus-intersection, gnus-sorted-complement): Autoload.
 
 	* imap.el (imap-point-at-eol): New, replacing gnus-point-at-eol.
 
@@ -17329,7 +17329,7 @@
 
 	* qp.el (mm-decode-coding-region, mm-encode-coding-region):
 	Autoload.
-	(quoted-printable-decode-region):  Rename arg which confused
+	(quoted-printable-decode-region): Rename arg which confused
 	charset with coding-system.  Don't use nonascii-insert-offset.
 	Coding-system encode the region initially.  Don't recognize `=='
 	as valid QP.  Coding-system decode the region finally.
@@ -17384,7 +17384,7 @@
 
 2000-09-29  Gerd Moellmann  <gerd@gnu.org>
 
-	* smiley-ems.el (smiley-update-cache):  Use `:ascent center'.
+	* smiley-ems.el (smiley-update-cache): Use `:ascent center'.
 
 2000-09-21  Dave Love  <fx@gnu.org>
 
@@ -18036,7 +18036,7 @@
 	* gnus-art.el (gnus-mime-display-part): Show MIME security button.
 	(gnus-insert-mime-security-button): New function.
 	* mm-decode.el (mm-possibly-verify-or-decrypt): Add security info.
-	* mml2015.el:  Add security info when verify or decrypt.
+	* mml2015.el: Add security info when verify or decrypt.
 	* mm-uu.el (mm-uu-pgp-signed-extract): Use multipart.
 	(mm-uu-pgp-encrypted-extract): Ditto.
 
@@ -18433,7 +18433,7 @@
 	(mm-dissect-multipart): Use it.
 	* mml2015.el (mml2015-fix-micalg): New function.
 	(mml2015-decrypt): Use new interface.
-	(mml2015-verify):  Use new interface.
+	(mml2015-verify): Use new interface.
 	(mml2015-setup): Make it bogus.
 
 2000-10-28 16:54:45  ShengHuo ZHU  <zsh@cs.rochester.edu>
--- a/lisp/gnus/ecomplete.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/gnus/ecomplete.el	Wed Oct 13 22:40:51 2010 +0900
@@ -147,7 +147,7 @@
     (save-restriction
       (narrow-to-region (point) (point-at-eol))
       (while (not (eobp))
-	;; Put the 'region face on any charactes on this line that
+	;; Put the 'region face on any characters on this line that
 	;; aren't already highlighted.
 	(unless (get-text-property (point) 'face)
 	  (put-text-property (point) (1+ (point)) 'face 'highlight))
--- a/lisp/gnus/message.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/gnus/message.el	Wed Oct 13 22:40:51 2010 +0900
@@ -5311,8 +5311,14 @@
 
 (defun message-output (filename)
   "Append this article to Unix/babyl mail file FILENAME."
-  (if (and (file-readable-p filename)
-	   (mail-file-babyl-p filename))
+  (if (or (and (file-readable-p filename)
+	       (mail-file-babyl-p filename))
+	  ;; gnus-output-to-mail does the wrong thing with live, mbox
+	  ;; Rmail buffers in Emacs 23.
+	  ;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597255
+	  (let ((buff (find-buffer-visiting filename)))
+	    (and buff (with-current-buffer buff
+			(eq major-mode 'rmail-mode)))))
       (gnus-output-to-rmail filename t)
     (gnus-output-to-mail filename t)))
 
--- a/lisp/gnus/nnmail.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/gnus/nnmail.el	Wed Oct 13 22:40:51 2010 +0900
@@ -225,7 +225,7 @@
 
 In this case, articles containing the string \"boss\" in the To or the
 From header will be expired to the group \"nnfolder:Work\";
-articles containing the sting \"IMPORTANT\" in the Subject header will
+articles containing the string \"IMPORTANT\" in the Subject header will
 be expired to the group \"nnfolder:IMPORTANT.YYYY.MMM\"; and
 everything else will be expired to \"nnfolder:Archive-YYYY\"."
   :version "22.1"
--- a/lisp/hi-lock.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/hi-lock.el	Wed Oct 13 22:40:51 2010 +0900
@@ -564,23 +564,15 @@
            'face-name-history
 	   (cdr hi-lock-face-defaults))))
 
-(defvar hi-lock--inhibit-font-lock-hook nil
-  "Inhibit the action of `hi-lock-font-lock-hook'.
-This is used by `hi-lock-set-pattern'.")
-
 (defun hi-lock-set-pattern (regexp face)
   "Highlight REGEXP with face FACE."
-  (let ((pattern (list regexp (list 0 (list 'quote face) t)))
-	;; The call to `font-lock-add-keywords' below might disable
-	;; and re-enable font-lock mode.  If so, we don't want
-	;; `hi-lock-font-lock-hook' to run.  This can be removed once
-	;; Bug#635 is fixed. -- cyd
-	(hi-lock--inhibit-font-lock-hook t))
+  (let ((pattern (list regexp (list 0 (list 'quote face) t))))
     (unless (member pattern hi-lock-interactive-patterns)
-      (font-lock-add-keywords nil (list pattern) t)
       (push pattern hi-lock-interactive-patterns)
       (if font-lock-fontified
-          (font-lock-fontify-buffer)
+	  (progn
+	    (font-lock-add-keywords nil (list pattern) t)
+	    (font-lock-fontify-buffer))
         (let* ((serial (hi-lock-string-serialize regexp))
                (range-min (- (point) (/ hi-lock-highlight-range 2)))
                (range-max (+ (point) (/ hi-lock-highlight-range 2)))
@@ -641,12 +633,9 @@
 
 (defun hi-lock-font-lock-hook ()
   "Add hi-lock patterns to font-lock's."
-  (unless hi-lock--inhibit-font-lock-hook
-    (if font-lock-mode
-	(progn
-	  (font-lock-add-keywords nil hi-lock-file-patterns t)
-	  (font-lock-add-keywords nil hi-lock-interactive-patterns t))
-      (hi-lock-mode -1))))
+  (when font-lock-fontified
+    (font-lock-add-keywords nil hi-lock-file-patterns t)
+    (font-lock-add-keywords nil hi-lock-interactive-patterns t)))
 
 (defvar hi-lock-string-serialize-hash
   (make-hash-table :test 'equal)
--- a/lisp/international/ccl.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/ccl.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1437,7 +1437,7 @@
 	;; Normal arithmethic operators (same meaning as C code).
 	+ | - | * | / | %
 
-	;; Bitwize operators (same meaning as C code)
+	;; Bitwise operators (same meaning as C code)
 	| & | `|' | ^
 
 	;; Shifting operators (same meaning as C code)
--- a/lisp/international/fontset.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/fontset.el	Wed Oct 13 22:40:51 2010 +0900
@@ -700,7 +700,7 @@
 ;; "HP-Hebrew8"                                    [36]
 ;;         HPHEBREW8 8-bit character set
 ;; "HP-Japanese15"                                 [36]
-;;         HPJAPAN15 15-bit characer set,
+;;         HPJAPAN15 15-bit character set,
 ;;         modified from industry defacto
 ;;         standard Shift-JIS
 ;; "HP-Kana8"                                      [36]
--- a/lisp/international/mule-cmds.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/mule-cmds.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1953,7 +1953,7 @@
 		     (> (aref (number-to-string (nth 2 (x-server-version))) 0)
 			?3))
 	  ;; Make non-line-break space display as a plain space.
-	  (aset standard-display-table 160 [32]))
+	  (aset standard-display-table (unibyte-char-to-multibyte 160) [32]))
 	;; Most Windows programs send out apostrophes as \222.  Most X fonts
 	;; don't contain a character at that position.  Map it to the ASCII
 	;; apostrophe.  [This is actually RIGHT SINGLE QUOTATION MARK,
@@ -1961,7 +1961,7 @@
 	;; fonts probably have the appropriate glyph at this position,
 	;; so they could use standard-display-8bit.  It's better to use a
 	;; proper windows-1252 coding system.  --fx]
-	(aset standard-display-table 146 [39]))))
+	(aset standard-display-table (unibyte-char-to-multibyte 146) [39]))))
 
 (defun set-language-environment-coding-systems (language-name)
   "Do various coding system setups for language environment LANGUAGE-NAME."
--- a/lisp/international/mule-diag.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/mule-diag.el	Wed Oct 13 22:40:51 2010 +0900
@@ -368,7 +368,8 @@
 	  (when val
 	    (if (cadr elt) (insert (cadr elt)))
 	    (if (nth 2 elt)
-		(insert (funcall (nth 2 elt) val)))
+		(let ((print-length 10) (print-level 2))
+		  (princ (funcall (nth 2 elt) val) (current-buffer))))
 	    (insert ?\n)))))))
 
 ;;; CODING-SYSTEM
--- a/lisp/international/mule.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/mule.el	Wed Oct 13 22:40:51 2010 +0900
@@ -642,18 +642,19 @@
 
 VALUE must be a function to call after some text is inserted and
 decoded by the coding system itself and before any functions in
-`after-insert-functions' are called.  The arguments to this function
-are the same as those of a function in `after-insert-file-functions',
-i.e. LENGTH of the text to be decoded with point at the head of it,
-and the function should leave point unchanged.
+`after-insert-functions' are called.  This function is passed one
+argument; the number of characters in the text to convert, with
+point at the start of the text.  The function should leave point
+the same, and return the new character count.
 
 `:pre-write-conversion'
 
 VALUE must be a function to call after all functions in
-`write-region-annotate-functions' and `buffer-file-format' are called,
-and before the text is encoded by the coding system itself.  The
-arguments to this function are the same as those of a function in
-`write-region-annotate-functions'.
+`write-region-annotate-functions' and `buffer-file-format' are
+called, and before the text is encoded by the coding system
+itself.  This function should convert the whole text in the
+current buffer.  For backward compatibility, this function is
+passed two arguments which can be ignored.
 
 `:default-char'
 
--- a/lisp/international/titdic-cnv.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/international/titdic-cnv.el	Wed Oct 13 22:40:51 2010 +0900
@@ -108,7 +108,7 @@
 input method `chinese-qj'.")
 
     ("chinese-ecdict" "$(05CKH(B"
-"In this input method, you enter a Chinese (Big5) charactere or word
+"In this input method, you enter a Chinese (Big5) character or word
 by typing the corresponding English word.  For example, if you type
 \"computer\", \"$(0IZH+(B\" is input.
 
--- a/lisp/isearch.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/isearch.el	Wed Oct 13 22:40:51 2010 +0900
@@ -271,30 +271,37 @@
   :group 'isearch
   :group 'matching)
 
+(define-obsolete-variable-alias 'isearch-lazy-highlight-cleanup
+                                'lazy-highlight-cleanup
+                                "22.1")
+
 (defcustom lazy-highlight-cleanup t
   "Controls whether to remove extra highlighting after a search.
 If this is nil, extra highlighting can be \"manually\" removed with
 \\[lazy-highlight-cleanup]."
   :type 'boolean
   :group 'lazy-highlight)
-(define-obsolete-variable-alias 'isearch-lazy-highlight-cleanup
-                                'lazy-highlight-cleanup
+
+(define-obsolete-variable-alias 'isearch-lazy-highlight-initial-delay
+                                'lazy-highlight-initial-delay
                                 "22.1")
 
 (defcustom lazy-highlight-initial-delay 0.25
   "Seconds to wait before beginning to lazily highlight all matches."
   :type 'number
   :group 'lazy-highlight)
-(define-obsolete-variable-alias 'isearch-lazy-highlight-initial-delay
-                                'lazy-highlight-initial-delay
+
+(define-obsolete-variable-alias 'isearch-lazy-highlight-interval
+                                'lazy-highlight-interval
                                 "22.1")
 
 (defcustom lazy-highlight-interval 0 ; 0.0625
   "Seconds between lazily highlighting successive matches."
   :type 'number
   :group 'lazy-highlight)
-(define-obsolete-variable-alias 'isearch-lazy-highlight-interval
-                                'lazy-highlight-interval
+
+(define-obsolete-variable-alias 'isearch-lazy-highlight-max-at-a-time
+                                'lazy-highlight-max-at-a-time
                                 "22.1")
 
 (defcustom lazy-highlight-max-at-a-time 20
@@ -305,9 +312,6 @@
   :type '(choice (const :tag "All" nil)
 		 (integer :tag "Some"))
   :group 'lazy-highlight)
-(define-obsolete-variable-alias 'isearch-lazy-highlight-max-at-a-time
-                                'lazy-highlight-max-at-a-time
-                                "22.1")
 
 (defface lazy-highlight
   '((((class color) (min-colors 88) (background light))
@@ -323,10 +327,10 @@
   :group 'lazy-highlight
   :group 'basic-faces)
 (define-obsolete-face-alias 'isearch-lazy-highlight-face 'lazy-highlight "22.1")
-(defvar lazy-highlight-face 'lazy-highlight)
 (define-obsolete-variable-alias 'isearch-lazy-highlight-face
                                 'lazy-highlight-face
                                 "22.1")
+(defvar lazy-highlight-face 'lazy-highlight)
 
 ;; Define isearch help map.
 
--- a/lisp/ls-lisp.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/ls-lisp.el	Wed Oct 13 22:40:51 2010 +0900
@@ -621,7 +621,7 @@
 	    ;; They tend to be bogus on non-UNIX platforms anyway so
 	    ;; optionally hide them.
 	    (if (memq 'uid ls-lisp-verbosity)
-		;; uid can be a sting or an integer
+		;; uid can be a string or an integer
 		(let ((uid (nth 2 file-attr)))
                   (format (if (stringp uid)
 			      ls-lisp-uid-s-fmt
--- a/lisp/mail/emacsbug.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/mail/emacsbug.el	Wed Oct 13 22:40:51 2010 +0900
@@ -134,11 +134,11 @@
         (overlay-put (make-overlay pos (point)) 'face 'highlight))
       (insert " if possible, because the Emacs maintainers
 usually do not have translators to read other languages for them.\n\n")
-      (insert (format "Your bug report will be posted to the %s mailing list"
+      (insert (format "Your report will be posted to the %s mailing list"
 		      reporting-address))
       ;; Nowadays all bug reports end up there.
 ;;;      (if pretest-p (insert ".\n\n")
-	(insert ",\nand to the gnu.emacs.bug news group.\n\n"))
+	(insert "\nand the gnu.emacs.bug news group, and at http://debbugs.gnu.org.\n\n"))
 
     (insert "Please describe exactly what actions triggered the bug\n"
 	    "and the precise symptoms of the bug.  If you can, give\n"
@@ -337,5 +337,4 @@
 
 (provide 'emacsbug)
 
-;; arch-tag: 248b6523-c3b5-4fec-9a3f-0411fafa7d49
 ;;; emacsbug.el ends here
--- a/lisp/mail/mail-utils.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/mail/mail-utils.el	Wed Oct 13 22:40:51 2010 +0900
@@ -401,6 +401,7 @@
   (let ((from (or (mail-fetch-field "from")
 		  (mail-fetch-field "really-from")
 		  (mail-fetch-field "sender")
+		  (mail-fetch-field "return-path")
 		  "unknown"))
 	(date (mail-fetch-field "date")))
     (format "From %s %s\n" (mail-strip-quoted-names from)
@@ -411,5 +412,4 @@
 
 (provide 'mail-utils)
 
-;; arch-tag: b24aec2f-fd65-4ceb-9e39-3cc2827036fd
 ;;; mail-utils.el ends here
--- a/lisp/man.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/man.el	Wed Oct 13 22:40:51 2010 +0900
@@ -309,7 +309,7 @@
   "Regular expression describing references to normal files.")
 
 ;; This includes the section as an optional part to catch hyphenated
-;; refernces to manpages.
+;; references to manpages.
 (defvar Man-hyphenated-reference-regexp
   (concat "\\(" Man-name-regexp "\\)\\((\\(" Man-section-regexp "\\))\\)?")
   "Regular expression describing a reference in the SEE ALSO section.")
--- a/lisp/menu-bar.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/menu-bar.el	Wed Oct 13 22:40:51 2010 +0900
@@ -674,13 +674,23 @@
     ;; put on a customized-value property.
     (dolist (elt '(line-number-mode column-number-mode size-indication-mode
 		   cua-mode show-paren-mode transient-mark-mode
-		   blink-cursor-mode display-time-mode display-battery-mode))
+		   blink-cursor-mode display-time-mode display-battery-mode
+		   ;; These are set by other functions that don't set
+		   ;; the customized state.  Having them here has the
+		   ;; side-effect that turning them off via X
+		   ;; resources acts like having customized them, but
+		   ;; that seems harmless.
+		   menu-bar-mode tool-bar-mode))
+      ;; FIXME ? It's a little annoying that running this command
+      ;; always loads cua-base, paren, time, and battery, even if they
+      ;; have not been customized in any way.  (Due to custom-load-symbol.)
       (and (customize-mark-to-save elt)
 	   (setq need-save t)))
     ;; These are set with `customize-set-variable'.
     (dolist (elt '(scroll-bar-mode
 		   debug-on-quit debug-on-error
-		   tooltip-mode menu-bar-mode tool-bar-mode
+		   ;; Somehow this works, when tool-bar and menu-bar don't.
+		   tooltip-mode
 		   save-place uniquify-buffer-name-style fringe-mode
 		   indicate-empty-lines indicate-buffer-boundaries
 		   case-fold-search font-use-system-font
@@ -1923,15 +1933,6 @@
     `(menu-item ,(purecopy "Previous History Item") previous-history-element
 		:help ,(purecopy "Put previous minibuffer history element in the minibuffer"))))
 
-;;;###autoload
-;; This comment is taken from tool-bar.el near
-;; (put 'tool-bar-mode ...)
-;; We want to pretend the menu bar by standard is on, as this will make
-;; customize consider disabling the menu bar a customization, and save
-;; that.  We could do this for real by setting :init-value below, but
-;; that would overwrite disabling the tool bar from X resources.
-(put 'menu-bar-mode 'standard-value '(t))
-
 (define-minor-mode menu-bar-mode
   "Toggle display of a menu bar on each frame.
 This command applies to all frames that exist and frames to be
@@ -1954,6 +1955,16 @@
 			 "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear."))
   menu-bar-mode)
 
+;;;###autoload
+;; (This does not work right unless it comes after the above definition.)
+;; This comment is taken from tool-bar.el near
+;; (put 'tool-bar-mode ...)
+;; We want to pretend the menu bar by standard is on, as this will make
+;; customize consider disabling the menu bar a customization, and save
+;; that.  We could do this for real by setting :init-value above, but
+;; that would overwrite disabling the menu bar from X resources.
+(put 'menu-bar-mode 'standard-value '(t))
+
 (defun toggle-menu-bar-mode-from-frame (&optional arg)
   "Toggle menu bar on or off, based on the status of the current frame.
 See `menu-bar-mode' for more information."
--- a/lisp/mh-e/ChangeLog.1	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/mh-e/ChangeLog.1	Wed Oct 13 22:40:51 2010 +0900
@@ -794,7 +794,7 @@
 
 	Merged in 7.4.4 changes, described below.
 
-	* mh-e.el (Version, mh-version):  Set to 7.4.4+cvs.
+	* mh-e.el (Version, mh-version): Set to 7.4.4+cvs.
 
 2004-07-10  Bill Wohler  <wohler@newt.com>
 
@@ -2197,7 +2197,7 @@
 	* mh-comp.el (mh-extract-rejected-mail, mh-letter-mode-message):
 	Ditto.
 
-	* mh-e.el (mh-refile-a-msg):  Ditto.
+	* mh-e.el (mh-refile-a-msg): Ditto.
 
 	* mh-funcs.el (mh-undo-folder): Ditto.
 
@@ -2509,7 +2509,7 @@
 
 2003-07-28  Peter S Galbraith  <psg@debian.org>
 
-	* mh-comp.el (mh-insert-letter):  Remove `mh-visible-headers'
+	* mh-comp.el (mh-insert-letter): Remove `mh-visible-headers'
 	operation.
 
 	* mh-mime.el (mh-mm-inline-message): Same.
@@ -2697,7 +2697,7 @@
 
 2003-06-24  Bill Wohler  <wohler@newt.com>
 
-	* mh-e.el (Version, mh-version):  Set to 7.4.1+cvs.
+	* mh-e.el (Version, mh-version): Set to 7.4.1+cvs.
 
 2003-06-25  Bill Wohler  <wohler@newt.com>
 
@@ -2719,7 +2719,7 @@
 
 2003-06-24  Bill Wohler  <wohler@newt.com>
 
-	* mh-e.el (Version, mh-version):  Set to 7.4+cvs.
+	* mh-e.el (Version, mh-version): Set to 7.4+cvs.
 
 2003-06-24  Bill Wohler  <wohler@newt.com>
 
@@ -4106,7 +4106,7 @@
 
 2003-04-06  Bill Wohler  <wohler@newt.com>
 
-	* mh-comp.el (mh-forward):  Updated docstrings to indicate that a
+	* mh-comp.el (mh-forward): Updated docstrings to indicate that a
 	list of messages is acceptable as well.
 
 	* mh-e.el (mh-delete-msg, mh-delete-msg-no-motion, mh-refile-msg)
@@ -4198,7 +4198,7 @@
 
 2003-04-04  Peter S Galbraith  <psg@debian.org>
 
-	* mh-e.el (mh-folder-from-address):  Minor Fix.  Wrong ending of
+	* mh-e.el (mh-folder-from-address): Minor Fix.  Wrong ending of
 	`when' block.
 
 2003-04-04  Satyaki Das  <satyaki@theforce.stanford.edu>
@@ -7248,7 +7248,7 @@
 
 2002-11-13  Mark D. Baushke  <mdb@gnu.org>
 
-	* mh-identity.el (mh-insert-identity):  A value of either nil or
+	* mh-identity.el (mh-insert-identity): A value of either nil or
 	"" should cause the field to be removed.
 	(mh-identity-list): Update the docstring.
 
@@ -7913,7 +7913,7 @@
 	(mh-folder-font-lock-subject): Adapt to new mh-scan-subject-regexp.
 	* mh-seq.el (mh-subject-to-sequence): Ditto.
 
-	* mh-e.el (mh-folder-sequence-menu):  Remove "Toggle Subject
+	* mh-e.el (mh-folder-sequence-menu): Remove "Toggle Subject
 	Thread" from menu.   mh-toggle-threads is in the Folder menu.
 
 	* mh-e.el (mh-folder-sequence-menu): Minor menu text edits.
@@ -8252,7 +8252,7 @@
 	(mh-thread-generate-scan-lines): Renamed dupl-p as dupl-flag.
 	This addresses part of SF #627015.
 
-	* mh-index.el (mh-index-advance):  Renamed backward-p
+	* mh-index.el (mh-index-advance): Renamed backward-p
 	local variable as backward-flag.
 	(mh-index-next-button): Renamed backward-p
 	argument as backward-flag.
@@ -9220,7 +9220,7 @@
 	decide how many buttons to use for replying.
 
 	* mh-mime.el (mh-file-mime-type-substitutions)
-	(mh-file-mime-type-substitute):  Fix typos and doc strings.
+	(mh-file-mime-type-substitute): Fix typos and doc strings.
 
 2002-09-30  Peter S Galbraith  <psg@debian.org>
 
@@ -9325,7 +9325,7 @@
 2002-08-19  Peter S Galbraith  <psg@debian.org>
 
 	* reply-to.xpm, reply-to.pbm, reply-from.xpm, reply-from.pbm,
-	* reply-all.xpm, reply-all.pbm:  New icons for various reply methods.
+	* reply-all.xpm, reply-all.pbm: New icons for various reply methods.
 	* mh-e.el (mh-folder-tool-bar-map): Split reply button into three
 	that won't prompt for "from", "to" and "all".
 	* mh-comp.el (mh-reply): Put variable reply-to in the interactive
@@ -9764,13 +9764,13 @@
 	to `mh-mml-to-mime' in `mh-send-letter'.
 	(mh-mml-secure-message-sign-pgpmime): New function.
 	Front end to mml-secure-message-sign-pgpmime.
-	(mh-mml-secure-message-encrypt-pgpmime):  New function.
+	(mh-mml-secure-message-encrypt-pgpmime): New function.
 	Front end to mml-secure-message-encrypt-pgpmime.
 
 	* mh-comp.el (mh-send-letter): automatic call to `mh-mml-to-mime'
 	if mh-mml-compose-insert-p is set.
 	(mh-letter-mode-map): Add keys for new mh-mime functions above.
-	* mh-comp.el:  Added autoloads for new mh-mime functions above.
+	* mh-comp.el: Added autoloads for new mh-mime functions above.
 
 2002-06-17  Peter S Galbraith  <psg@debian.org>
 
@@ -11010,8 +11010,8 @@
 2001-11-20  Peter S Galbraith  <psg@debian.org>
 
 	* mh-comp.el (mh-letter-mode): Make font-lock-defaults a local variable
-	* mh-e.el (mh-folder-mode):  Same.
-	* mh-utils.el (mh-show-mode):  Same.
+	* mh-e.el (mh-folder-mode): Same.
+	* mh-utils.el (mh-show-mode): Same.
 
 	* mh-e.el (mh-scan-msg-num-regexp): Delete variable and replace
 	with mh-good-msg-regexp.
--- a/lisp/minibuffer.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/minibuffer.el	Wed Oct 13 22:40:51 2010 +0900
@@ -129,8 +129,8 @@
   "Apply FUN to each element of XS in turn.
 Return the first non-nil returned value.
 Like CL's `some'."
-  (let ((firsterror nil)
-        res)
+  (lexical-let ((firsterror nil)
+		res)
     (while (and (not res) xs)
       (condition-case err
           (setq res (funcall fun (pop xs)))
@@ -475,10 +475,30 @@
 (defun completion--replace (beg end newtext)
   "Replace the buffer text between BEG and END with NEWTEXT.
 Moves point to the end of the new text."
-  ;; This should be in subr.el.
+  ;; Maybe this should be in subr.el.
   ;; You'd think this is trivial to do, but details matter if you want
   ;; to keep markers "at the right place" and be robust in the face of
   ;; after-change-functions that may themselves modify the buffer.
+  (let ((prefix-len 0))
+    ;; Don't touch markers in the shared prefix (if any).
+    (while (and (< prefix-len (length newtext))
+                (< (+ beg prefix-len) end)
+                (eq (char-after (+ beg prefix-len))
+                    (aref newtext prefix-len)))
+      (setq prefix-len (1+ prefix-len)))
+    (unless (zerop prefix-len)
+      (setq beg (+ beg prefix-len))
+      (setq newtext (substring newtext prefix-len))))
+  (let ((suffix-len 0))
+    ;; Don't touch markers in the shared suffix (if any).
+    (while (and (< suffix-len (length newtext))
+                (< beg (- end suffix-len))
+                (eq (char-before (- end suffix-len))
+                    (aref newtext (- (length newtext) suffix-len 1))))
+      (setq suffix-len (1+ suffix-len)))
+    (unless (zerop suffix-len)
+      (setq end (- end suffix-len))
+      (setq newtext (substring newtext 0 (- suffix-len)))))
   (goto-char beg)
   (insert newtext)
   (delete-region (point) (+ (point) (- end beg))))
@@ -498,15 +518,16 @@
  101  5 ??? impossible
  110  6 some completion happened
  111  7 completed to an exact completion"
-  (let* ((beg (field-beginning))
-         (end (field-end))
-         (string (buffer-substring beg end))
-         (comp (funcall (or try-completion-function
-			    'completion-try-completion)
-			string
-			minibuffer-completion-table
-			minibuffer-completion-predicate
-			(- (point) beg))))
+  (lexical-let*
+      ((beg (field-beginning))
+       (end (field-end))
+       (string (buffer-substring beg end))
+       (comp (funcall (or try-completion-function
+			  'completion-try-completion)
+		      string
+		      minibuffer-completion-table
+		      minibuffer-completion-predicate
+		      (- (point) beg))))
     (cond
      ((null comp)
       (minibuffer-hide-completions)
@@ -519,14 +540,15 @@
       ;; `completed' should be t if some completion was done, which doesn't
       ;; include simply changing the case of the entered string.  However,
       ;; for appearance, the string is rewritten if the case changes.
-      (let* ((comp-pos (cdr comp))
-	     (completion (car comp))
-	     (completed (not (eq t (compare-strings completion nil nil
-						    string nil nil t))))
-	     (unchanged (eq t (compare-strings completion nil nil
-					       string nil nil nil))))
+      (lexical-let*
+	  ((comp-pos (cdr comp))
+	   (completion (car comp))
+	   (completed (not (eq t (compare-strings completion nil nil
+						  string nil nil t))))
+	   (unchanged (eq t (compare-strings completion nil nil
+					     string nil nil nil))))
         (if unchanged
-          (goto-char end)
+	    (goto-char end)
           ;; Insert in minibuffer the chars we got.
           (completion--replace beg end completion))
 	;; Move point to its completion-mandated destination.
@@ -673,8 +695,8 @@
  `minibuffer-confirm-exit-commands', and accept the input
  otherwise."
   (interactive)
-  (let ((beg (field-beginning))
-        (end (field-end)))
+  (lexical-let ((beg (field-beginning))
+		(end (field-end)))
     (cond
      ;; Allow user to specify null string
      ((= beg end) (exit-minibuffer))
@@ -1051,13 +1073,13 @@
   "Display a list of possible completions of the current minibuffer contents."
   (interactive)
   (message "Making completion list...")
-  (let* ((start (field-beginning))
-         (string (field-string))
-         (completions (completion-all-completions
-                       string
-                       minibuffer-completion-table
-                       minibuffer-completion-predicate
-                       (- (point) (field-beginning)))))
+  (lexical-let* ((start (field-beginning))
+		 (string (field-string))
+		 (completions (completion-all-completions
+			       string
+			       minibuffer-completion-table
+			       minibuffer-completion-predicate
+			       (- (point) (field-beginning)))))
     (message nil)
     (if (and completions
              (or (consp (cdr completions))
@@ -1687,9 +1709,10 @@
     suffix))
 
 (defun completion-basic-try-completion (string table pred point)
-  (let* ((beforepoint (substring string 0 point))
-         (afterpoint (substring string point))
-         (bounds (completion-boundaries beforepoint table pred afterpoint)))
+  (lexical-let*
+      ((beforepoint (substring string 0 point))
+       (afterpoint (substring string point))
+       (bounds (completion-boundaries beforepoint table pred afterpoint)))
     (if (zerop (cdr bounds))
         ;; `try-completion' may return a subtly different result
         ;; than `all+merge', so try to use it whenever possible.
@@ -1700,28 +1723,30 @@
              (concat completion
                      (completion--merge-suffix completion point afterpoint))
              (length completion))))
-      (let* ((suffix (substring afterpoint (cdr bounds)))
-             (prefix (substring beforepoint 0 (car bounds)))
-             (pattern (delete
-                       "" (list (substring beforepoint (car bounds))
-                                'point
-                                (substring afterpoint 0 (cdr bounds)))))
-             (all (completion-pcm--all-completions prefix pattern table pred)))
+      (lexical-let*
+	  ((suffix (substring afterpoint (cdr bounds)))
+	   (prefix (substring beforepoint 0 (car bounds)))
+	   (pattern (delete
+		     "" (list (substring beforepoint (car bounds))
+			      'point
+			      (substring afterpoint 0 (cdr bounds)))))
+	   (all (completion-pcm--all-completions prefix pattern table pred)))
         (if minibuffer-completing-file-name
             (setq all (completion-pcm--filename-try-filter all)))
         (completion-pcm--merge-try pattern all prefix suffix)))))
 
 (defun completion-basic-all-completions (string table pred point)
-  (let* ((beforepoint (substring string 0 point))
-         (afterpoint (substring string point))
-         (bounds (completion-boundaries beforepoint table pred afterpoint))
-         (suffix (substring afterpoint (cdr bounds)))
-         (prefix (substring beforepoint 0 (car bounds)))
-         (pattern (delete
-                   "" (list (substring beforepoint (car bounds))
-                            'point
-                            (substring afterpoint 0 (cdr bounds)))))
-         (all (completion-pcm--all-completions prefix pattern table pred)))
+  (lexical-let*
+      ((beforepoint (substring string 0 point))
+       (afterpoint (substring string point))
+       (bounds (completion-boundaries beforepoint table pred afterpoint))
+       (suffix (substring afterpoint (cdr bounds)))
+       (prefix (substring beforepoint 0 (car bounds)))
+       (pattern (delete
+		 "" (list (substring beforepoint (car bounds))
+			  'point
+			  (substring afterpoint 0 (cdr bounds)))))
+       (all (completion-pcm--all-completions prefix pattern table pred)))
     (completion-hilit-commonality all point (car bounds))))
 
 ;;; Partial-completion-mode style completion.
@@ -1876,12 +1901,13 @@
 FILTER is a function applied to the return value, that can be used, e.g. to
 filter out additional entries (because TABLE migth not obey PRED)."
   (unless filter (setq filter 'identity))
-  (let* ((beforepoint (substring string 0 point))
-         (afterpoint (substring string point))
-         (bounds (completion-boundaries beforepoint table pred afterpoint))
-         (prefix (substring beforepoint 0 (car bounds)))
-         (suffix (substring afterpoint (cdr bounds)))
-         firsterror)
+  (lexical-let*
+      ((beforepoint (substring string 0 point))
+       (afterpoint (substring string point))
+       (bounds (completion-boundaries beforepoint table pred afterpoint))
+       (prefix (substring beforepoint 0 (car bounds)))
+       (suffix (substring afterpoint (cdr bounds)))
+       firsterror)
     (setq string (substring string (car bounds) (+ point (cdr bounds))))
     (let* ((relpoint (- point (car bounds)))
            (pattern (completion-pcm--string->pattern string relpoint))
--- a/lisp/net/net-utils.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/net/net-utils.el	Wed Oct 13 22:40:51 2010 +0900
@@ -99,6 +99,9 @@
   :group 'net-utils
   :type  'string)
 
+(define-obsolete-variable-alias 'ipconfig-program-options
+  'ifconfig-program-options "22.2")
+
 (defcustom ifconfig-program-options
   (list
    (if (eq system-type 'windows-nt)
@@ -113,9 +116,6 @@
   :type 'string
   :version "23.1")
 
-(define-obsolete-variable-alias 'ipconfig-program-options
-  'ifconfig-program-options "22.2")
-
 (defcustom iwconfig-program-options nil
  "Options for the iwconfig program."
  :group 'net-utils
--- a/lisp/newcomment.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/newcomment.el	Wed Oct 13 22:40:51 2010 +0900
@@ -318,7 +318,8 @@
 		   "+\\)[ \t]*")))
     (unless (and comment-end-skip
 		 ;; In case comment-end has changed since last time.
-		 (string-match comment-end-skip comment-end))
+		 (string-match comment-end-skip
+                               (if (string= "" comment-end) "\n" comment-end)))
       (let ((ce (if (string= "" comment-end) "\n"
 		  (comment-string-strip comment-end t t))))
 	(set (make-local-variable 'comment-end-skip)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/obsolete/cl-compat.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,201 @@
+;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
+
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010  Free Software Foundation, Inc.
+
+;; Author: Dave Gillespie <daveg@synaptics.com>
+;; Version: 2.02
+;; Keywords: extensions
+;; Obsolete-since: 23.3
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file has been obsolete since Emacs 23.3.
+
+;; These are extensions to Emacs Lisp that provide a degree of
+;; Common Lisp compatibility, beyond what is already built-in
+;; in Emacs Lisp.
+;;
+;; This package was written by Dave Gillespie; it is a complete
+;; rewrite of Cesar Quiroz's original cl.el package of December 1986.
+;;
+;; This package works with Emacs 18, Emacs 19, and Lucid Emacs 19.
+;;
+;; Bug reports, comments, and suggestions are welcome!
+
+;; This file contains emulations of internal routines of the older
+;; CL package which users may have called directly from their code.
+;; Use (require 'cl-compat) to get these routines.
+
+;; See cl.el for Change Log.
+
+
+;;; Code:
+
+;; This used to be:
+;; (or (featurep 'cl) (require 'cl))
+;; which just has the effect of fooling the byte-compiler into not
+;; loading cl when compiling.  However, that leads to some bogus
+;; compiler warnings.  Loading cl when compiling cannot do any harm,
+;; because for a long time bootstrap-emacs contained 'cl, due to being
+;; dumped from uncompiled files that eval-when-compile'd cl.  So every
+;; file was compiled with 'cl loaded.
+(require 'cl)
+
+
+;;; Keyword routines not supported by new package.
+
+(defmacro defkeyword (x &optional doc)
+  (list* 'defconst x (list 'quote x) (and doc (list doc))))
+
+(defun keyword-of (sym)
+  (or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
+
+
+;;; Multiple values.  Note that the new package uses a different
+;;; convention for multiple values.  The following definitions
+;;; emulate the old convention; all function names have been changed
+;;; by capitalizing the first letter: Values, Multiple-value-*,
+;;; to avoid conflict with the new-style definitions in cl-macs.
+
+(put 'Multiple-value-bind  'lisp-indent-function 2)
+(put 'Multiple-value-setq  'lisp-indent-function 2)
+(put 'Multiple-value-call  'lisp-indent-function 1)
+(put 'Multiple-value-prog1 'lisp-indent-function 1)
+
+(defvar *mvalues-values* nil)
+
+(defun Values (&rest val-forms)
+  (setq *mvalues-values* val-forms)
+  (car val-forms))
+
+(defun Values-list (val-forms)
+  (apply 'values val-forms))
+
+(defmacro Multiple-value-list (form)
+  (list 'let* (list '(*mvalues-values* nil) (list '*mvalues-temp* form))
+	'(or (and (eq *mvalues-temp* (car *mvalues-values*)) *mvalues-values*)
+	     (list *mvalues-temp*))))
+
+(defmacro Multiple-value-call (function &rest args)
+  (list 'apply function
+	(cons 'append
+	      (mapcar (function (lambda (x) (list 'Multiple-value-list x)))
+		      args))))
+
+(defmacro Multiple-value-bind (vars form &rest body)
+  (list* 'multiple-value-bind vars (list 'Multiple-value-list form) body))
+
+(defmacro Multiple-value-setq (vars form)
+  (list 'multiple-value-setq vars (list 'Multiple-value-list form)))
+
+(defmacro Multiple-value-prog1 (form &rest body)
+  (list 'prog1 form (list* 'let '((*mvalues-values* nil)) body)))
+
+
+;;; Routines for parsing keyword arguments.
+
+(defun build-klist (arglist keys &optional allow-others)
+  (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist))))
+    (or allow-others
+	(let ((bad (set-difference (mapcar 'car res) keys)))
+	  (if bad (error "Bad keywords: %s not in %s" bad keys))))
+    res))
+
+(defun extract-from-klist (klist key &optional def)
+  (let ((res (assq key klist))) (if res (cdr res) def)))
+
+(defun keyword-argument-supplied-p (klist key)
+  (assq key klist))
+
+(defun elt-satisfies-test-p (item elt klist)
+  (let ((test-not (cdr (assq ':test-not klist)))
+	(test (cdr (assq ':test klist)))
+	(key (cdr (assq ':key klist))))
+    (if key (setq elt (funcall key elt)))
+    (if test-not (not (funcall test-not item elt))
+      (funcall (or test 'eql) item elt))))
+
+
+;;; Rounding functions with old-style multiple value returns.
+
+(defun cl-floor (a &optional b) (Values-list (floor* a b)))
+(defun cl-ceiling (a &optional b) (Values-list (ceiling* a b)))
+(defun cl-round (a &optional b) (Values-list (round* a b)))
+(defun cl-truncate (a &optional b) (Values-list (truncate* a b)))
+
+(defun safe-idiv (a b)
+  (let* ((q (/ (abs a) (abs b)))
+         (s (* (signum a) (signum b))))
+    (Values q (- a (* s q b)) s)))
+
+
+;; Internal routines.
+
+(defun pair-with-newsyms (oldforms)
+  (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms)))
+    (Values (mapcar* 'list newsyms oldforms) newsyms)))
+
+(defun zip-lists (evens odds)
+  (mapcan 'list evens odds))
+
+(defun unzip-lists (list)
+  (let ((e nil) (o nil))
+    (while list
+      (setq e (cons (car list) e) o (cons (cadr list) o) list (cddr list)))
+    (Values (nreverse e) (nreverse o))))
+
+(defun reassemble-argslists (list)
+  (let ((n (apply 'min (mapcar 'length list))) (res nil))
+    (while (>= (setq n (1- n)) 0)
+      (setq res (cons (mapcar (function (lambda (x) (elt x n))) list) res)))
+    res))
+
+(defun duplicate-symbols-p (list)
+  (let ((res nil))
+    (while list
+      (if (memq (car list) (cdr list)) (setq res (cons (car list) res)))
+      (setq list (cdr list)))
+    res))
+
+
+;;; Setf internals.
+
+(defun setnth (n list x)
+  (setcar (nthcdr n list) x))
+
+(defun setnthcdr (n list x)
+  (setcdr (nthcdr (1- n) list) x))
+
+(defun setelt (seq n x)
+  (if (consp seq) (setcar (nthcdr n seq) x) (aset seq n x)))
+
+
+;;; Functions omitted: case-clausify, check-do-stepforms, check-do-endforms,
+;;; extract-do-inits, extract-do[*]-steps, select-stepping-forms,
+;;; elt-satisfies-if[-not]-p, with-keyword-args, mv-bind-clausify,
+;;; all names with embedded `$'.
+
+
+(provide 'cl-compat)
+
+;; Local variables:
+;; byte-compile-warnings: (not cl-functions)
+;; End:
+
+;;; cl-compat.el ends here
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/obsolete/lmenu.el	Wed Oct 13 22:40:51 2010 +0900
@@ -0,0 +1,445 @@
+;;; lmenu.el --- emulate Lucid's menubar support
+
+;; Copyright (C) 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+;; Keywords: emulations obsolete
+;; Obsolete-since: 23.3
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file has been obsolete since Emacs 23.3.
+
+;;; Code:
+
+
+;; First, emulate the Lucid menubar support in GNU Emacs 19.
+
+;; Arrange to use current-menubar to set up part of the menu bar.
+
+(defvar current-menubar)
+(defvar lucid-menubar-map)
+(defvar lucid-failing-menubar)
+
+(defvar recompute-lucid-menubar 'recompute-lucid-menubar)
+(defun recompute-lucid-menubar ()
+  (define-key lucid-menubar-map [menu-bar]
+    (condition-case nil
+	(make-lucid-menu-keymap "menu-bar" current-menubar)
+      (error (message "Invalid data in current-menubar moved to lucid-failing-menubar")
+	     (sit-for 1)
+	     (setq lucid-failing-menubar current-menubar
+		   current-menubar nil))))
+  (setq lucid-menu-bar-dirty-flag nil))
+
+(defvar lucid-menubar-map (make-sparse-keymap))
+(or (assq 'current-menubar minor-mode-map-alist)
+    (setq minor-mode-map-alist
+	  (cons (cons 'current-menubar lucid-menubar-map)
+		minor-mode-map-alist)))
+
+;; XEmacs compatibility
+(defun set-menubar-dirty-flag ()
+  (force-mode-line-update)
+  (setq lucid-menu-bar-dirty-flag t))
+
+(defvar add-menu-item-count 0)
+
+;; This is a variable whose value is always nil.
+(defvar make-lucid-menu-keymap-disable nil)
+
+;; Return a menu keymap corresponding to a Lucid-style menu list
+;; MENU-ITEMS, and with name MENU-NAME.
+(defun make-lucid-menu-keymap (menu-name menu-items)
+  (let ((menu (make-sparse-keymap menu-name)))
+    ;; Process items in reverse order,
+    ;; since the define-key loop reverses them again.
+    (setq menu-items (reverse menu-items))
+    (while menu-items
+      (let ((item (car menu-items))
+	    command name callback)
+	(cond ((stringp item)
+	       (setq command nil)
+	       (setq name (if (string-match "^-+$" item) "" item)))
+	      ((consp item)
+	       (setq command (make-lucid-menu-keymap (car item) (cdr item)))
+	       (setq name (car item)))
+	      ((vectorp item)
+	       (setq command (make-symbol (format "menu-function-%d"
+						  add-menu-item-count))
+		     add-menu-item-count (1+ add-menu-item-count)
+		     name (aref item 0)
+		     callback (aref item 1))
+	       (if (symbolp callback)
+		   (fset command callback)
+		 (fset command (list 'lambda () '(interactive) callback)))
+	       (put command 'menu-alias t)
+	       (let ((i 2))
+		 (while (< i (length item))
+		   (cond
+		    ((eq (aref item i) ':active)
+		     (put command 'menu-enable
+			  (or (aref item (1+ i))
+			      'make-lucid-menu-keymap-disable))
+		     (setq i (+ 2 i)))
+		    ((eq (aref item i) ':suffix)
+		     ;; unimplemented
+		     (setq i (+ 2 i)))
+		    ((eq (aref item i) ':keys)
+		     ;; unimplemented
+		     (setq i (+ 2 i)))
+		    ((eq (aref item i) ':style)
+		     ;; unimplemented
+		     (setq i (+ 2 i)))
+		    ((eq (aref item i) ':selected)
+		     ;; unimplemented
+		     (setq i (+ 2 i)))
+		    ((and (symbolp (aref item i))
+			  (= ?: (string-to-char (symbol-name (aref item i)))))
+		     (error "Unrecognized menu item keyword: %S"
+			    (aref item i)))
+		    ((= i 2)
+		     ;; old-style format: active-p &optional suffix
+		     (put command 'menu-enable
+			  (or (aref item i) 'make-lucid-menu-keymap-disable))
+		     ;; suffix is unimplemented
+		     (setq i (length item)))
+		    (t
+		     (error "Unexpected menu item value: %S"
+			    (aref item i))))))))
+	(if (null command)
+	    ;; Handle inactive strings specially--allow any number
+	    ;; of identical ones.
+	    (setcdr menu (cons (list nil name) (cdr menu)))
+	  (if name
+	      (define-key menu (vector (intern name)) (cons name command)))))
+      (setq menu-items (cdr menu-items)))
+    menu))
+
+(declare-function x-popup-dialog "xmenu.c" (position contents &optional header))
+
+;; XEmacs compatibility function
+(defun popup-dialog-box (data)
+  "Pop up a dialog box.
+A dialog box description is a list.
+
+ - The first element of the list is a string to display in the dialog box.
+ - The rest of the elements are descriptions of the dialog box's buttons.
+   Each one is a vector of three elements:
+   - The first element is the text of the button.
+   - The second element is the `callback'.
+   - The third element is t or nil, whether this button is selectable.
+
+If the `callback' of a button is a symbol, then it must name a command.
+It will be invoked with `call-interactively'.  If it is a list, then it is
+evaluated with `eval'.
+
+One (and only one) of the buttons may be nil.  This marker means that all
+following buttons should be flushright instead of flushleft.
+
+The syntax, more precisely:
+
+   form		:=  <something to pass to `eval'>
+   command	:=  <a symbol or string, to pass to `call-interactively'>
+   callback 	:=  command | form
+   active-p	:=  <t, nil, or a form to evaluate to decide whether this
+		    button should be selectable>
+   name		:=  <string>
+   partition	:=  'nil'
+   button	:=  '['  name callback active-p ']'
+   dialog	:=  '(' name [ button ]+ [ partition [ button ]+ ] ')'"
+  (let ((name (car data))
+	(tail (cdr data))
+	converted
+	choice meaning)
+    (while tail
+      (if (null (car tail))
+	  (setq converted (cons nil converted))
+	(let ((item (aref (car tail) 0))
+	      (callback (aref (car tail) 1))
+	      (enable (aref (car tail) 2)))
+	  (setq converted
+		(cons (if enable (cons item callback) item)
+		      converted))))
+      (setq tail (cdr tail)))
+    (setq choice (x-popup-dialog t (cons name (nreverse converted))))
+    (if choice
+	(if (symbolp choice)
+	    (call-interactively choice)
+	  (eval choice)))))
+
+;; This is empty because the usual elements of the menu bar
+;; are provided by menu-bar.el instead.
+;; It would not make sense to duplicate them here.
+(defconst default-menubar nil)
+
+;; XEmacs compatibility
+(defun set-menubar (menubar)
+  "Set the default menubar to be menubar."
+  (setq-default current-menubar (copy-sequence menubar))
+  (set-menubar-dirty-flag))
+
+;; XEmacs compatibility
+(defun set-buffer-menubar (menubar)
+  "Set the buffer-local menubar to be menubar."
+  (make-local-variable 'current-menubar)
+  (setq current-menubar (copy-sequence menubar))
+  (set-menubar-dirty-flag))
+
+
+;;; menu manipulation functions
+
+;; XEmacs compatibility
+(defun find-menu-item (menubar item-path-list &optional parent)
+  "Searches MENUBAR for item given by ITEM-PATH-LIST.
+Returns (ITEM . PARENT), where PARENT is the immediate parent of
+ the item found.
+Signals an error if the item is not found."
+  (or parent (setq item-path-list (mapcar 'downcase item-path-list)))
+  (if (not (consp menubar))
+      nil
+    (let ((rest menubar)
+	  result)
+      (while rest
+	(if (and (car rest)
+		 (equal (car item-path-list)
+			(downcase (if (vectorp (car rest))
+				      (aref (car rest) 0)
+				    (if (stringp (car rest))
+					(car rest)
+				      (car (car rest)))))))
+	    (setq result (car rest) rest nil)
+	  (setq rest (cdr rest))))
+      (if (cdr item-path-list)
+	  (if (consp result)
+	      (find-menu-item (cdr result) (cdr item-path-list) result)
+	    (if result
+		(signal 'error (list "not a submenu" result))
+	      (signal 'error (list "no such submenu" (car item-path-list)))))
+	(cons result parent)))))
+
+
+;; XEmacs compatibility
+(defun disable-menu-item (path)
+  "Make the named menu item be unselectable.
+PATH is a list of strings which identify the position of the menu item in
+the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
+under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
+menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
+  (let* ((menubar current-menubar)
+	 (pair (find-menu-item menubar path))
+	 (item (car pair))
+	 (menu (cdr pair)))
+    (or item
+	(signal 'error (list (if menu "No such menu item" "No such menu")
+			     path)))
+    (if (consp item) (error "can't disable menus, only menu items"))
+    (aset item 2 nil)
+    (set-menubar-dirty-flag)
+    item))
+
+
+;; XEmacs compatibility
+(defun enable-menu-item (path)
+  "Make the named menu item be selectable.
+PATH is a list of strings which identify the position of the menu item in
+the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
+under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
+menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
+  (let* ((menubar current-menubar)
+	 (pair (find-menu-item menubar path))
+	 (item (car pair))
+	 (menu (cdr pair)))
+    (or item
+	(signal 'error (list (if menu "No such menu item" "No such menu")
+			     path)))
+    (if (consp item) (error "%S is a menu, not a menu item" path))
+    (aset item 2 t)
+    (set-menubar-dirty-flag)
+    item))
+
+
+(defun add-menu-item-1 (item-p menu-path item-name item-data enabled-p before)
+  (if before (setq before (downcase before)))
+  (let* ((menubar current-menubar)
+	 (menu (condition-case ()
+		   (car (find-menu-item menubar menu-path))
+		 (error nil)))
+	 (item (if (listp menu)
+		   (car (find-menu-item (cdr menu) (list item-name)))
+		 (signal 'error (list "not a submenu" menu-path)))))
+    (or menu
+	(let ((rest menu-path)
+	      (so-far menubar))
+	  (while rest
+;;;	    (setq menu (car (find-menu-item (cdr so-far) (list (car rest)))))
+	    (setq menu
+		  (if (eq so-far menubar)
+		      (car (find-menu-item so-far (list (car rest))))
+		    (car (find-menu-item (cdr so-far) (list (car rest))))))
+	    (or menu
+		(let ((rest2 so-far))
+		  (or rest2
+		      (error "Trying to modify a menu that doesn't exist"))
+		  (while (and (cdr rest2) (car (cdr rest2)))
+		    (setq rest2 (cdr rest2)))
+		  (setcdr rest2
+			  (nconc (list (setq menu (list (car rest))))
+				 (cdr rest2)))))
+	    (setq so-far menu)
+	    (setq rest (cdr rest)))))
+    (or menu (setq menu menubar))
+    (if item
+	nil	; it's already there
+      (if item-p
+	  (setq item (vector item-name item-data enabled-p))
+	(setq item (cons item-name item-data)))
+      ;; if BEFORE is specified, try to add it there.
+      (if before
+	  (setq before (car (find-menu-item menu (list before)))))
+      (let ((rest menu)
+	    (added-before nil))
+	(while rest
+	  (if (eq before (car (cdr rest)))
+	      (progn
+		(setcdr rest (cons item (cdr rest)))
+		(setq rest nil added-before t))
+	    (setq rest (cdr rest))))
+	(if (not added-before)
+	    ;; adding before the first item on the menubar itself is harder
+	    (if (and (eq menu menubar) (eq before (car menu)))
+		(setq menu (cons item menu)
+		      current-menubar menu)
+	      ;; otherwise, add the item to the end.
+	      (nconc menu (list item))))))
+    (if item-p
+	(progn
+	  (aset item 1 item-data)
+	  (aset item 2 (not (null enabled-p))))
+      (setcar item item-name)
+      (setcdr item item-data))
+    (set-menubar-dirty-flag)
+    item))
+
+;; XEmacs compatibility
+(defun add-menu-item (menu-path item-name function enabled-p &optional before)
+  "Add a menu item to some menu, creating the menu first if necessary.
+If the named item exists already, it is changed.
+MENU-PATH identifies the menu under which the new menu item should be inserted.
+ It is a list of strings; for example, (\"File\") names the top-level \"File\"
+ menu.  (\"File\" \"Foo\") names a hypothetical submenu of \"File\".
+ITEM-NAME is the string naming the menu item to be added.
+FUNCTION is the command to invoke when this menu item is selected.
+ If it is a symbol, then it is invoked with `call-interactively', in the same
+ way that functions bound to keys are invoked.  If it is a list, then the
+ list is simply evaluated.
+ENABLED-P controls whether the item is selectable or not.
+BEFORE, if provided, is the name of a menu item before which this item should
+ be added, if this item is not on the menu already.  If the item is already
+ present, it will not be moved."
+  (or menu-path (error "must specify a menu path"))
+  (or item-name (error "must specify an item name"))
+  (add-menu-item-1 t menu-path item-name function enabled-p before))
+
+
+;; XEmacs compatibility
+(defun delete-menu-item (path)
+  "Remove the named menu item from the menu hierarchy.
+PATH is a list of strings which identify the position of the menu item in
+the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
+under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
+menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
+  (let* ((menubar current-menubar)
+	 (pair (find-menu-item menubar path))
+	 (item (car pair))
+	 (menu (or (cdr pair) menubar)))
+    (if (not item)
+	nil
+      ;; the menubar is the only special case, because other menus begin
+      ;; with their name.
+      (if (eq menu current-menubar)
+	  (setq current-menubar (delq item menu))
+	(delq item menu))
+      (set-menubar-dirty-flag)
+      item)))
+
+
+;; XEmacs compatibility
+(defun relabel-menu-item (path new-name)
+  "Change the string of the specified menu item.
+PATH is a list of strings which identify the position of the menu item in
+the menu hierarchy.  (\"File\" \"Save\") means the menu item called \"Save\"
+under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
+menu item called \"Item\" under the \"Foo\" submenu of \"Menu\".
+NEW-NAME is the string that the menu item will be printed as from now on."
+  (or (stringp new-name)
+      (setq new-name (signal 'wrong-type-argument (list 'stringp new-name))))
+  (let* ((menubar current-menubar)
+	 (pair (find-menu-item menubar path))
+	 (item (car pair))
+	 (menu (cdr pair)))
+    (or item
+	(signal 'error (list (if menu "No such menu item" "No such menu")
+			     path)))
+    (if (and (consp item)
+	     (stringp (car item)))
+	(setcar item new-name)
+      (aset item 0 new-name))
+    (set-menubar-dirty-flag)
+    item))
+
+;; XEmacs compatibility
+(defun add-menu (menu-path menu-name menu-items &optional before)
+  "Add a menu to the menubar or one of its submenus.
+If the named menu exists already, it is changed.
+MENU-PATH identifies the menu under which the new menu should be inserted.
+ It is a list of strings; for example, (\"File\") names the top-level \"File\"
+ menu.  (\"File\" \"Foo\") names a hypothetical submenu of \"File\".
+ If MENU-PATH is nil, then the menu will be added to the menubar itself.
+MENU-NAME is the string naming the menu to be added.
+MENU-ITEMS is a list of menu item descriptions.
+ Each menu item should be a vector of three elements:
+   - a string, the name of the menu item;
+   - a symbol naming a command, or a form to evaluate;
+   - and a form whose value determines whether this item is selectable.
+BEFORE, if provided, is the name of a menu before which this menu should
+ be added, if this menu is not on its parent already.  If the menu is already
+ present, it will not be moved."
+  (or menu-name (error "must specify a menu name"))
+  (or menu-items (error "must specify some menu items"))
+  (add-menu-item-1 nil menu-path menu-name menu-items t before))
+
+
+
+(defvar put-buffer-names-in-file-menu t)
+
+
+;; Don't unconditionally enable menu bars; leave that up to the user.
+;;(let ((frames (frame-list)))
+;;  (while frames
+;;    (modify-frame-parameters (car frames) '((menu-bar-lines . 1)))
+;;    (setq frames (cdr frames))))
+;;(or (assq 'menu-bar-lines default-frame-alist)
+;;    (setq default-frame-alist
+;;	  (cons '(menu-bar-lines . 1) default-frame-alist)))
+
+(set-menubar default-menubar)
+
+(provide 'lmenu)
+
+;;; lmenu.el ends here
--- a/lisp/org/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/org/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,8 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* org-agenda.el (org-prefix-category-length)
+	(org-prefix-category-max-length): Fix typos in docstrings.
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
@@ -5,7 +10,7 @@
 2010-02-15  Chong Yidong  <cyd@stupidchicken.com>
 
 	* org-freemind.el (org-freemind-from-org-mode-node)
-	(org-freemind-from-org-mode, )
+	(org-freemind-from-org-mode)
 	(org-freemind-from-org-sparse-tree, org-freemind-to-org-mode):
 	Pass arg to called-interactively-p.
 
--- a/lisp/org/org-agenda.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/org/org-agenda.el	Wed Oct 13 22:40:51 2010 +0900
@@ -4501,9 +4501,9 @@
   "A flag, set by `org-compile-prefix-format'.
 The flag is set if the currently compiled format contains a `%e'.")
 (defvar org-prefix-category-length nil
-  "Used by `org-compile-prefix-format' to remember the category field widh.")
+  "Used by `org-compile-prefix-format' to remember the category field width.")
 (defvar org-prefix-category-max-length nil
-  "Used by `org-compile-prefix-format' to remember the category field widh.")
+  "Used by `org-compile-prefix-format' to remember the category field width.")
 
 (defun org-format-agenda-item (extra txt &optional category tags dotime
 				     noprefix remove-re habitp)
--- a/lisp/play/bubbles.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/play/bubbles.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1377,7 +1377,7 @@
                                    (g (nth 1 crgb))
                                    (b (nth 2 crgb))
                                    (brightness (/ (+ r g b) 3.0 256 256))
-                                   (val (sin (* brightness (/ pi 2))))
+                                   (val (sin (* brightness (/ float-pi 2))))
                                    (rr (* red val))
                                    (gg (* green val))
                                    (bb (* blue val))
--- a/lisp/proced.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/proced.el	Wed Oct 13 22:40:51 2010 +0900
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
-;; Author: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
+;; Author: Roland Winkler <winkler@gnu.org>
 ;; Keywords: Processes, Unix
 
 ;; This file is part of GNU Emacs.
--- a/lisp/progmodes/antlr-mode.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/progmodes/antlr-mode.el	Wed Oct 13 22:40:51 2010 +0900
@@ -951,7 +951,7 @@
       (3 antlr-keyword-face)
       (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
 	     antlr-keyword-face
-	   type-face)))
+	   font-lock-type-face)))
      (,(lambda (limit)
 	 (antlr-re-search-forward
 	  "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"
--- a/lisp/progmodes/gdb-ui.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/progmodes/gdb-ui.el	Wed Oct 13 22:40:51 2010 +0900
@@ -2195,7 +2195,7 @@
 	    (if	(posn-object posn)
 		(let* ((bptno (get-text-property
 			       0 'gdb-bptno (car (posn-string posn)))))
-		  (string-match "\\([0-9+]\\)*" bptno)
+		  (string-match "\\([0-9]+\\)*" bptno)
 		  (gdb-enqueue-input
 		   (list
 		    (concat gdb-server-prefix
@@ -2222,7 +2222,7 @@
 	      (setq obj (overlay-get overlay 'before-string))))
 	  (when (stringp obj)
 	    (let* ((bptno (get-text-property 0 'gdb-bptno obj)))
-	      (string-match "\\([0-9+]\\)*" bptno)
+	      (string-match "\\([0-9]+\\)*" bptno)
 	      (gdb-enqueue-input
 	       (list
 		(concat gdb-server-prefix
--- a/lisp/repeat.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/repeat.el	Wed Oct 13 22:40:51 2010 +0900
@@ -335,7 +335,12 @@
 	(setq real-last-command 'repeat)
 	(setq repeat-undo-count 1)
 	(unwind-protect
-	    (while (eq (read-event) repeat-repeat-char)
+	    (while (let ((evt (read-event))) ;FIXME: read-key maybe?
+                     ;; For clicks, we need to strip the meta-data to
+                     ;; check the underlying event name.
+                     (eq (or (car-safe evt) evt)
+                         (or (car-safe repeat-repeat-char)
+                             repeat-repeat-char)))
 	      (repeat repeat-arg))
 	  ;; Make sure `repeat-undo-count' is reset.
 	  (setq repeat-undo-count nil))
--- a/lisp/server.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/server.el	Wed Oct 13 22:40:51 2010 +0900
@@ -857,7 +857,7 @@
   returned by -eval.
 
 `-error DESCRIPTION'
-  Signal an error (but continue processing).
+  Signal an error and delete process PROC.
 
 `-suspend'
   Suspend this terminal, i.e., stop the client process.
--- a/lisp/simple.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/simple.el	Wed Oct 13 22:40:51 2010 +0900
@@ -4193,7 +4193,7 @@
     (or (and (= (vertical-motion
 		 (cons (or goal-column
 			   (if (consp temporary-goal-column)
-			       (truncate (car temporary-goal-column))
+			       (car temporary-goal-column)
 			     temporary-goal-column))
 		       arg))
 		arg)
@@ -4260,7 +4260,7 @@
 		  (goto-char (next-char-property-change (point))))
 		;; Move a line.
 		;; We don't use `end-of-line', since we want to escape
-		;; from field boundaries ocurring exactly at point.
+		;; from field boundaries occurring exactly at point.
 		(goto-char (constrain-to-field
 			    (let ((inhibit-field-text-motion t))
 			      (line-end-position))
--- a/lisp/subr.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/subr.el	Wed Oct 13 22:40:51 2010 +0900
@@ -238,7 +238,7 @@
 for the sake of consistency."
   (while t
     (signal 'error (list (apply 'format args)))))
-(set-advertised-calling-convention 'error '(string &rest args))
+(set-advertised-calling-convention 'error '(string &rest args) "23.1")
 
 ;; We put this here instead of in frame.el so that it's defined even on
 ;; systems where frame.el isn't loaded.
@@ -1038,9 +1038,10 @@
 (make-obsolete 'make-variable-frame-local
 	       "explicitly check for a frame-parameter instead." "22.2")
 (make-obsolete 'interactive-p 'called-interactively-p "23.2")
-(set-advertised-calling-convention 'called-interactively-p '(kind))
+(set-advertised-calling-convention 'called-interactively-p '(kind) "23.1")
 (set-advertised-calling-convention
- 'all-completions '(string collection &optional predicate))
+ 'all-completions '(string collection &optional predicate) "23.1")
+(set-advertised-calling-convention 'unintern '(name obarray) "23.3")
 
 ;;;; Obsolescence declarations for variables, and aliases.
 
@@ -2061,7 +2062,7 @@
 		(setq read (cons t read)))
 	    (push read unread-command-events)
 	    nil))))))
-(set-advertised-calling-convention 'sit-for '(seconds &optional nodisp))
+(set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1")
 
 ;;; Atomic change groups.
 
@@ -2589,7 +2590,7 @@
   (start-process name buffer shell-file-name shell-command-switch
 		 (mapconcat 'identity args " ")))
 (set-advertised-calling-convention 'start-process-shell-command
-                                   '(name buffer command))
+                                   '(name buffer command) "23.1")
 
 (defun start-file-process-shell-command (name buffer &rest args)
   "Start a program in a subprocess.  Return the process object for it.
@@ -2600,7 +2601,7 @@
    (if (file-remote-p default-directory) "-c" shell-command-switch)
    (mapconcat 'identity args " ")))
 (set-advertised-calling-convention 'start-file-process-shell-command
-                                   '(name buffer command))
+                                   '(name buffer command) "23.1")
 
 (defun call-process-shell-command (command &optional infile buffer display
 					   &rest args)
--- a/lisp/tar-mode.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/tar-mode.el	Wed Oct 13 22:40:51 2010 +0900
@@ -286,7 +286,8 @@
             (let* ((size (tar-parse-octal-integer
                           string tar-size-offset tar-time-offset))
                    ;; -1 so as to strip the terminating 0 byte.
-                   (name (buffer-substring pos (+ pos size -1)))
+		   (name (decode-coding-string 
+			  (buffer-substring pos (+ pos size -1)) coding))
                    (descriptor (tar-header-block-tokenize
                                 (+ pos (tar-roundup-512 size))
 				coding)))
--- a/lisp/term/ns-win.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/term/ns-win.el	Wed Oct 13 22:40:51 2010 +0900
@@ -66,6 +66,7 @@
 ;; nsterm.m
 (defvar ns-version-string)
 (defvar ns-alternate-modifier)
+(defvar ns-right-alternate-modifier)
 
 ;;;; Command line argument handling.
 
@@ -286,6 +287,7 @@
 (defvaralias 'mac-command-modifier 'ns-command-modifier)
 (defvaralias 'mac-control-modifier 'ns-control-modifier)
 (defvaralias 'mac-option-modifier 'ns-option-modifier)
+(defvaralias 'mac-right-option-modifier 'ns-right-option-modifier)
 (defvaralias 'mac-function-modifier 'ns-function-modifier)
 (declare-function ns-do-applescript "nsfns.m" (script))
 (defalias 'do-applescript 'ns-do-applescript)
@@ -817,6 +819,7 @@
 
 ;; You say tomAYto, I say tomAHto..
 (defvaralias 'ns-option-modifier 'ns-alternate-modifier)
+(defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier)
 
 (defun ns-do-hide-emacs ()
   (interactive)
--- a/lisp/textmodes/artist.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/textmodes/artist.el	Wed Oct 13 22:40:51 2010 +0900
@@ -2939,7 +2939,7 @@
 Returns a list of points.  Each point is on the form (X1 . Y1)."
   (let ((points))
     (while (> n 0)
-      (let* ((angle (* (random 359) (/ pi 180)))
+      (let* ((angle (* (random 359) (/ float-pi 180)))
 	     (dist  (random radius))
 	     (point (cons (round (* dist (cos angle)))
 			  (round (* dist (sin angle))))))
--- a/lisp/textmodes/bibtex.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/textmodes/bibtex.el	Wed Oct 13 22:40:51 2010 +0900
@@ -9,7 +9,7 @@
 ;;      Mike Newton <newton@gumby.cs.caltech.edu>
 ;;      Aaron Larson <alarson@src.honeywell.com>
 ;;      Dirk Herrmann <D.Herrmann@tu-bs.de>
-;; Maintainer: Roland Winkler <roland.winkler@physik.uni-erlangen.de>
+;; Maintainer: Roland Winkler <winkler@gnu.org>
 ;; Keywords: BibTeX, LaTeX, TeX
 
 ;; This file is part of GNU Emacs.
--- a/lisp/url/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/url/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,19 @@
+2010-09-18  Glenn Morris  <rgm@gnu.org>
+
+	* url-cache.el (url-is-cached): Doc fix.
+
+2010-09-11  Julien Danjou  <julien@danjou.info>
+
+	* url-cache (url-store-in-cache): Make `buff' argument really optional.
+
+2010-09-09  Glenn Morris  <rgm@gnu.org>
+
+	* url-cookie.el (url-cookie-expired-p): Tweak previous change.
+
+2010-09-09  shawn boles  <shawn.boles@gmail.com>  (tiny change)
+
+	* url-cookie.el (url-cookie-expired-p): Simplify and fix.  (Bug#6957)
+
 2010-07-26  Michael Albinus  <michael.albinus@gmx.de>
 
 	* url-http (url-http-parse-headers): Disable file name handlers at
--- a/lisp/url/url-cache.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/url/url-cache.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1,7 +1,7 @@
 ;;; url-cache.el --- Uniform Resource Locator retrieval tool
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010  Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -62,18 +62,16 @@
 ;;;###autoload
 (defun url-store-in-cache (&optional buff)
   "Store buffer BUFF in the cache."
-  (if (not (and buff (get-buffer buff)))
-      nil
-    (save-current-buffer
-      (and buff (set-buffer buff))
-      (let* ((fname (url-cache-create-filename (url-view-url t))))
-	(if (url-cache-prepare fname)
-	    (let ((coding-system-for-write 'binary))
-	      (write-region (point-min) (point-max) fname nil 5)))))))
+    (with-current-buffer (get-buffer (or buff (current-buffer)))
+      (let ((fname (url-cache-create-filename (url-view-url t))))
+        (if (url-cache-prepare fname)
+            (let ((coding-system-for-write 'binary))
+              (write-region (point-min) (point-max) fname nil 5))))))
 
 ;;;###autoload
 (defun url-is-cached (url)
-  "Return non-nil if the URL is cached."
+  "Return non-nil if the URL is cached.
+The actual return value is the last modification time of the cache file."
   (let* ((fname (url-cache-create-filename url))
 	 (attribs (file-attributes fname)))
     (and fname				; got a filename
--- a/lisp/url/url-cookie.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/url/url-cookie.el	Wed Oct 13 22:40:51 2010 +0900
@@ -1,7 +1,7 @@
 ;;; url-cookie.el --- Netscape Cookie support
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010  Free Software Foundation, Inc.
 
 ;; Keywords: comm, data, processes, hypermedia
 
@@ -24,7 +24,6 @@
 
 ;;; Code:
 
-(require 'timezone)
 (require 'url-util)
 (require 'url-parse)
 (eval-when-compile (require 'cl))
@@ -194,34 +193,9 @@
 	(setq url-cookie-storage (list (list domain tmp))))))))
 
 (defun url-cookie-expired-p (cookie)
-  (let* (
-	 (exp (url-cookie-expires cookie))
-	 (cur-date (and exp (timezone-parse-date (current-time-string))))
-	 (exp-date (and exp (timezone-parse-date exp)))
-	 (cur-greg (and cur-date (timezone-absolute-from-gregorian
-				  (string-to-number (aref cur-date 1))
-				  (string-to-number (aref cur-date 2))
-				  (string-to-number (aref cur-date 0)))))
-	 (exp-greg (and exp (timezone-absolute-from-gregorian
-			     (string-to-number (aref exp-date 1))
-			     (string-to-number (aref exp-date 2))
-			     (string-to-number (aref exp-date 0)))))
-	 (diff-in-days (and exp (- cur-greg exp-greg)))
-	 )
-    (cond
-     ((not exp)	nil)			; No expiry == expires at browser quit
-     ((< diff-in-days 0) nil)		; Expires sometime after today
-     ((> diff-in-days 0) t)		; Expired before today
-     (t					; Expires sometime today, check times
-      (let* ((cur-time (timezone-parse-time (aref cur-date 3)))
-	     (exp-time (timezone-parse-time (aref exp-date 3)))
-	     (cur-norm (+ (* 360 (string-to-number (aref cur-time 2)))
-			  (*  60 (string-to-number (aref cur-time 1)))
-			  (*   1 (string-to-number (aref cur-time 0)))))
-	     (exp-norm (+ (* 360 (string-to-number (aref exp-time 2)))
-			  (*  60 (string-to-number (aref exp-time 1)))
-			  (*   1 (string-to-number (aref exp-time 0))))))
-	(> (- cur-norm exp-norm) 1))))))
+  "Return non-nil if COOKIE is expired."
+  (let ((exp (url-cookie-expires cookie)))
+    (and exp (> (float-time) (float-time (date-to-time exp))))))
 
 (defun url-cookie-retrieve (host &optional localpart secure)
   "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART."
--- a/lisp/vc-hg.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/vc-hg.el	Wed Oct 13 22:40:51 2010 +0900
@@ -170,10 +170,12 @@
 		      (let ((process-environment
 			     ;; Avoid localization of messages so we
 			     ;; can parse the output.
-			     (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=")
+			     (append (list "TERM=dumb" "LANGUAGE=C")
 				     process-environment)))
 			(process-file
 			 "hg" nil t nil
+			 "--config" "alias.status=status"
+			 "--config" "defaults.status="
 			 "status" "-A" (file-relative-name file)))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
@@ -198,7 +200,7 @@
       ((status nil)
        (default-directory (file-name-directory file))
        ;; Avoid localization of messages so we can parse the output.
-       (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=")
+       (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C")
 				     process-environment))
        (out
         (with-output-to-string
@@ -210,6 +212,8 @@
 			;; Ignore all errors.
 			(process-file
 			 "hg" nil t nil
+			 "--config" "alias.parents=parents"
+			 "--config" "defaults.parents="
 			 "parents" "--template" "{rev}" (file-relative-name file)))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
--- a/lisp/vc-svn.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/vc-svn.el	Wed Oct 13 22:40:51 2010 +0900
@@ -373,7 +373,7 @@
   (message "Merging changes into %s..." file)
   ;; (vc-file-setprop file 'vc-working-revision nil)
   (vc-file-setprop file 'vc-checkout-time 0)
-  (vc-svn-command nil 0 file "update")
+  (vc-svn-command nil 0 file "--non-interactive" "update") ; see bug#7152
   ;; Analyze the merge result reported by SVN, and set
   ;; file properties accordingly.
   (with-current-buffer (get-buffer "*vc*")
--- a/lisp/whitespace.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/whitespace.el	Wed Oct 13 22:40:51 2010 +0900
@@ -6,7 +6,7 @@
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: data, wp
-;; Version: 13.0
+;; Version: 13.1
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
 ;; This file is part of GNU Emacs.
@@ -378,24 +378,32 @@
   "Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
   :link '(emacs-library-link :tag "Source Lisp File" "whitespace.el")
   :version "23.1"
-  :group 'wp
-  :group 'data)
+  :group 'convenience)
 
 
 (defcustom whitespace-style
-  '(tabs spaces trailing lines space-before-tab newline
-	 indentation empty space-after-tab
-	 space-mark tab-mark newline-mark)
+  '(face
+    tabs spaces trailing lines space-before-tab newline
+    indentation empty space-after-tab
+    space-mark tab-mark newline-mark)
   "Specify which kind of blank is visualized.
 
 It's a list containing some or all of the following values:
 
+   face			enable all visualization via faces (see below).
+
    trailing		trailing blanks are visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    tabs			TABs are visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    spaces		SPACEs and HARD SPACEs are visualized via
 			faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    lines		lines which have columns beyond
 			`whitespace-line-column' are highlighted via
@@ -403,6 +411,8 @@
 			Whole line is highlighted.
 			It has precedence over `lines-tail' (see
 			below).
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    lines-tail		lines which have columns beyond
 			`whitespace-line-column' are highlighted via
@@ -410,45 +420,69 @@
 			But only the part of line which goes
 			beyond `whitespace-line-column' column.
 			It has effect only if `lines' (see above)
-			is not present in `whitespace-style'.
+			is not present in `whitespace-style'
+			and if `face' (see above) is present in
+			`whitespace-style'.
 
    newline		NEWLINEs are visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    empty		empty lines at beginning and/or end of buffer
 			are visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    indentation::tab	8 or more SPACEs at beginning of line are
 			visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    indentation::space	TABs at beginning of line are visualized via
 			faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    indentation		8 or more SPACEs at beginning of line are
 			visualized, if `indent-tabs-mode' (which see)
 			is non-nil; otherwise, TABs at beginning of
 			line are visualized via faces.
+			It has effect only if `face' (see above)
+			is present in `whitespace-style'.
 
    space-after-tab::tab		8 or more SPACEs after a TAB are
 				visualized via faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-after-tab::space	TABs are visualized when 8 or more
 				SPACEs occur after a TAB, via faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-after-tab		8 or more SPACEs after a TAB are
 				visualized, if `indent-tabs-mode'
 				(which see) is non-nil; otherwise,
 				the TABs are visualized via faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-before-tab::tab	SPACEs before TAB are visualized via
 				faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-before-tab::space	TABs are visualized when SPACEs occur
 				before TAB, via faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-before-tab		SPACEs before TAB are visualized, if
 				`indent-tabs-mode' (which see) is
 				non-nil; otherwise, the TABs are
 				visualized via faces.
+				It has effect only if `face' (see above)
+				is present in `whitespace-style'.
 
    space-mark		SPACEs and HARD SPACEs are visualized via
 			display table.
@@ -487,9 +521,16 @@
 included in `whitespace-style' list, the indentation value is
 evaluated instead of indentation::space value.
 
+One reason for not visualize spaces via faces (if `face' is not
+included in `whitespace-style') is to use exclusively for
+cleanning up a buffer.  See `whitespace-cleanup' and
+`whitespace-cleanup-region' for documentation.
+
 See also `whitespace-display-mappings' for documentation."
   :type '(repeat :tag "Kind of Blank"
 		 (choice :tag "Kind of Blank Face"
+			 (const :tag "(Face) Face visualization"
+				face)
 			 (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs"
 				trailing)
 			 (const :tag "(Face) SPACEs and HARD SPACEs"
@@ -522,9 +563,9 @@
 
 (defface whitespace-space
   '((((class color) (background dark))
-     (:background "grey20"      :foreground "aquamarine3"))
+     (:background "grey20"      :foreground "darkgray"))
     (((class color) (background light))
-     (:background "LightYellow" :foreground "aquamarine3"))
+     (:background "LightYellow" :foreground "lightgray"))
     (t (:inverse-video t)))
   "Face used to visualize SPACE."
   :group 'whitespace)
@@ -540,9 +581,9 @@
 
 (defface whitespace-hspace		; 'nobreak-space
   '((((class color) (background dark))
-     (:background "grey24"        :foreground "aquamarine3"))
+     (:background "grey24"        :foreground "darkgray"))
     (((class color) (background light))
-     (:background "LemonChiffon3" :foreground "aquamarine3"))
+     (:background "LemonChiffon3" :foreground "lightgray"))
     (t (:inverse-video t)))
   "Face used to visualize HARD SPACE."
   :group 'whitespace)
@@ -558,9 +599,9 @@
 
 (defface whitespace-tab
   '((((class color) (background dark))
-     (:background "grey22" :foreground "aquamarine3"))
+     (:background "grey22" :foreground "darkgray"))
     (((class color) (background light))
-     (:background "beige"  :foreground "aquamarine3"))
+     (:background "beige"  :foreground "lightgray"))
     (t (:inverse-video t)))
   "Face used to visualize TAB."
   :group 'whitespace)
@@ -867,8 +908,13 @@
 (defcustom whitespace-line-column 80
   "Specify column beyond which the line is highlighted.
 
+It must be an integer or nil.  If nil, the `fill-column' variable value is
+used.
+
 Used when `whitespace-style' includes `lines' or `lines-tail'."
-  :type '(integer :tag "Line Length")
+  :type '(choice :tag "Line Length Limit"
+		 (integer :tag "Line Length")
+		 (const :tag "Use fill-column" nil))
   :group 'whitespace)
 
 
@@ -1152,7 +1198,8 @@
 
 
 (defconst whitespace-style-value-list
-  '(tabs
+  '(face
+    tabs
     spaces
     trailing
     lines
@@ -1177,7 +1224,8 @@
 
 
 (defconst whitespace-toggle-option-alist
-  '((?t    . tabs)
+  '((?f    . face)
+    (?t    . tabs)
     (?s    . spaces)
     (?r    . trailing)
     (?l    . lines)
@@ -1257,6 +1305,7 @@
 
   CHAR	MEANING
   (VIA FACES)
+   f	toggle face visualization
    t	toggle TAB visualization
    s	toggle SPACE and HARD SPACE visualization
    r	toggle trailing blanks visualization
@@ -1285,6 +1334,7 @@
 Non-interactively, ARG should be a symbol or a list of symbols.
 The valid symbols are:
 
+   face			toggle face visualization
    tabs			toggle TAB visualization
    spaces		toggle SPACE and HARD SPACE visualization
    trailing		toggle trailing blanks visualization
@@ -1334,6 +1384,7 @@
 
   CHAR	MEANING
   (VIA FACES)
+   f	toggle face visualization
    t	toggle TAB visualization
    s	toggle SPACE and HARD SPACE visualization
    r	toggle trailing blanks visualization
@@ -1362,6 +1413,7 @@
 Non-interactively, ARG should be a symbol or a list of symbols.
 The valid symbols are:
 
+   face			toggle face visualization
    tabs			toggle TAB visualization
    spaces		toggle SPACE and HARD SPACE visualization
    trailing		toggle trailing blanks visualization
@@ -1891,9 +1943,10 @@
 
 (defconst whitespace-help-text
   "\
- Whitespace Toggle Options
-
- FACES
+ Whitespace Toggle Options                  | scroll up  :  SPC   or > |
+                                            | scroll down:  M-SPC or < |
+ FACES                                      \\__________________________/
+ []  f   - toggle face visualization
  []  t   - toggle TAB visualization
  []  s   - toggle SPACE and HARD SPACE visualization
  []  r   - toggle trailing blanks visualization
@@ -1967,15 +2020,13 @@
   "Display BUFFER in a new window."
   (goto-char (point-min))
   (set-buffer-modified-p nil)
-  (let ((size (- (window-height)
-		 (max window-min-height
-		      (1+ (count-lines (point-min)
-				       (point-max)))))))
-    (when (<= size 0)
-      (kill-buffer buffer)
-      (error "Frame height is too small; \
+  (when (< (window-height) (* 2 window-min-height))
+    (kill-buffer buffer)
+    (error "Window height is too small; \
 can't split window to display whitespace toggle options"))
-    (set-window-buffer (split-window nil size) buffer)))
+  (let ((win (split-window)))
+    (set-window-buffer win buffer)
+    (shrink-window-if-larger-than-buffer win)))
 
 
 (defun whitespace-kill-buffer (buffer-name)
@@ -1991,6 +2042,24 @@
   (whitespace-kill-buffer whitespace-help-buffer-name))
 
 
+(defun whitespace-help-scroll (&optional up)
+  "Scroll help window, if it exists.
+
+If UP is non-nil, scroll up; otherwise, scroll down."
+  (condition-case data-help
+      (let ((buffer (get-buffer whitespace-help-buffer-name)))
+	(if buffer
+	    (with-selected-window (get-buffer-window buffer)
+	      (if up
+		  (scroll-up 3)
+		(scroll-down 3)))
+	  (ding)))
+    ;; handler
+    ((error)
+     ;; just ignore error
+     )))
+
+
 (defun whitespace-interactive-char (local-p)
   "Interactive function to read a char and return a symbol.
 
@@ -2001,6 +2070,7 @@
 
   CHAR	MEANING
   (VIA FACES)
+   f	toggle face visualization
    t	toggle TAB visualization
    s	toggle SPACE and HARD SPACE visualization
    r	toggle trailing blanks visualization
@@ -2050,9 +2120,13 @@
 			 (cdr
 			  (assq ch whitespace-toggle-option-alist)))))
 	      ;; while body
-	      (if (eq ch ?\?)
-		  (whitespace-help-on style)
-		(ding)))
+	      (cond
+	       ((eq ch ?\?)   (whitespace-help-on style))
+	       ((eq ch ?\ )   (whitespace-help-scroll t))
+	       ((eq ch ?\M- ) (whitespace-help-scroll))
+	       ((eq ch ?>)    (whitespace-help-scroll t))
+	       ((eq ch ?<)    (whitespace-help-scroll))
+	       (t             (ding))))
 	    (whitespace-help-off)
 	    (message " "))		; clean echo area
 	;; handler
@@ -2131,22 +2205,23 @@
 
 (defun whitespace-style-face-p ()
   "Return t if there is some visualization via face."
-  (or (memq 'tabs                    whitespace-active-style)
-      (memq 'spaces                  whitespace-active-style)
-      (memq 'trailing                whitespace-active-style)
-      (memq 'lines                   whitespace-active-style)
-      (memq 'lines-tail              whitespace-active-style)
-      (memq 'newline                 whitespace-active-style)
-      (memq 'empty                   whitespace-active-style)
-      (memq 'indentation             whitespace-active-style)
-      (memq 'indentation::tab        whitespace-active-style)
-      (memq 'indentation::space      whitespace-active-style)
-      (memq 'space-after-tab         whitespace-active-style)
-      (memq 'space-after-tab::tab    whitespace-active-style)
-      (memq 'space-after-tab::space  whitespace-active-style)
-      (memq 'space-before-tab        whitespace-active-style)
-      (memq 'space-before-tab::tab   whitespace-active-style)
-      (memq 'space-before-tab::space whitespace-active-style)))
+  (and (memq 'face whitespace-active-style)
+       (or (memq 'tabs                    whitespace-active-style)
+	   (memq 'spaces                  whitespace-active-style)
+	   (memq 'trailing                whitespace-active-style)
+	   (memq 'lines                   whitespace-active-style)
+	   (memq 'lines-tail              whitespace-active-style)
+	   (memq 'newline                 whitespace-active-style)
+	   (memq 'empty                   whitespace-active-style)
+	   (memq 'indentation             whitespace-active-style)
+	   (memq 'indentation::tab        whitespace-active-style)
+	   (memq 'indentation::space      whitespace-active-style)
+	   (memq 'space-after-tab         whitespace-active-style)
+	   (memq 'space-after-tab::tab    whitespace-active-style)
+	   (memq 'space-after-tab::space  whitespace-active-style)
+	   (memq 'space-before-tab        whitespace-active-style)
+	   (memq 'space-before-tab::tab   whitespace-active-style)
+	   (memq 'space-before-tab::space whitespace-active-style))))
 
 
 (defun whitespace-color-on ()
@@ -2204,14 +2279,16 @@
        (list
 	;; Show "long" lines
 	(list
-	 (format
-	  "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
-	  whitespace-tab-width (1- whitespace-tab-width)
-	  (/ whitespace-line-column whitespace-tab-width)
-	  (let ((rem (% whitespace-line-column whitespace-tab-width)))
-	    (if (zerop rem)
-		""
-	      (format ".\\{%d\\}" rem))))
+	 (let ((line-column (or whitespace-line-column fill-column)))
+	   (format
+	    "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
+	    whitespace-tab-width
+	    (1- whitespace-tab-width)
+	    (/ line-column whitespace-tab-width)
+	    (let ((rem (% line-column whitespace-tab-width)))
+	      (if (zerop rem)
+		  ""
+		(format ".\\{%d\\}" rem)))))
 	 (if (memq 'lines whitespace-active-style)
 	     0				; whole line
 	   2)				; line tail
--- a/lisp/window.el	Sun Aug 29 14:22:52 2010 +0900
+++ b/lisp/window.el	Wed Oct 13 22:40:51 2010 +0900
@@ -160,8 +160,8 @@
 which you entered the minibuffer, as well as the minibuffer
 window.
 
-ALL-FRAMES nil or omitted means cycle through all windows on
- WINDOW's frame, plus the minibuffer window if specified by the
+ALL-FRAMES nil or omitted means cycle through all windows on the
+ selected frame, plus the minibuffer window if specified by the
  MINIBUF argument, see above.  If the minibuffer counts, cycle
  through all windows on all frames that share that minibuffer
  too.
@@ -173,8 +173,8 @@
  iconified frames.
 ALL-FRAMES a frame means cycle through all windows on that frame
  only.
-Anything else means cycle through all windows on WINDOW's frame
- and no others.
+Anything else means cycle through all windows on the selected
+ frame and no others.
 
 This function changes neither the order of recently selected
 windows nor the buffer list."
--- a/make-dist	Sun Aug 29 14:22:52 2010 +0900
+++ b/make-dist	Wed Oct 13 22:40:51 2010 +0900
@@ -460,7 +460,7 @@
  ln makefile.w32-in ../${tempdir}/src
  ln .gdbinit .dbxinit ../${tempdir}/src
  cd ../${tempdir}/src
- rm -f config.h epaths.h Makefile Makefile.c
+ rm -f config.h epaths.h Makefile Makefile.c buildobj.h
  rm -f =* TAGS)
 
 echo "Making links to \`src/bitmaps'"
--- a/src/ChangeLog	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog	Wed Oct 13 22:40:51 2010 +0900
@@ -1,3 +1,146 @@
+2010-10-12  Juanma Barranquero  <lekktu@gmail.com>
+
+	* font.c (Ffont_variation_glyphs):
+	* ccl.c (Fccl_execute_on_string): Fix typo in docstring.
+
+2010-10-10  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsterm.m (Qleft): Declare.
+	(ns_right_alternate_modifier): New variable
+	(NSRightAlternateKeyMask): New define.
+	(EV_MODIFIERS): Parse NSRightAlternateKeyMask if
+	ns_right_alternate_modifier isn't Qleft.
+	(keyDown): If ns_right_alternate_modifier isn't Qleft, use it
+	as emacs modifier for NSRightAlternateKeyMask.
+	(syms_of_nsterm): DEFVAR_LISP ns-right-alternate-modifier.
+
+2010-10-08  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dbusbind.c (xd_get_dispatch_status): Return a Lisp_Object.
+	(xd_pending_messages): Catch xd_get_dispatch_status calls.
+
+2010-10-08  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (complement_process_encoding_system): Fix previous change.
+
+2010-10-03  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dbusbind.c (syms_of_dbusbind): Move putenv call ...
+	(Fdbus_init_bus): ... here.  (Bug#7113)
+
+2010-10-03  Glenn Morris  <rgm@gnu.org>
+
+	* buffer.c (before-change-functions, after-change-functions):
+	Three-year overdue doc fix following 2007-08-13 change.
+
+2010-10-02  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (coding_inherit_eol_type): If parent doesn't specify
+	eol-format, inherit from the system's default.
+	(complement_process_encoding_system): Make a new coding system
+	inherit the original eol-format.
+
+2010-09-30  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (complement_process_encoding_system): New function.
+
+	* coding.h (complement_process_encoding_system): Extern it.
+
+	* callproc.c (Fcall_process): Complement the coding system for
+	encoding arguments.
+	(Fcall_process_region): Complement the coding system for encoding
+	the input to the process.
+
+	* process.c (Fstart_process): Complement the coding system for
+	encoding arguments.
+	(send_process): Complement the coding system for encoding what
+	sent to the process.
+
+2010-09-29  Kenichi Handa  <handa@m17n.org>
+
+	* xfont.c (xfont_open): Fix setting of font->average_width from
+	:avgwidth property (Bug#7123).
+
+2010-09-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dbusbind.c (syms_of_dbusbind): Use putenv instead of setenv, it
+	is more portable.
+
+	* keyboard.c (gobble_input): Move call of xd_read_queued_messages ...
+	(kbd_buffer_get_event): ... here. This is needed for cygwin, which
+	has not defined SIGIO.
+
+2010-09-27  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dbusbind.c (syms_of_dbusbind): Set $DBUS_FATAL_WARNINGS to "0".
+	(Bug#7113)
+
+2010-09-26  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xgselect.c (xg_select): Clear file descriptors not set from
+	rfds and wfds.
+
+2010-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* syntax.c (back_comment): Detect the case where a 1-char comment
+	starter is also the 2nd char of a 2-char comment ender.
+
+2010-09-17  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* gtkutil.c (xg_tool_bar_menu_proxy): Set gtk-menu-items to TRUE.
+
+2010-09-12  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xterm.c (get_current_vm_state): New function.
+	(do_ewmh_fullscreen): Call get_current_vm_state and compare with
+	want_fullscreen so set_wm_state calls are few (Bug#7013).
+	(x_handle_net_wm_state): Move code to get_current_vm_state and
+	call that function.
+
+2010-09-11  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
+
+	* term.c (tty_set_terminal_modes): Don't initialize twice (bug#7002).
+
+2010-09-08  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (encode_coding_iso_2022): Don't optimize for ASCII if
+	we may use designation or locking-shift.
+
+2010-09-07  Kenichi Handa  <handa@m17n.org>
+
+	* coding.c (detect_coding_emacs_mule): Fix checking of multibyte
+	sequence when the source is multibyte.
+
+2010-08-31  Kenichi Handa  <handa@m17n.org>
+
+	* dispextern.h (FACE_FOR_CHAR): Use an ASCII face for 8-bit
+	characters.
+
+	* term.c (encode_terminal_code): Fix the previous change.
+	(produce_glyphs): Don't set it->char_to_display here.
+	Don't handle unibyte-display-via-language-environment here.
+	(produce_special_glyphs): Set temp_it.char_to_display before
+	calling produce_glyphs.
+
+	* xdisp.c (get_next_display_element): Set it->char_to_display
+	here.  Convert all 8-bit bytes from unibyte buffer/string to 8-bit
+	characters.
+	(get_overlay_arrow_glyph_row): Set it.char_to_display too before
+	calling PRODUCE_GLYPHS.
+	(append_space_for_newline): Save and store it->char_to_display.
+	Set it->char_to_display before calling PRODUCE_GLYPHS.
+	(extend_face_to_end_of_line): Set it->char_to_display before
+	calling PRODUCE_GLYPHS.
+	(get_glyph_face_and_encoding): Set the glyph code an 8-bit
+	character to its byte value.
+	(get_char_glyph_code): New function.
+	(produce_stretch_glyph): Set it2.char_to_display too before
+	calling x_produce_glyphs.
+	(x_produce_glyphs): Simplify by using the same code for ASCII and
+	non-ASCII characters.  Don't set it->char_to_display here.
+	Don't handle unibyte-display-via-language-environment here.  For a
+	character of no glyph, use font->space_width instead of FONT_WIDTH.
+
 2010-08-29  Kenichi Handa  <handa@m17n.org>
 
 	* term.c (encode_terminal_code): Encode byte chars to the
@@ -24,8 +167,8 @@
 
 2010-08-09  Peter O'Gorman <pogma@thewrittenword.com>  (tiny change)
 
-	* s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK): New
-	definitions.
+	* s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK):
+	New definitions.
 	(HAVE_TERMIO): Remove.
 
 2010-08-06  Kenichi Handa  <handa@m17n.org>
@@ -33,7 +176,7 @@
 	* charset.c: Include <stdlib.h>
 	(struct charset_sort_data): New struct.
 	(charset_compare): New function.
-	(Fsort_charsets): New funciton.
+	(Fsort_charsets): New function.
 	(syms_of_charset): Declare Fsort_charsets as a Lisp function.
 
 	* coding.c (decode_coding_iso_2022): Fix checking of dimension
@@ -261,16 +404,16 @@
 
 	* ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the
 	new feature of libotf and m17n-flt.
-	(ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]: Call
-	OTF_check_features even if no specific feature is given.
+	(ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]:
+	Call OTF_check_features even if no specific feature is given.
 	(PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro.
 	(ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case
 	that OUT is NULL.  Use OTF_drive_gsub_with_log and
 	OTF_drive_gpos_with_log instead of OTF_drive_gsub and
 	OTF_drive_gpos.
 	(ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function.
-	(ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]: Setup
-	mflt_enable_new_feature and mflt_try_otf.
+	(ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]:
+	Setup mflt_enable_new_feature and mflt_try_otf.
 
 2010-04-19  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -13734,7 +13877,7 @@
 	(Ffont_shape_text): New function.
 	(Fopen_font): If the font size is not given, use 12-pixel.
 	(Ffont_at): New arg STRING.
-	(syms_of_font): Initalize font_charset_alist.
+	(syms_of_font): Initialize font_charset_alist.
 	Declare Ffont_shape_text as a Lisp function.  Call syms_of_XXfont
 	conditionally.
 
@@ -14731,7 +14874,7 @@
 
 	* font.c (font_unparse_fcname): Fix typo (swidth->width).
 	(font_list_entities): Check driver_list->on.
-	(register_font_driver): Initalize `on' member to 0.
+	(register_font_driver): Initialize `on' member to 0.
 	(font_update_drivers): New function.
 	(Fclear_font_cache): Check driver_list->on.
 
--- a/src/ChangeLog.2	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.2	Wed Oct 13 22:40:51 2010 +0900
@@ -683,7 +683,7 @@
 	(That `select' saw something on channel 0 doesn't mean it is
 	kbd input; it could be an expose event.)
 
-	* keyboard.c (read_avail_input) [FIONREAD]:  Now static.
+	* keyboard.c (read_avail_input) [FIONREAD]: Now static.
 	New arg specifies value of NREAD;
 	if it is nonzero, don't call get_input_pending to get it.
 	Use kbd_buffer_store_char to put chars into kbd_buffer.
@@ -1210,7 +1210,7 @@
 	Remove #ifndef VMS around the sleep when buffer is full.
 	* s-vms.h: Define nonstandard PENDING_OUTPUT_COUNT for VMS use.
 
-	* fileio.c (file_name_as_directory) [VMS]:  Fix 3rd arg to strncmp.
+	* fileio.c (file_name_as_directory) [VMS]: Fix 3rd arg to strncmp.
 
 1987-07-17  Paul Rubin  (phr@prep)
 
@@ -1442,7 +1442,7 @@
 	Turn on call to vmserrstr.
 	* sysdep.c (vmserrstr) [VMS]: Define this function.
 
-	* process.c (create_process) [IRIS]:  Don't open the pty's tty
+	* process.c (create_process) [IRIS]: Don't open the pty's tty
 	in the parent process.  Open only once, in the child.
 
 	* xdisp.c (redisplay_window): If window-start points nowhere,
@@ -1544,8 +1544,8 @@
 
 1987-05-05  Richard Mlynarik  (mly@prep)
 
-	* m-irist.h:  New version from raible@orville.arpa
-	* s-iris3-5.h:  New file.  (s-usg5-2 with additions)
+	* m-irist.h: New version from raible@orville.arpa
+	* s-iris3-5.h: New file.  (s-usg5-2 with additions)
 
 	* keyboard.c:
 	IRIS, like HPUX, #defines but does not implement FIONREAD.
@@ -1563,10 +1563,10 @@
 1987-04-27  Richard Mlynarik  (mly@prep)
 
 	* fileio.c (APOLLO from lnz):
-	Fcopy_file, Fset_file_modes: Don't use un*x modes if
+	(Fcopy_file, Fset_file_modes): Don't use un*x modes if
 	env var USE_DOMAIN_ACLS is set.
-	Fset_file_modes: utimes fix.
-	Finsert_file_contents:  Must do fstat after open for Apollo.
+	(Fset_file_modes): utimes fix.
+	(Finsert_file_contents): Must do fstat after open for Apollo.
 
 	* emacs.c (main): (APOLLO from lnz):
 	Don't use un*x modes if env var USE_DOMAIN_ACLS set.
@@ -1675,7 +1675,7 @@
 
 1987-03-20  Richard Mlynarik  (mly@prep)
 
-	* filemode.c:  Hacks for set-uid/gid but not executable.
+	* filemode.c: Hacks for set-uid/gid but not executable.
 
 1987-03-20  Richard M. Stallman  (rms@prep)
 
@@ -1966,7 +1966,7 @@
 
 1987-02-22  Richard M. Stallman  (rms@prep)
 
-	* dispnew.c (Fopen_termscript):  Close existing termscript
+	* dispnew.c (Fopen_termscript): Close existing termscript
 	file before trying to open a new one.  Report open failure
 	with report_file_error.
 
@@ -2071,9 +2071,9 @@
 
 1987-02-10  Richard Mlynarik  (mly@prep)
 
-	* xfns.c (Fx_get_default):  Add (unsigned char *) cast.
-
-	* window.c: typo.
+	* xfns.c (Fx_get_default): Add (unsigned char *) cast.
+
+	* window.c: Typo.
 
 1987-02-09  Richard M. Stallman  (rms@prep)
 
@@ -2853,7 +2853,7 @@
 	local variables for more register decls.  Compute
 	and pass `envlen' arg to child_setup.
 
-	* process.c (create_process):  Compute and pass `envlen' arg
+	* process.c (create_process): Compute and pass `envlen' arg
 	to child_setup.
 
 	* xterm.c (x_term_init): Don't call XPopUpWindow at all.
@@ -3998,7 +3998,7 @@
 	* editfns.c (Fuser_uid, Fuser_real_uid):
 	New functions that return values of geteuid and getuid system calls.
 
-	* dired.c (Ffile_attributes):  Value has additional element
+	* dired.c (Ffile_attributes): Value has additional element
 	t iff file gid would change if Emacs deletes it and recreates it.
 
 	* xdisp.c (display_mode_element):
@@ -4078,7 +4078,7 @@
 	being unbound.  struct catchtag has two new fields,
 	gcpro and pdlcount.
 
-	* eval.c (Fthrow, Fsignal):  Use unbind_catch before longjmp.
+	* eval.c (Fthrow, Fsignal): Use unbind_catch before longjmp.
 
 	* eval.c (internal_catch): No need to restore anything
 	from the catchtag after throw, because unbind_catch does it all.
@@ -4657,7 +4657,7 @@
 
 	* fileio.c (Ffile_newer_than_file_p): New Lisp primitive.
 
-	* fileio.c (Ffile_exists_p):  this is now distinct from
+	* fileio.c (Ffile_exists_p): This is now distinct from
 	Ffile_readable_p; it checks only for existence, not for
 	readability.
 
--- a/src/ChangeLog.3	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.3	Wed Oct 13 22:40:51 2010 +0900
@@ -5146,7 +5146,7 @@
 	Change mouse movement events to be arranged like click events.
 	(format_modifiers): Note that the click modifier has no
 	written representation.
-	(modifier_names, modifer_symbols): New variables, used to
+	(modifier_names, modifier_symbols): New variables, used to
 	create the Qevent_symbol_elements property.
 	(modify_event_symbol): Change the format of the modified
 	symbol cache; there are too many modifier bits now to use a
@@ -5154,8 +5154,8 @@
 	Document the format of the cache.
 	Put the Qevent_symbol_elements property on each new symbol,
 	instead of a Qevent_unmodified property.
-	(symbols_of_keyboard): Put Qevent_symbol_elements properties on
-	the symbols specified in head_table, not Qevent_unmodifed properties.
+	(symbols_of_keyboard): Put Qevent_symbol_elements properties on the
+	symbols specified in head_table, not Qevent_unmodified properties.
 	Initialize and staticpro modifier_symbols, and staticpro the
 	window elements of button_down_location.
 
@@ -11207,7 +11207,7 @@
 	events to send the function key number instead of a symbol.
 	* keyboard.c (modify_event_symbol): Re-arranged to work well
 	with function key/mouse button numbers instead of symbols.
-	And if (MODIFIERS & up_modifer), prepend "U-" to the name of the
+	And if (MODIFIERS & up_modifier), prepend "U-" to the name of the
 	symbol being constructed.
 	(make_lispy_event): Use the new modify_event_symbol.
 
--- a/src/ChangeLog.5	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.5	Wed Oct 13 22:40:51 2010 +0900
@@ -3107,7 +3107,7 @@
 
 	* lisp.h (enum Lisp_Type): Lisp_Process, Lisp_Window, Lisp_Frame,
 	Lisp_Subr deleted.
-	(PSEUDOVECTORP, GC_PSEUDOVECTORP):  Add paren for proper nesting.
+	(PSEUDOVECTORP, GC_PSEUDOVECTORP): Add paren for proper nesting.
 	(PROCESSP, GC_PROCESSP, XSETPROCESS): Rewrite to use pseudovectors.
 	(WINDOWP, GC_WINDOWP, XSETWINDOW): Likewise.
 	(FRAMEP, GC_FRAMEP): Likewise.
@@ -4093,7 +4093,7 @@
 
 	* xterm.h: Delete X10 code.
 
-	* xfns.c (Fx_create_frame): Don't increment refernce_count
+	* xfns.c (Fx_create_frame): Don't increment reference_count
 	until the frame is put on the frame list.
 
 	* xterm.c (x_initialize): Init x_noop_count, x_focus_frame
@@ -7039,7 +7039,7 @@
 
 1994-06-07  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
 
-	* mips-siemens.h:  Include pyramid.h, not mips.h.
+	* mips-siemens.h: Include pyramid.h, not mips.h.
 	(LOAD_AVE_TYPE, LOAD_AVE_CVT): Definitions deleted.
 	(NO_ARG_ARRAY, HAVE_ALLOCA): Defined.
 	(BROKEN_FIONREAD): Add #undef.
--- a/src/ChangeLog.7	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.7	Wed Oct 13 22:40:51 2010 +0900
@@ -491,7 +491,7 @@
 
 	* xselect.c (selection_data_to_lisp_data): Set
 	Vlast_coding_system_used.
-	(lisp_data_to_selection_data): Likewize.
+	(lisp_data_to_selection_data): Likesize.
 
 1998-07-07  Richard Stallman  <rms@psilocin.ai.mit.edu>
 
@@ -502,7 +502,7 @@
 	* editfns.c (Fformat): Replace explicit numeric constants with
 	proper macros.
 
-	* fns.c (concat): Likewize.
+	* fns.c (concat): Likewise.
 
 1998-07-06  Kenichi Handa  <handa@etl.go.jp>
 
@@ -1040,7 +1040,7 @@
 
 	* lread.c: Remember the last TWO strings skipped with #@.
 	(prev_saved_doc_string*): New variables.
-	(Fload): Initalize prev_saved_doc_string.
+	(Fload): Initialize prev_saved_doc_string.
 	(read1): Copy saved_doc_string to prev_saved_doc_string
 	before storing a new string in saved_doc_string.
 	(read_list): Look in prev_saved_doc_string as well as
--- a/src/ChangeLog.8	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.8	Wed Oct 13 22:40:51 2010 +0900
@@ -3686,7 +3686,7 @@
 	* lread.c (read_escape): For Control modifier, pay attention to
 	multibyte character.
 	(read1): Likewise.  Signal error or a multibyte character which
-	has a modifer bit.  Check validity of Shift modifer.
+	has a modifier bit.  Check validity of Shift modifier.
 
 	* charset.c (non_ascii_char_to_string): Handle modifier bits as
 	the same as Lisp reader.
--- a/src/ChangeLog.9	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ChangeLog.9	Wed Oct 13 22:40:51 2010 +0900
@@ -3896,7 +3896,7 @@
 
 2001-01-07  Dave Love  <fx@gnu.org>
 
-	* keyboard.c (Fread_key_sequence_vector):  Avoid newline in
+	* keyboard.c (Fread_key_sequence_vector): Avoid newline in
 	arglist, for documentation's sake.
 
 2001-01-06  Andrew Innes  <andrewi@gnu.org>
@@ -4180,7 +4180,7 @@
 	what's displayed in the window.
 
 	* xdisp.c (try_window_reusing_current_matrix)
-	<new start <= old start>:  Disable rows in the current matrix
+	<new start <= old start>: Disable rows in the current matrix
 	which are below the window after scrolling.
 
 	* xdisp.c (move_it_by_lines): Don't do optimizations if NEED_Y_P
@@ -5480,7 +5480,7 @@
 	* lisp.h (pos_visible_p): Change prototype.
 
 	* dispextern.h (CURRENT_MODE_LINE_HEIGHT)
-	(CURRENT_HEADER_LINE_HEIGHT):  Look at current_mode_line_height
+	(CURRENT_HEADER_LINE_HEIGHT): Look at current_mode_line_height
 	and current_header_line_height first.
 	(current_mode_line_height, current_header_line_height):
 	Declare extern.
@@ -6683,7 +6683,7 @@
 	(create_offscreen_bitmap): New function.
 	(w32_BDF_TextOut): Use it. Draw glyphs as DIBs.
 
-	* w32term.c (x_produce_glyphs):  If the distance from the current
+	* w32term.c (x_produce_glyphs): If the distance from the current
 	position to the next tab stop is less than a canonical character
 	width, use the tab stop after that.
 	(x_draw_glyphs): Handle case START and END are out of bounds more
@@ -7536,7 +7536,7 @@
 	CYCLE_CHECK arguments.
 	(merge_face_vector_with_property, Finternal_merge_in_global_face)
 	(lookup_named_face, lookup_derived_face, realize_named_face)
-	(face_at_string_position, face_at_buffer_position):  Supply
+	(face_at_string_position, face_at_buffer_position): Supply
 	new F and CYCLE_CHECK arguments to merge_face_vectors.
 	(merge_face_heights): New function.
 	(merge_face_vectors, merge_face_vector_with_property)
@@ -7826,7 +7826,7 @@
 	(x_compute_glyph_string_overhangs): Incomplete body removed, as
 	the X way of doing this will not work for W32.
 	(w32_intersect_rectangles): Removed. Use IntersectRect API call.
-	(x_draw_image_foreground):  Avoid drawing outside of the clip area
+	(x_draw_image_foreground): Avoid drawing outside of the clip area
 	when image doesn't have a mask.
 	(note_mouse_highlight): Process overlays in the right order of
 	priority. Set help_echo_window.
@@ -10156,7 +10156,7 @@
 	(encode_coding_string): Likewise.
 
 	* ccl.c (ccl_driver) <CCL_ReadMultibyteChar2>
-	<CCL_WriteMultibyteChar2>:  Handle charsets eight-bit-control and
+	<CCL_WriteMultibyteChar2>: Handle charsets eight-bit-control and
 	eight-bit-graphic correctly.
 
 2000-05-24  Kenichi HANDA  <handa@etl.go.jp>
@@ -12812,7 +12812,7 @@
 	(xim_destroy_callback, xim_open_dpy, xim_instantiate_callback)
 	(xim_initialize, xim_close)
 	[HAVE_X_I18N && HAVE_X11R6]: New functions.
-	(x_destroy_window) [HAVE_X_I18N]:  Call xic_destroy_frame.
+	(x_destroy_window) [HAVE_X_I18N]: Call xic_destroy_frame.
 	(x_term_init) [HAVE_X_I18N]: Call xim_initialize.
 	(x_delete_display) [HAVE_X_I18N]: Call xim_close.
 
--- a/src/buffer.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/buffer.c	Wed Oct 13 22:40:51 2010 +0900
@@ -6096,10 +6096,7 @@
 
 Buffer changes made while executing the `before-change-functions'
 don't call any before-change or after-change functions.
-That's because these variables are temporarily set to nil.
-As a result, a hook function cannot straightforwardly alter the
-value of these variables.  See the Emacs Lisp manual for a way of
-accomplishing an equivalent result by using other variables.
+That's because `inhibit-modification-hooks' is temporarily set non-nil.
 
 If an unhandled error happens in running these functions,
 the variable's value remains nil.  That prevents the error
@@ -6117,10 +6114,7 @@
 
 Buffer changes made while executing the `after-change-functions'
 don't call any before-change or after-change functions.
-That's because these variables are temporarily set to nil.
-As a result, a hook function cannot straightforwardly alter the
-value of these variables.  See the Emacs Lisp manual for a way of
-accomplishing an equivalent result by using other variables.
+That's because `inhibit-modification-hooks' is temporarily set non-nil.
 
 If an unhandled error happens in running these functions,
 the variable's value remains nil.  That prevents the error
--- a/src/callproc.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/callproc.c	Wed Oct 13 22:40:51 2010 +0900
@@ -287,21 +287,16 @@
 	if (!NILP (Vcoding_system_for_write))
 	  val = Vcoding_system_for_write;
 	else if (! must_encode)
-	  val = Qnil;
+	  val = Qraw_text;
 	else
 	  {
 	    args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
 	    args2[0] = Qcall_process;
 	    for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
 	    coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
-	    if (CONSP (coding_systems))
-	      val = XCDR (coding_systems);
-	    else if (CONSP (Vdefault_process_coding_system))
-	      val = XCDR (Vdefault_process_coding_system);
-	    else
-	      val = Qnil;
+	    val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil;
 	  }
-	val = coding_inherit_eol_type (val, Qnil);
+	val = complement_process_encoding_system (val);
 	setup_coding_system (Fcheck_coding_system (val), &argument_coding);
 	coding_attrs = CODING_ID_ATTRS (argument_coding.id);
 	if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs)))
@@ -954,20 +949,16 @@
   if (!NILP (Vcoding_system_for_write))
     val = Vcoding_system_for_write;
   else if (NILP (current_buffer->enable_multibyte_characters))
-    val = Qnil;
+    val = Qraw_text;
   else
     {
       args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2);
       args2[0] = Qcall_process_region;
       for (i = 0; i < nargs; i++) args2[i + 1] = args[i];
       coding_systems = Ffind_operation_coding_system (nargs + 1, args2);
-      if (CONSP (coding_systems))
-	val = XCDR (coding_systems);
-      else if (CONSP (Vdefault_process_coding_system))
-	val = XCDR (Vdefault_process_coding_system);
-      else
-	val = Qnil;
+      val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil;
     }
+  val = complement_process_encoding_system (val);
 
   {
     int count1 = SPECPDL_INDEX ();
--- a/src/ccl.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/ccl.c	Wed Oct 13 22:40:51 2010 +0900
@@ -450,7 +450,7 @@
    Therefore, the instruction code range is 0..16384(0x3fff).
  */
 
-/* Read a multibyte characeter.
+/* Read a multibyte character.
    A code point is stored into reg[rrr].  A charset ID is stored into
    reg[RRR].  */
 
@@ -2058,7 +2058,7 @@
 If IC is nil, it is initialized to head of the CCL program.
 
 If optional 4th arg CONTINUE is non-nil, keep IC on read operation
-when read buffer is exausted, else, IC is always set to the end of
+when read buffer is exhausted, else, IC is always set to the end of
 CCL-PROGRAM on exit.
 
 It returns the contents of write buffer as a string,
--- a/src/coding.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/coding.c	Wed Oct 13 22:40:51 2010 +0900
@@ -167,7 +167,7 @@
 
   while (1)
     {
-      /* Get one byte from the source.  If the souce is exausted, jump
+      /* Get one byte from the source.  If the source is exhausted, jump
 	 to no_more_source:.  */
       ONE_MORE_BYTE (c);
 
@@ -181,7 +181,7 @@
   return 0;
 
  no_more_source:
-  /* The source exausted successfully.  */
+  /* The source exhausted successfully.  */
   detect_info->found |= found;
   return 1;
 }
@@ -537,7 +537,7 @@
    on output.  */
 #define CODING_ISO_FLAG_DESIGNATE_AT_BOL 0x0400
 
-/* If set, do not encode unsafe charactes on output.  */
+/* If set, do not encode unsafe characters on output.  */
 #define CODING_ISO_FLAG_SAFE		0x0800
 
 /* If set, extra latin codes (128..159) are accepted as a valid code
@@ -693,7 +693,7 @@
 static Lisp_Object Vcoding_category_list;
 
 /* Table of coding categories (Lisp symbols).  This variable is for
-   internal use oly.  */
+   internal use only.  */
 static Lisp_Object Vcoding_category_table;
 
 /* Table of coding-categories ordered by priority.  */
@@ -825,7 +825,7 @@
   } while (0)
 
 
-/* Like EMIT_ONE_ASCII_BYTE byt store two bytes; C1 and C2.  */
+/* Like EMIT_ONE_ASCII_BYTE but store two bytes; C1 and C2.  */
 
 #define EMIT_TWO_ASCII_BYTES(c1, c2)	\
   do {					\
@@ -1241,7 +1241,7 @@
 
    METHOD is one of enum composition_method.
 
-   Optionnal COMPOSITION-COMPONENTS are characters and composition
+   Optional COMPOSITION-COMPONENTS are characters and composition
    rules.
 
    In the case of CODING_ANNOTATE_CHARSET_MASK, one element CHARSET-ID
@@ -1954,7 +1954,7 @@
 	CHARS is 0xA0 plus a number of characters composed by this
 	data,
 
-	COMPONENTs are characters of multibye form or composition
+	COMPONENTs are characters of multibyte form or composition
 	rules encoded by two-byte of ASCII codes.
 
    In addition, for backward compatibility, the following formats are
@@ -2031,7 +2031,7 @@
 	}
       else
 	{
-	  int more_bytes = emacs_mule_bytes[*src_base] - 1;
+	  int more_bytes = emacs_mule_bytes[c] - 1;
 
 	  while (more_bytes > 0)
 	    {
@@ -2455,8 +2455,8 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base;
   int *charbuf = coding->charbuf + coding->charbuf_used;
-  /* We may produce two annocations (charset and composition) in one
-     loop and one more charset annocation at the end.  */
+  /* We may produce two annotations (charset and composition) in one
+     loop and one more charset annotation at the end.  */
   int *charbuf_end
     = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 3);
   int consumed_chars = 0, consumed_chars_base;
@@ -2532,7 +2532,7 @@
 	  /* emacs_mule_char can load a charset map from a file, which
 	     allocates a large structure and might cause buffer text
 	     to be relocated as result.  Thus, we need to remember the
-	     original pointer to buffer text, and fixup all related
+	     original pointer to buffer text, and fix up all related
 	     pointers after the call.  */
 	  const unsigned char *orig = coding->source;
 	  EMACS_INT offset;
@@ -2559,7 +2559,7 @@
 	    cmp_status->ncomps -= nchars;
 	}
 
-      /* Now if C >= 0, we found a normally encoded characer, if C <
+      /* Now if C >= 0, we found a normally encoded character, if C <
 	 0, we found an old-style composition component character or
 	 rule.  */
 
@@ -3072,7 +3072,7 @@
 
 
 /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
-   Check if a text is encoded in one of ISO-2022 based codig systems.
+   Check if a text is encoded in one of ISO-2022 based coding systems.
    If it is, return 1, else return 0.  */
 
 static int
@@ -3484,7 +3484,7 @@
   return new_chars;
 }
 
-/* If characers are under composition, finish the composition.  */
+/* If characters are under composition, finish the composition.  */
 #define MAYBE_FINISH_COMPOSITION()				\
   do {								\
     if (cmp_status->state != COMPOSING_NO)			\
@@ -3591,8 +3591,8 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base;
   int *charbuf = coding->charbuf + coding->charbuf_used;
-  /* We may produce two annocations (charset and composition) in one
-     loop and one more charset annocation at the end.  */
+  /* We may produce two annotations (charset and composition) in one
+     loop and one more charset annotation at the end.  */
   int *charbuf_end
     = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 3);
   int consumed_chars = 0, consumed_chars_base;
@@ -3894,7 +3894,7 @@
 		goto invalid_code;
 	      /* For the moment, nested direction is not supported.
 		 So, `coding->mode & CODING_MODE_DIRECTION' zero means
-		 left-to-right, and nozero means right-to-left.  */
+		 left-to-right, and nonzero means right-to-left.  */
 	      ONE_MORE_BYTE (c1);
 	      switch (c1)
 		{
@@ -4528,7 +4528,10 @@
   charset_list = CODING_ATTR_CHARSET_LIST (attrs);
   coding->safe_charsets = SDATA (CODING_ATTR_SAFE_CHARSETS (attrs));
 
-  ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs));
+  ascii_compatible
+    = (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))
+       && ! (CODING_ISO_FLAGS (coding) & (CODING_ISO_FLAG_DESIGNATION
+					  | CODING_ISO_FLAG_LOCKING_SHIFT)));
 
   while (charbuf < charbuf_end)
     {
@@ -4804,7 +4807,7 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base;
   int *charbuf = coding->charbuf + coding->charbuf_used;
-  /* We may produce one charset annocation in one loop and one more at
+  /* We may produce one charset annotation in one loop and one more at
      the end.  */
   int *charbuf_end
     = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2);
@@ -4923,7 +4926,7 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base;
   int *charbuf = coding->charbuf + coding->charbuf_used;
-  /* We may produce one charset annocation in one loop and one more at
+  /* We may produce one charset annotation in one loop and one more at
      the end.  */
   int *charbuf_end
     = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2);
@@ -5589,7 +5592,7 @@
   const unsigned char *src_end = coding->source + coding->src_bytes;
   const unsigned char *src_base;
   int *charbuf = coding->charbuf + coding->charbuf_used;
-  /* We may produce one charset annocation in one loop and one more at
+  /* We may produce one charset annotation in one loop and one more at
      the end.  */
   int *charbuf_end
     = coding->charbuf + coding->charbuf_size - (MAX_ANNOTATION_LENGTH * 2);
@@ -6070,10 +6073,9 @@
 }
 
 
-/* If CODING_SYSTEM doesn't specify end-of-line format but PARENT
-   does, return one of the subsidiary that has the same eol-spec as
-   PARENT.  Otherwise, return CODING_SYSTEM.  If PARENT is nil,
-   inherit end-of-line format from the system's setting
+/* If CODING_SYSTEM doesn't specify end-of-line format, return one of
+   the subsidiary that has the same eol-spec as PARENT (if it is not
+   nil and specifies end-of-line format) or the system's setting
    (system_eol_type).  */
 
 Lisp_Object
@@ -6096,6 +6098,8 @@
 
 	  parent_spec = CODING_SYSTEM_SPEC (parent);
 	  parent_eol_type = AREF (parent_spec, 2);
+	  if (VECTORP (parent_eol_type))
+	    parent_eol_type = system_eol_type;	    
 	}
       else
 	parent_eol_type = system_eol_type;
@@ -6109,6 +6113,46 @@
   return coding_system;
 }
 
+
+/* Check if text-conversion and eol-conversion of CODING_SYSTEM are
+   decided for writing to a process.  If not, complement them, and
+   return a new coding system.  */
+
+Lisp_Object
+complement_process_encoding_system (coding_system)
+     Lisp_Object coding_system;
+{
+  Lisp_Object coding_base = Qnil, eol_base = Qnil;
+  Lisp_Object spec, attrs;
+  int i;
+
+  for (i = 0; i < 3; i++)
+    {
+      if (i == 1)
+	coding_system = CDR_SAFE (Vdefault_process_coding_system);
+      else if (i == 2)
+	coding_system = preferred_coding_system ();
+      spec = CODING_SYSTEM_SPEC (coding_system);
+      if (NILP (spec))
+	continue;
+      attrs = AREF (spec, 0);
+      if (NILP (coding_base) && ! EQ (CODING_ATTR_TYPE (attrs), Qundecided))
+	coding_base = CODING_ATTR_BASE_NAME (attrs);
+      if (NILP (eol_base) && ! VECTORP (AREF (spec, 2)))
+	eol_base = coding_system;
+      if (! NILP (coding_base) && ! NILP (eol_base))
+	break;
+    }
+
+  if (i > 0)
+    /* The original CODING_SYSTEM didn't specify text-conversion or
+       eol-conversion.  Be sure that we return a fully complemented
+       coding system.  */
+    coding_system = coding_inherit_eol_type (coding_base, eol_base);
+  return coding_system;
+}
+
+
 /* Emacs has a mechanism to automatically detect a coding system if it
    is one of Emacs' internal format, ISO2022, SJIS, and BIG5.  But,
    it's impossible to distinguish some coding systems accurately
@@ -6159,14 +6203,14 @@
    o coding-category-iso-7-else
 
    	The category for a coding system which has the same code range
-	as ISO2022 of 7-bit environemnt but uses locking shift or
+	as ISO2022 of 7-bit environment but uses locking shift or
 	single shift functions.  Assigned the coding-system (Lisp
 	symbol) `iso-2022-7bit-lock' by default.
 
    o coding-category-iso-8-else
 
    	The category for a coding system which has the same code range
-	as ISO2022 of 8-bit environemnt but uses locking shift or
+	as ISO2022 of 8-bit environment but uses locking shift or
 	single shift functions.  Assigned the coding-system (Lisp
 	symbol) `iso-2022-8bit-ss2' by default.
 
@@ -7591,7 +7635,7 @@
 static int reused_workbuf_in_use;
 
 
-/* Return a working buffer of code convesion.  MULTIBYTE specifies the
+/* Return a working buffer of code conversion.  MULTIBYTE specifies the
    multibyteness of returning buffer.  */
 
 static Lisp_Object
@@ -8254,7 +8298,7 @@
 
 /* Detect how the bytes at SRC of length SRC_BYTES are encoded.  If
    HIGHEST is nonzero, return the coding system of the highest
-   priority among the detected coding systems.  Otherwize return a
+   priority among the detected coding systems.  Otherwise return a
    list of detected coding systems sorted by their priorities.  If
    MULTIBYTEP is nonzero, it is assumed that the bytes are in correct
    multibyte form but contains only ASCII and eight-bit chars.
@@ -9379,7 +9423,7 @@
   setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
   /* We had better not send unsafe characters to terminal.  */
   terminal_coding->mode |= CODING_MODE_SAFE_ENCODING;
-  /* Characer composition should be disabled.  */
+  /* Character composition should be disabled.  */
   terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
   terminal_coding->src_multibyte = 1;
   terminal_coding->dst_multibyte = 0;
@@ -9396,7 +9440,7 @@
   CHECK_SYMBOL (coding_system);
   setup_coding_system (Fcheck_coding_system (coding_system),
 		       &safe_terminal_coding);
-  /* Characer composition should be disabled.  */
+  /* Character composition should be disabled.  */
   safe_terminal_coding.common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK;
   safe_terminal_coding.src_multibyte = 1;
   safe_terminal_coding.dst_multibyte = 0;
@@ -9433,7 +9477,7 @@
   else
     Fcheck_coding_system (coding_system);
   setup_coding_system (coding_system, TERMINAL_KEYBOARD_CODING (t));
-  /* Characer composition should be disabled.  */
+  /* Character composition should be disabled.  */
   TERMINAL_KEYBOARD_CODING (t)->common_flags
     &= ~CODING_ANNOTATE_COMPOSITION_MASK;
   return Qnil;
@@ -9810,7 +9854,7 @@
 
 	 If Nth element is a list of charset IDs, N is the first byte
 	 of one of them.  The list is sorted by dimensions of the
-	 charsets.  A charset of smaller dimension comes firtst. */
+	 charsets.  A charset of smaller dimension comes first. */
       val = Fmake_vector (make_number (256), Qnil);
 
       for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
--- a/src/coding.h	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/coding.h	Wed Oct 13 22:40:51 2010 +0900
@@ -707,6 +707,7 @@
 						     int));
 extern Lisp_Object raw_text_coding_system P_ ((Lisp_Object));
 extern Lisp_Object coding_inherit_eol_type P_ ((Lisp_Object, Lisp_Object));
+extern Lisp_Object complement_process_encoding_system P_ ((Lisp_Object));
 
 extern int decode_coding_gap P_ ((struct coding_system *,
 				  EMACS_INT, EMACS_INT));
--- a/src/dbusbind.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/dbusbind.c	Wed Oct 13 22:40:51 2010 +0900
@@ -854,6 +854,9 @@
 					    NULL, (void*) XHASH (bus), NULL))
     XD_SIGNAL1 (build_string ("Cannot add watch functions"));
 
+  /* We do not want to abort.  */
+  putenv ("DBUS_FATAL_WARNINGS=0");
+
   /* Return.  */
   return Qnil;
 }
@@ -1568,7 +1571,7 @@
 
 /* Check, whether there is pending input in the message queue of the
    D-Bus BUS.  BUS is a Lisp symbol, either :system or :session.  */
-int
+static Lisp_Object
 xd_get_dispatch_status (bus)
      Lisp_Object bus;
 {
@@ -1584,23 +1587,34 @@
   return
     (dbus_connection_get_dispatch_status (connection)
      == DBUS_DISPATCH_DATA_REMAINS)
-    ? TRUE : FALSE;
+    ? Qt : Qnil;
 }
 
 /* Check for queued incoming messages from the system and session buses.  */
 int
 xd_pending_messages ()
 {
+  int ret = FALSE;
+  xd_in_read_queued_messages = 1;
 
   /* Vdbus_registered_objects_table will be initialized as hash table
      in dbus.el.  When this package isn't loaded yet, it doesn't make
      sense to handle D-Bus messages.  */
-  return (HASH_TABLE_P (Vdbus_registered_objects_table)
-	  ? (xd_get_dispatch_status (QCdbus_system_bus)
-	     || ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL)
-		 ? xd_get_dispatch_status (QCdbus_session_bus)
-		 : FALSE))
-	  : FALSE);
+  if (HASH_TABLE_P (Vdbus_registered_objects_table))
+    {
+      ret = (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
+				    QCdbus_system_bus)));
+      if (ret) goto theend;
+
+      ret = ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL) &&
+	     (!NILP (internal_catch (Qdbus_error, xd_get_dispatch_status,
+				     QCdbus_session_bus))));
+    }
+
+  /* Return.  */
+ theend:
+  xd_in_read_queued_messages = 0;
+  return ret;
 }
 
 /* Read queued incoming message of the D-Bus BUS.  BUS is a Lisp
@@ -2130,6 +2144,9 @@
     doc: /* If non-nil, debug messages of D-Bus bindings are raised.  */);
 #ifdef DBUS_DEBUG
   Vdbus_debug = Qt;
+  /* We can also set environment variable DBUS_VERBOSE=1 in order to
+     see more traces.  This requires libdbus-1 to be configured with
+     --enable-verbose-mode.  */
 #else
   Vdbus_debug = Qnil;
 #endif
--- a/src/dispextern.h	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/dispextern.h	Wed Oct 13 22:40:51 2010 +0900
@@ -1694,7 +1694,7 @@
    This macro is only meaningful for multibyte character CHAR.  */
 
 #define FACE_FOR_CHAR(F, FACE, CHAR, POS, OBJECT)	\
-  (ASCII_CHAR_P (CHAR)					\
+  ((ASCII_CHAR_P (CHAR) || CHAR_BYTE8_P (CHAR))		\
    ? (FACE)->ascii_face->id				\
    : face_for_char ((F), (FACE), (CHAR), (POS), (OBJECT)))
 
@@ -1873,7 +1873,7 @@
      are not iterating over a composition now.  */
   int id;
   /* If non-negative, character that triggers the automatic
-     composition at `stop_pos', and this is an automatic compositoin.
+     composition at `stop_pos', and this is an automatic composition.
      If negative, this is a static composition.  This is set to -2
      temporarily if searching of composition reach a limit or a
      newline.  */
@@ -2131,9 +2131,11 @@
      composition.  */
   struct composition_it cmp_it;
 
-  /* The character to display, possibly translated to multibyte
-     if unibyte_display_via_language_environment is set.  This
-     is set after produce_glyphs has been called.  */
+  /* The character to display, possibly translated to multibyte if
+     multibyte_p is zero or unibyte_display_via_language_environment
+     is set.  This is set after get_next_display_element has been
+     called.  If we are setting it->C directly before calling
+     PRODUCE_GLYPHS, this should be set beforehand too.  */
   int char_to_display;
 
   /* If what == IT_IMAGE, the id of the image to display.  */
--- a/src/font.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/font.c	Wed Oct 13 22:40:51 2010 +0900
@@ -4634,7 +4634,7 @@
        doc: /* Return a list of variation glyphs for CHAR in FONT-OBJECT.
 Each element of the value is a cons (VARIATION-SELECTOR . GLYPH-ID),
 where
-  VARIATION-SELECTOR is a chracter code of variation selection
+  VARIATION-SELECTOR is a character code of variation selection
     (#xFE00..#xFE0F or #xE0100..#xE01EF)
   GLYPH-ID is a glyph code of the corresponding variation glyph.  */)
      (font_object, character)
--- a/src/font.h	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/font.h	Wed Oct 13 22:40:51 2010 +0900
@@ -574,7 +574,7 @@
      FONT-ENTITY and it must be opened to check it, return -1.  */
   int (*has_char) P_ ((Lisp_Object font, int c));
 
-  /* Return a glyph code of FONT for characer C (Unicode code point).
+  /* Return a glyph code of FONT for character C (Unicode code point).
      If FONT doesn't have such a glyph, return FONT_INVALID_CODE.  */
   unsigned (*encode_char) P_ ((struct font *font, int c));
 
--- a/src/frame.h	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/frame.h	Wed Oct 13 22:40:51 2010 +0900
@@ -306,7 +306,7 @@
   /* Canonical X unit.  Width of default font, in pixels.  */
   int column_width;
 
-  /* Widht of space glyph of default font, in pixels.  */
+  /* Width of space glyph of default font, in pixels.  */
   int space_width;
 
   /* Canonical Y unit.  Height of a line, in pixels.  */
--- a/src/gtkutil.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/gtkutil.c	Wed Oct 13 22:40:51 2010 +0900
@@ -3590,6 +3590,8 @@
       GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton));
       GtkImageType store_type = gtk_image_get_storage_type (wimage);
 
+      g_object_set (G_OBJECT (settings), "gtk-menu-images", TRUE, NULL);
+
       if (store_type == GTK_IMAGE_STOCK)
         {
           gchar *stock_id;
--- a/src/keyboard.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/keyboard.c	Wed Oct 13 22:40:51 2010 +0900
@@ -4106,6 +4106,11 @@
       /* One way or another, wait until input is available; then, if
 	 interrupt handlers have not read it, read it now.  */
 
+#ifdef HAVE_DBUS
+      /* Read D-Bus messages.  */
+      xd_read_queued_messages ();
+#endif /* HAVE_DBUS */
+
 /* Note SIGIO has been undef'd if FIONREAD is missing.  */
 #ifdef SIGIO
       gobble_input (0);
@@ -4757,7 +4762,7 @@
 {
   EMACS_TIME nexttime;
 
-  do 
+  do
     {
       nexttime = timer_check_2 ();
     }
@@ -7051,11 +7056,6 @@
 gobble_input (expected)
      int expected;
 {
-#ifdef HAVE_DBUS
-  /* Read D-Bus messages.  */
-  xd_read_queued_messages ();
-#endif /* HAVE_DBUS */
-
 #ifdef SIGIO
   if (interrupt_input)
     {
--- a/src/nsterm.m	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/nsterm.m	Wed Oct 13 22:40:51 2010 +0900
@@ -142,22 +142,27 @@
 Lisp_Object Vx_toolkit_scroll_bars;
 static Lisp_Object Qmodifier_value;
 Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qsuper, Qnone;
-extern Lisp_Object Qcursor_color, Qcursor_type, Qns;
+extern Lisp_Object Qcursor_color, Qcursor_type, Qns, Qleft;
 
 /* Specifies which emacs modifier should be generated when NS receives
-   the Alternate modifer.  May be Qnone or any of the modifier lisp symbols. */
+   the Alternate modifier.  May be Qnone or any of the modifier lisp symbols. */
 Lisp_Object ns_alternate_modifier;
 
 /* Specifies which emacs modifier should be generated when NS receives
-   the Command modifer.  May be any of the modifier lisp symbols. */
+   the right Alternate modifier.  Has same values as ns_alternate_modifier plus
+   the value Qleft which means whatever value ns_alternate_modifier has.  */
+Lisp_Object ns_right_alternate_modifier;
+
+/* Specifies which emacs modifier should be generated when NS receives
+   the Command modifier.  May be any of the modifier lisp symbols. */
 Lisp_Object ns_command_modifier;
 
 /* Specifies which emacs modifier should be generated when NS receives
-   the Control modifer.  May be any of the modifier lisp symbols. */
+   the Control modifier.  May be any of the modifier lisp symbols. */
 Lisp_Object ns_control_modifier;
 
 /* Specifies which emacs modifier should be generated when NS receives
-   the Function modifer (laptops).  May be any of the modifier lisp symbols. */
+   the Function modifier (laptops).  May be any of the modifier lisp symbols. */
 Lisp_Object ns_function_modifier;
 
 /* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */
@@ -218,12 +223,17 @@
 
 /* Convert modifiers in a NeXTSTEP event to emacs style modifiers.  */
 #define NS_FUNCTION_KEY_MASK 0x800000
+#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
 #define EV_MODIFIERS(e)                               \
     ((([e modifierFlags] & NSHelpKeyMask) ?           \
            hyper_modifier : 0)                        \
-     | (([e modifierFlags] & NSAlternateKeyMask) ?    \
+     | (!EQ (ns_right_alternate_modifier, Qleft) && \
+        (([e modifierFlags] & NSRightAlternateKeyMask) \
+         == NSRightAlternateKeyMask) ? \
+           parse_solitary_modifier (ns_right_alternate_modifier) : 0) \
+     | (([e modifierFlags] & NSAlternateKeyMask) ?                 \
            parse_solitary_modifier (ns_alternate_modifier) : 0)   \
-     | (([e modifierFlags] & NSShiftKeyMask) ?        \
+     | (([e modifierFlags] & NSShiftKeyMask) ?     \
            shift_modifier : 0)                        \
      | (([e modifierFlags] & NSControlKeyMask) ?      \
            parse_solitary_modifier (ns_control_modifier) : 0)     \
@@ -4423,7 +4433,13 @@
           emacs_event->modifiers |=
             parse_solitary_modifier (ns_function_modifier);
 
-      if (flags & NSAlternateKeyMask) /* default = meta */
+      if (!EQ (ns_right_alternate_modifier, Qleft)
+          && ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)) 
+	{
+	  emacs_event->modifiers |= parse_solitary_modifier
+            (ns_right_alternate_modifier);
+	}
+      else if (flags & NSAlternateKeyMask) /* default = meta */
         {
           if ((NILP (ns_alternate_modifier) || EQ (ns_alternate_modifier, Qnone))
               && !fnKeysym)
@@ -6185,6 +6201,14 @@
 at all, allowing it to be used at a lower level for accented character entry.");
   ns_alternate_modifier = Qmeta;
 
+  DEFVAR_LISP ("ns-right-alternate-modifier", &ns_right_alternate_modifier,
+               "This variable describes the behavior of the right alternate or option key.\n\
+Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
+Set to left means be the same key as `ns-alternate-modifier'.\n\
+Set to none means that the alternate / option key is not interpreted by Emacs\n\
+at all, allowing it to be used at a lower level for accented character entry.");
+  ns_right_alternate_modifier = Qleft;
+
   DEFVAR_LISP ("ns-command-modifier", &ns_command_modifier,
                "This variable describes the behavior of the command key.\n\
 Set to control, meta, alt, super, or hyper means it is taken to be that key.");
--- a/src/print.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/print.c	Wed Oct 13 22:40:51 2010 +0900
@@ -1450,7 +1450,7 @@
 #define PRINT_STRING_NON_CHARSET_FOUND 1
 #define PRINT_STRING_UNSAFE_CHARSET_FOUND 2
 
-/* Bitwize or of the abobe macros. */
+/* Bitwise or of the above macros. */
 static int print_check_string_result;
 
 static void
--- a/src/process.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/process.c	Wed Oct 13 22:40:51 2010 +0900
@@ -1727,6 +1727,11 @@
 	  val = XCDR (Vdefault_process_coding_system);
       }
     XPROCESS (proc)->encode_coding_system = val;
+    /* Note: At this momemnt, the above coding system may leave
+       text-conversion or eol-conversion unspecified.  They will be
+       decided after we read output from the process and decode it by
+       some coding system, or just before we actually send a text to
+       the process.  */
   }
 
 
@@ -1769,6 +1774,7 @@
 	tem = Fsubstring (tem, make_number (2), Qnil);
 
       {
+	Lisp_Object arg_encoding = Qnil;
 	struct gcpro gcpro1;
 	GCPRO1 (tem);
 
@@ -1786,9 +1792,14 @@
 	    tem = Fcons (args[i], tem);
 	    CHECK_STRING (XCAR (tem));
 	    if (STRING_MULTIBYTE (XCAR (tem)))
-	      XSETCAR (tem,
-		       code_convert_string_norecord
-		       (XCAR (tem), XPROCESS (proc)->encode_coding_system, 1));
+	      {
+		if (NILP (arg_encoding))
+		  arg_encoding = (complement_process_encoding_system
+				  (XPROCESS (proc)->encode_coding_system));
+		XSETCAR (tem,
+			 code_convert_string_norecord
+			 (XCAR (tem), arg_encoding, 1));
+	      }
 	  }
 
 	UNGCPRO;
@@ -5690,12 +5701,21 @@
 	  && !NILP (XBUFFER (object)->enable_multibyte_characters))
       || EQ (object, Qt))
     {
+      p->encode_coding_system
+	= complement_process_encoding_system (p->encode_coding_system);
       if (!EQ (Vlast_coding_system_used, p->encode_coding_system))
-	/* The coding system for encoding was changed to raw-text
-	   because we sent a unibyte text previously.  Now we are
-	   sending a multibyte text, thus we must encode it by the
-	   original coding system specified for the current process.  */
-	setup_coding_system (p->encode_coding_system, coding);
+	{
+	  /* The coding system for encoding was changed to raw-text
+	     because we sent a unibyte text previously.  Now we are
+	     sending a multibyte text, thus we must encode it by the
+	     original coding system specified for the current process.
+
+	     Another reason we comming here is that the coding system
+	     was just complemented and new one was returned by
+	     complement_process_encoding_system.  */
+	  setup_coding_system (p->encode_coding_system, coding);
+	  Vlast_coding_system_used = p->encode_coding_system;
+	}
       coding->src_multibyte = 1;
     }
   else
--- a/src/regex.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/regex.c	Wed Oct 13 22:40:51 2010 +0900
@@ -4145,7 +4145,7 @@
 		   && match_any_multibyte_characters == false)
 	    {
 	      /* Set fastmap[I] to 1 where I is a leading code of each
-		 multibyte characer in the range table. */
+		 multibyte character in the range table. */
 	      int c, count;
 	      unsigned char lc1, lc2;
 
--- a/src/syntax.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/syntax.c	Wed Oct 13 22:40:51 2010 +0900
@@ -512,6 +512,7 @@
     {
       int temp_byte, prev_syntax;
       int com2start, com2end;
+      int comstart;
 
       /* Move back and examine a character.  */
       DEC_BOTH (from, from_byte);
@@ -530,7 +531,8 @@
 		       || SYNTAX_FLAGS_COMMENT_NESTED (syntax)) == comnested);
       com2end = (SYNTAX_FLAGS_COMEND_FIRST (syntax)
 		 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax));
-
+      comstart = (com2start || code == Scomment);
+      
       /* Nasty cases with overlapping 2-char comment markers:
 	 - snmp-mode: -- c -- foo -- c --
 	              --- c --
@@ -541,15 +543,16 @@
 		      ///   */
 
       /* If a 2-char comment sequence partly overlaps with another,
-	 we don't try to be clever.  */
-      if (from > stop && (com2end || com2start))
+	 we don't try to be clever.  E.g. |*| in C, or }% in modes that
+	 have %..\n and %{..}%.  */
+      if (from > stop && (com2end || comstart))
 	{
 	  int next = from, next_byte = from_byte, next_c, next_syntax;
 	  DEC_BOTH (next, next_byte);
 	  UPDATE_SYNTAX_TABLE_BACKWARD (next);
 	  next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte);
 	  next_syntax = SYNTAX_WITH_FLAGS (next_c);
-	  if (((com2start || comnested)
+	  if (((comstart || comnested)
 	       && SYNTAX_FLAGS_COMEND_SECOND (syntax)
 	       && SYNTAX_FLAGS_COMEND_FIRST (next_syntax))
 	      || ((com2end || comnested)
--- a/src/term.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/term.c	Wed Oct 13 22:40:51 2010 +0900
@@ -250,7 +250,6 @@
             cmputc ('\n');
         }
 
-      OUTPUT_IF (tty, tty->TS_termcap_modes);
       OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
       OUTPUT_IF (tty, tty->TS_keypad_mode);
       losecursor (tty);
@@ -695,12 +694,8 @@
 						  encode_terminal_src_size);
 		  buf = encode_terminal_src + nbytes;
 		}
-	      if (CHAR_BYTE8_P (c))
-		{
-		  *buf++ = CHAR_TO_BYTE8 (c);
-		  nchars++;
-		}
-	      else if (char_charset (c, charset_list, NULL))
+	      if (CHAR_BYTE8_P (c)
+		  || char_charset (c, charset_list, NULL))
 		{
 		  /* Store the multibyte form of C at BUF.  */
 		  buf += CHAR_STRING (c, buf);
@@ -1610,18 +1605,15 @@
       goto done;
     }
 
-  /* Maybe translate single-byte characters to multibyte.  */
-  it->char_to_display = it->c;
-
-  if (it->c >= 040 && it->c < 0177)
+  if (it->char_to_display >= 040 && it->char_to_display < 0177)
     {
       it->pixel_width = it->nglyphs = 1;
       if (it->glyph_row)
 	append_glyph (it);
     }
-  else if (it->c == '\n')
+  else if (it->char_to_display == '\n')
     it->pixel_width = it->nglyphs = 0;
-  else if (it->c == '\t')
+  else if (it->char_to_display == '\t')
     {
       int absolute_x = (it->current_x
 			+ it->continuation_lines_width);
@@ -1652,32 +1644,19 @@
       it->pixel_width = nspaces;
       it->nglyphs = nspaces;
     }
-  else if (CHAR_BYTE8_P (it->c))
+  else if (CHAR_BYTE8_P (it->char_to_display))
     {
-      if (unibyte_display_via_language_environment
-	  && (it->c >= 0240))
-	{
-	  it->char_to_display = BYTE8_TO_CHAR (it->c);
-	  it->pixel_width = CHAR_WIDTH (it->char_to_display);
-	  it->nglyphs = it->pixel_width;
-	  if (it->glyph_row)
-	    append_glyph (it);
-	}
-      else
-	{
-	  /* Coming here means that it->c is from display table, thus
-	     we must send the raw 8-bit byte as is to the terminal.
-	     Although there's no way to know how many columns it
-	     occupies on a screen, it is a good assumption that a
-	     single byte code has 1-column width.  */
-	  it->pixel_width = it->nglyphs = 1;
-	  if (it->glyph_row)
-	    append_glyph (it);
-	}
+      /* Coming here means that we must send the raw 8-bit byte as is
+	 to the terminal.  Although there's no way to know how many
+	 columns it occupies on a screen, it is a good assumption that
+	 a single byte code has 1-column width.  */
+      it->pixel_width = it->nglyphs = 1;
+      if (it->glyph_row)
+	append_glyph (it);
     }
   else
     {
-      it->pixel_width = CHAR_WIDTH (it->c);
+      it->pixel_width = CHAR_WIDTH (it->char_to_display);
       it->nglyphs = it->pixel_width;
 
       if (it->glyph_row)
@@ -1892,7 +1871,7 @@
   else
     abort ();
 
-  temp_it.c = GLYPH_CHAR (glyph);
+  temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
   temp_it.face_id = GLYPH_FACE (glyph);
   temp_it.len = CHAR_BYTES (temp_it.c);
 
--- a/src/w32font.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/w32font.c	Wed Oct 13 22:40:51 2010 +0900
@@ -346,7 +346,7 @@
 }
 
 /* w32 implementation of encode_char for font backend.
-   Return a glyph code of FONT for characer C (Unicode code point).
+   Return a glyph code of FONT for character C (Unicode code point).
    If FONT doesn't have such a glyph, return FONT_INVALID_CODE.
 
    For speed, the gdi backend uses unicode (Emacs calls encode_char
--- a/src/w32uniscribe.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/w32uniscribe.c	Wed Oct 13 22:40:51 2010 +0900
@@ -448,7 +448,7 @@
 }
 
 /* Uniscribe implementation of encode_char for font backend.
-   Return a glyph code of FONT for characer C (Unicode code point).
+   Return a glyph code of FONT for character C (Unicode code point).
    If FONT doesn't have such a glyph, return FONT_INVALID_CODE.  */
 static unsigned
 uniscribe_encode_char (font, c)
--- a/src/xdisp.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/xdisp.c	Wed Oct 13 22:40:51 2010 +0900
@@ -5664,11 +5664,24 @@
 	  Lisp_Object dv;
 	  struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
 	  enum { char_is_other = 0, char_is_nbsp, char_is_soft_hyphen }
-	       nbsp_or_shy = char_is_other;
-	  int decoded = it->c;
+	  nbsp_or_shy = char_is_other;
+	  int c = it->c;	/* This is the character to display.  */
+
+	  if (! it->multibyte_p && ! ASCII_CHAR_P (c))
+	    {
+	      xassert (SINGLE_BYTE_CHAR_P (c));
+	      if (unibyte_display_via_language_environment)
+		{
+		  c = DECODE_CHAR (unibyte, c);
+		  if (c < 0)
+		    c = BYTE8_TO_CHAR (it->c);
+		}
+	      else
+		c = BYTE8_TO_CHAR (it->c);
+	    }
 
 	  if (it->dp
-	      && (dv = DISP_CHAR_VECTOR (it->dp, it->c),
+	      && (dv = DISP_CHAR_VECTOR (it->dp, c),
 		  VECTORP (dv)))
 	    {
 	      struct Lisp_Vector *v = XVECTOR (dv);
@@ -5694,21 +5707,10 @@
 	      goto get_next;
 	    }
 
-	  if (unibyte_display_via_language_environment
-	      && !ASCII_CHAR_P (it->c))
-	    decoded = DECODE_CHAR (unibyte, it->c);
-
-	  if (it->c >= 0x80 && ! NILP (Vnobreak_char_display))
-	    {
-	      if (it->multibyte_p)
-		nbsp_or_shy = (it->c == 0xA0   ? char_is_nbsp
-			       : it->c == 0xAD ? char_is_soft_hyphen
-			       :                 char_is_other);
-	      else if (unibyte_display_via_language_environment)
-		nbsp_or_shy = (decoded == 0xA0   ? char_is_nbsp
-			       : decoded == 0xAD ? char_is_soft_hyphen
-			       :                   char_is_other);
-	    }
+	  if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
+	    nbsp_or_shy = (c == 0xA0   ? char_is_nbsp
+			   : c == 0xAD ? char_is_soft_hyphen
+			   :             char_is_other);
 
 	  /* Translate control characters into `\003' or `^C' form.
 	     Control characters coming from a display table entry are
@@ -5716,27 +5718,23 @@
 	     the translation.  This could easily be changed but I
 	     don't believe that it is worth doing.
 
-	     If it->multibyte_p is nonzero, non-printable non-ASCII
-	     characters are also translated to octal form.
-
-	     If it->multibyte_p is zero, eight-bit characters that
-	     don't have corresponding multibyte char code are also
+	     NBSP and SOFT-HYPEN are property translated too.
+
+	     Non-printable characters and raw-byte characters are also
 	     translated to octal form.  */
-	  if ((it->c < ' '
+	  if (((c < ' ' || c == 127) /* ASCII control chars */
 	       ? (it->area != TEXT_AREA
 		  /* In mode line, treat \n, \t like other crl chars.  */
-		  || (it->c != '\t'
+		  || (c != '\t'
 		      && it->glyph_row
 		      && (it->glyph_row->mode_line_p || it->avoid_cursor_p))
-		  || (it->c != '\n' && it->c != '\t'))
+		  || (c != '\n' && c != '\t'))
 	       : (nbsp_or_shy
-		  || (it->multibyte_p
-		      ? ! CHAR_PRINTABLE_P (it->c)
-		      : (! unibyte_display_via_language_environment
-			 ? it->c >= 0x80
-			 : (decoded >= 0x80 && decoded < 0xA0))))))
-	    {
-	      /* IT->c is a control character which must be displayed
+		  || CHAR_BYTE8_P (c)
+		  || ! CHAR_PRINTABLE_P (c))))
+	    {
+	      /* C is a control character, NBSP, SOFT-HYPEN, raw-byte,
+		 or a non-printable character which must be displayed
 		 either as '\003' or as `^C' where the '\\' and '^'
 		 can be defined in the display table.  Fill
 		 IT->ctl_chars with glyphs for what we have to
@@ -5748,7 +5746,7 @@
 
 	      /* Handle control characters with ^.  */
 
-	      if (it->c < 128 && it->ctl_arrow_p)
+	      if (ASCII_CHAR_P (c) && it->ctl_arrow_p)
 		{
 		  int g;
 
@@ -5781,7 +5779,7 @@
 		    }
 
 		  XSETINT (it->ctl_chars[0], g);
-		  XSETINT (it->ctl_chars[1], it->c ^ 0100);
+		  XSETINT (it->ctl_chars[1], c ^ 0100);
 		  ctl_len = 2;
 		  goto display_control;
 		}
@@ -5796,7 +5794,7 @@
 		  face_id = merge_faces (it->f, Qnobreak_space, 0,
 					 it->face_id);
 
-		  it->c = ' ';
+		  c = ' ';
 		  XSETINT (it->ctl_chars[0], ' ');
 		  ctl_len = 1;
 		  goto display_control;
@@ -5842,7 +5840,6 @@
 	      if (EQ (Vnobreak_char_display, Qt)
 		  && nbsp_or_shy == char_is_soft_hyphen)
 		{
-		  it->c = '-';
 		  XSETINT (it->ctl_chars[0], '-');
 		  ctl_len = 1;
 		  goto display_control;
@@ -5854,55 +5851,25 @@
 	      if (nbsp_or_shy)
 		{
 		  XSETINT (it->ctl_chars[0], escape_glyph);
-		  it->c = (nbsp_or_shy == char_is_nbsp ? ' ' : '-');
-		  XSETINT (it->ctl_chars[1], it->c);
+		  c = (nbsp_or_shy == char_is_nbsp ? ' ' : '-');
+		  XSETINT (it->ctl_chars[1], c);
 		  ctl_len = 2;
 		  goto display_control;
 		}
 
 	      {
-		unsigned char str[MAX_MULTIBYTE_LENGTH];
-		int len;
-		int i;
-
-		/* Set IT->ctl_chars[0] to the glyph for `\\'.  */
-		if (CHAR_BYTE8_P (it->c))
-		  {
-		    str[0] = CHAR_TO_BYTE8 (it->c);
-		    len = 1;
-		  }
-		else if (it->c < 256)
-		  {
-		    str[0] = it->c;
-		    len = 1;
-		  }
-		else
-		  {
-		    /* It's an invalid character, which shouldn't
-		       happen actually, but due to bugs it may
-		       happen.  Let's print the char as is, there's
-		       not much meaningful we can do with it.  */
-		      str[0] = it->c;
-		      str[1] = it->c >> 8;
-		      str[2] = it->c >> 16;
-		      str[3] = it->c >> 24;
-		      len = 4;
-		    }
-
+		char str[10];
+		int len, i;
+
+		if (CHAR_BYTE8_P (c))
+		  /* Display \200 instead of \17777600.  */
+		  c = CHAR_TO_BYTE8 (c);
+		len = sprintf (str, "%03o", c);
+
+		XSETINT (it->ctl_chars[0], escape_glyph);
 		for (i = 0; i < len; i++)
-		  {
-		    int g;
-		    XSETINT (it->ctl_chars[i * 4], escape_glyph);
-		    /* Insert three more glyphs into IT->ctl_chars for
-		       the octal display of the character.  */
-		    g = ((str[i] >> 6) & 7) + '0';
-		    XSETINT (it->ctl_chars[i * 4 + 1], g);
-		    g = ((str[i] >> 3) & 7) + '0';
-		    XSETINT (it->ctl_chars[i * 4 + 2], g);
-		    g = (str[i] & 7) + '0';
-		    XSETINT (it->ctl_chars[i * 4 + 3], g);
-		  }
-		ctl_len = len * 4;
+		  XSETINT (it->ctl_chars[i + 1], str[i]);
+		ctl_len = len + 1;
 	      }
 
 	    display_control:
@@ -5917,6 +5884,11 @@
 	      it->ellipsis_p = 0;
 	      goto get_next;
 	    }
+	  it->char_to_display = c;
+	}
+      else if (success_p)
+	{
+	  it->char_to_display = it->c;
 	}
     }
 
@@ -5943,7 +5915,8 @@
 		     : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
 		     : IT_CHARPOS (*it));
 
-	  it->face_id = FACE_FOR_CHAR (it->f, face, it->c, pos, it->string);
+	  it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos,
+				       it->string);
 	}
     }
 #endif
@@ -15871,15 +15844,19 @@
 
       /* Get the next character.  */
       if (multibyte_p)
-	it.c = string_char_and_length (p, &it.len);
-      else
-	it.c = *p, it.len = 1;
+	it.c = it.char_to_display = string_char_and_length (p, &it.len);
+      else
+	{
+	  it.c = it.char_to_display = *p, it.len = 1;
+	  if (! ASCII_CHAR_P (it.c))
+	    it.char_to_display = BYTE8_TO_CHAR (it.c);
+	}
       p += it.len;
 
       /* Get its face.  */
       ilisp = make_number (p - arrow_string);
       face = Fget_text_property (ilisp, Qface, overlay_arrow_string);
-      it.face_id = compute_char_face (f, it.c, face);
+      it.face_id = compute_char_face (f, it.char_to_display, face);
 
       /* Compute its width, get its glyphs.  */
       n_glyphs_before = it.glyph_row->used[TEXT_AREA];
@@ -16078,6 +16055,7 @@
 	     append_space_for_newline has been called.  */
 	  enum display_element_type saved_what = it->what;
 	  int saved_c = it->c, saved_len = it->len;
+	  int saved_char_to_display = it->char_to_display;
 	  int saved_x = it->current_x;
 	  int saved_face_id = it->face_id;
 	  struct text_pos saved_pos;
@@ -16090,7 +16068,7 @@
 	  it->what = IT_CHARACTER;
 	  bzero (&it->position, sizeof it->position);
 	  it->object = make_number (0);
-	  it->c = ' ';
+	  it->c = it->char_to_display = ' ';
 	  it->len = 1;
 
 	  if (default_face_p)
@@ -16111,6 +16089,7 @@
 	  it->face_id = saved_face_id;
 	  it->len = saved_len;
 	  it->c = saved_c;
+	  it->char_to_display = saved_char_to_display;
 	  return 1;
 	}
     }
@@ -16190,7 +16169,7 @@
       it->what = IT_CHARACTER;
       bzero (&it->position, sizeof it->position);
       it->object = make_number (0);
-      it->c = ' ';
+      it->c = it->char_to_display = ' ';
       it->len = 1;
       it->face_id = face->id;
 
@@ -19519,7 +19498,12 @@
 
   if (face->font)
     {
-      unsigned code = face->font->driver->encode_char (face->font, glyph->u.ch);
+      unsigned code;
+
+      if (CHAR_BYTE8_P (glyph->u.ch))
+	code = CHAR_TO_BYTE8 (glyph->u.ch);
+      else
+	code = face->font->driver->encode_char (face->font, glyph->u.ch);
 
       if (code != FONT_INVALID_CODE)
 	STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
@@ -19534,6 +19518,26 @@
 }
 
 
+/* Get glyph code of character C in FONT in the two-byte form CHAR2B.
+   Retunr 1 if FONT has a glyph for C, otherwise return 0.  */
+
+static INLINE int
+get_char_glyph_code (int c, struct font *font, XChar2b *char2b)
+{
+  unsigned code;
+
+  if (CHAR_BYTE8_P (c))
+    code = CHAR_TO_BYTE8 (c);
+  else
+    code = font->driver->encode_char (font, c);
+
+  if (code == FONT_INVALID_CODE)
+    return 0;
+  STORE_XCHAR2B (char2b, (code >> 8), (code & 0xFF));
+  return 1;
+}
+
+
 /* Fill glyph string S with composition components specified by S->cmp.
 
    BASE_FACE is the base face of the composition.
@@ -20906,10 +20910,14 @@
 	{
 	  int maxlen = ((IT_BYTEPOS (*it) >= GPT ? ZV : GPT)
 			- IT_BYTEPOS (*it));
-	  it2.c = STRING_CHAR_AND_LENGTH (p, it2.len);
-	}
-      else
-	it2.c = *p, it2.len = 1;
+	  it2.c = it2.char_to_display = STRING_CHAR_AND_LENGTH (p, it2.len);
+	}
+      else
+	{
+	  it2.c = it2.char_to_display = *p, it2.len = 1;
+	  if (! ASCII_CHAR_P (it2.c))
+	    it2.char_to_display = BYTE8_TO_CHAR (it2.c);
+	}
 
       it2.glyph_row = NULL;
       it2.what = IT_CHARACTER;
@@ -21083,49 +21091,12 @@
   if (it->what == IT_CHARACTER)
     {
       XChar2b char2b;
-      struct font *font;
       struct face *face = FACE_FROM_ID (it->f, it->face_id);
-      struct font_metrics *pcm;
-      int font_not_found_p;
+      struct font *font = face->font;
+      int font_not_found_p = font == NULL;
+      struct font_metrics *pcm = NULL;
       int boff;			/* baseline offset */
-      /* We may change it->multibyte_p upon unibyte<->multibyte
-	 conversion.  So, save the current value now and restore it
-	 later.
-
-	 Note: It seems that we don't have to record multibyte_p in
-	 struct glyph because the character code itself tells whether
-	 or not the character is multibyte.  Thus, in the future, we
-	 must consider eliminating the field `multibyte_p' in the
-	 struct glyph.  */
-      int saved_multibyte_p = it->multibyte_p;
-
-      /* Maybe translate single-byte characters to multibyte, or the
-	 other way.  */
-      it->char_to_display = it->c;
-      if (!ASCII_BYTE_P (it->c)
-	  && ! it->multibyte_p)
-	{
-	  if (SINGLE_BYTE_CHAR_P (it->c)
-	      && unibyte_display_via_language_environment)
-	    {
-	      struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
-
-	      /* get_next_display_element assures that this decoding
-		 never fails.  */
-	      it->char_to_display = DECODE_CHAR (unibyte, it->c);
-	      it->multibyte_p = 1;
-	      it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display,
-					   -1, Qnil);
-	      face = FACE_FROM_ID (it->f, it->face_id);
-	    }
-	}
-
-      /* Get font to use.  Encode IT->char_to_display.  */
-      get_char_face_and_encoding (it->f, it->char_to_display, it->face_id,
-				  &char2b, it->multibyte_p, 0);
-      font = face->font;
-
-      font_not_found_p = font == NULL;
+
       if (font_not_found_p)
 	{
 	  /* When no suitable font found, display an empty box based
@@ -21145,16 +21116,12 @@
 	    boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff;
 	}
 
-      if (it->char_to_display >= ' '
-	  && (!it->multibyte_p || it->char_to_display < 128))
-	{
-	  /* Either unibyte or ASCII.  */
+      if (it->char_to_display != '\n' && it->char_to_display != '\t')
+	{
 	  int stretched_p;
 
 	  it->nglyphs = 1;
 
-	  pcm = get_per_char_metric (it->f, font, &char2b);
-
  	  if (it->override_ascent >= 0)
  	    {
  	      it->ascent = it->override_ascent;
@@ -21167,6 +21134,15 @@
  	      it->descent = FONT_DESCENT (font) - boff;
  	    }
 
+	  if (! font_not_found_p
+	      && get_char_glyph_code (it->char_to_display, font, &char2b))
+	    {
+	      pcm = get_per_char_metric (it->f, font, &char2b);
+	      if (pcm->width == 0
+		  && pcm->rbearing == 0 && pcm->lbearing == 0)
+		pcm = NULL;
+	    }
+
 	  if (pcm)
 	    {
 	      it->phys_ascent = pcm->ascent + boff;
@@ -21178,7 +21154,7 @@
 	      it->glyph_not_available_p = 1;
 	      it->phys_ascent = it->ascent;
 	      it->phys_descent = it->descent;
-	      it->pixel_width = FONT_WIDTH (font);
+	      it->pixel_width = font->space_width;
 	    }
 
 	  if (it->constrain_row_ascent_descent_p)
@@ -21352,7 +21328,7 @@
 		}
 	    }
 	}
-      else if (it->char_to_display == '\t')
+      else		      /* i.e. (it->char_to_display == '\t') */
 	{
 	  if (font->space_width > 0)
 	    {
@@ -21383,85 +21359,6 @@
 	      it->nglyphs = 1;
 	    }
 	}
-      else
-	{
-	  /* A multi-byte character.  Assume that the display width of the
-	     character is the width of the character multiplied by the
-	     width of the font.  */
-
-	  /* If we found a font, this font should give us the right
-	     metrics.  If we didn't find a font, use the frame's
-	     default font and calculate the width of the character by
-	     multiplying the width of font by the width of the
-	     character.  */
-
-	  pcm = get_per_char_metric (it->f, font, &char2b);
-
-	  if (font_not_found_p || !pcm)
-	    {
-	      int char_width = CHAR_WIDTH (it->char_to_display);
-
-	      if (char_width == 0)
-		/* This is a non spacing character.  But, as we are
-		   going to display an empty box, the box must occupy
-		   at least one column.  */
-		char_width = 1;
-	      it->glyph_not_available_p = 1;
-	      it->pixel_width = font->space_width * char_width;
-	      it->phys_ascent = FONT_BASE (font) + boff;
-	      it->phys_descent = FONT_DESCENT (font) - boff;
-	    }
-	  else
-	    {
-	      it->pixel_width = pcm->width;
-	      it->phys_ascent = pcm->ascent + boff;
-	      it->phys_descent = pcm->descent - boff;
-	      if (it->glyph_row
-		  && (pcm->lbearing < 0
-		      || pcm->rbearing > pcm->width))
-		it->glyph_row->contains_overlapping_glyphs_p = 1;
-	    }
-	  it->nglyphs = 1;
-          it->ascent = FONT_BASE (font) + boff;
-          it->descent = FONT_DESCENT (font) - boff;
-	  if (face->box != FACE_NO_BOX)
-	    {
-	      int thick = face->box_line_width;
-
-	      if (thick > 0)
-		{
-		  it->ascent += thick;
-		  it->descent += thick;
-		}
-	      else
-		thick = - thick;
-
-	      if (it->start_of_box_run_p)
-		it->pixel_width += thick;
-	      if (it->end_of_box_run_p)
-		it->pixel_width += thick;
-	    }
-
-	  /* If face has an overline, add the height of the overline
-	     (1 pixel) and a 1 pixel margin to the character height.  */
-	  if (face->overline_p)
-	    it->ascent += overline_margin;
-
-	  take_vertical_position_into_account (it);
-
-	  if (it->ascent < 0)
-	    it->ascent = 0;
-	  if (it->descent < 0)
-	    it->descent = 0;
-
-	  if (it->glyph_row)
-	    append_glyph (it);
-	  if (it->pixel_width == 0)
-	    /* We assure that all visible glyphs have at least 1-pixel
-	       width.  */
-	    it->pixel_width = 1;
-	}
-      it->multibyte_p = saved_multibyte_p;
     }
   else if (it->what == IT_COMPOSITION && it->cmp_it.ch < 0)
     {
@@ -21557,7 +21454,7 @@
 	    }
 	  else
 	    {
-	      width = FONT_WIDTH (font);
+	      width = font->space_width;
 	      ascent = FONT_BASE (font);
 	      descent = FONT_DESCENT (font);
 	      lbearing = 0;
--- a/src/xfont.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/xfont.c	Wed Oct 13 22:40:51 2010 +0900
@@ -861,7 +861,7 @@
 
       val = Ffont_get (font_object, QCavgwidth);
       if (INTEGERP (val))
-	font->average_width = XINT (val);
+	font->average_width = XINT (val) / 10;
       if (font->average_width < 0)
 	font->average_width = - font->average_width;
       if (font->average_width == 0
--- a/src/xgselect.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/xgselect.c	Wed Oct 13 22:40:51 2010 +0900
@@ -113,11 +113,17 @@
               if (rfds && FD_ISSET (i, rfds)) ++retval;
               else ++our_fds;
             }
+          else if (rfds)
+            FD_CLR (i, rfds);
+
           if (have_wfds && FD_ISSET (i, &all_wfds))
             {
               if (wfds && FD_ISSET (i, wfds)) ++retval;
               else ++our_fds;
             }
+          else if (wfds)
+            FD_CLR (i, wfds);
+
           if (efds && FD_ISSET (i, efds))
             ++retval;
         }
--- a/src/xterm.c	Sun Aug 29 14:22:52 2010 +0900
+++ b/src/xterm.c	Wed Oct 13 22:40:51 2010 +0900
@@ -8572,6 +8572,72 @@
                 "_NET_WM_STATE_STICKY", NULL);
 }
 
+/* Return the current _NET_WM_STATE.
+   SIZE_STATE is set to one of the FULLSCREEN_* values.
+   STICKY is set to 1 if the sticky state is set, 0 if not.  */
+
+static void
+get_current_vm_state (struct frame *f,
+                      Window window,
+                      int *size_state,
+                      int *sticky)
+{
+  Atom actual_type;
+  unsigned long actual_size, bytes_remaining;
+  int i, rc, actual_format;
+  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+  long max_len = 65536;
+  Display *dpy = FRAME_X_DISPLAY (f);
+  unsigned char *tmp_data = NULL;
+  Atom target_type = XA_ATOM;
+
+  *sticky = 0;
+  *size_state = FULLSCREEN_NONE;
+
+  BLOCK_INPUT;
+  x_catch_errors (dpy);
+  rc = XGetWindowProperty (dpy, window, dpyinfo->Xatom_net_wm_state,
+                           0, max_len, False, target_type,
+                           &actual_type, &actual_format, &actual_size,
+                           &bytes_remaining, &tmp_data);
+
+  if (rc != Success || actual_type != target_type || x_had_errors_p (dpy))
+    {
+      if (tmp_data) XFree (tmp_data);
+      x_uncatch_errors ();
+      UNBLOCK_INPUT;
+      return;
+    }
+
+  x_uncatch_errors ();
+
+  for (i = 0; i < actual_size; ++i)
+    {
+      Atom a = ((Atom*)tmp_data)[i];
+      if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) 
+        {
+          if (*size_state == FULLSCREEN_HEIGHT)
+            *size_state = FULLSCREEN_MAXIMIZED;
+          else
+            *size_state = FULLSCREEN_WIDTH;
+        }
+      else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert)
+        {
+          if (*size_state == FULLSCREEN_WIDTH)
+            *size_state = FULLSCREEN_MAXIMIZED;
+          else
+            *size_state = FULLSCREEN_HEIGHT;
+        }
+      else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom)
+        *size_state = FULLSCREEN_BOTH;
+      else if (a == dpyinfo->Xatom_net_wm_state_sticky)
+        *sticky = 1;
+    }
+
+  if (tmp_data) XFree (tmp_data);
+  UNBLOCK_INPUT;
+}
+
 /* Do fullscreen as specified in extended window manager hints */
 
 static int
@@ -8579,13 +8645,17 @@
      struct frame *f;
 {
   int have_net_atom = wm_supports (f, "_NET_WM_STATE");
+  Lisp_Object lval = get_frame_param (f, Qfullscreen);
+  int cur, dummy;
+
+  get_current_vm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy);
 
   /* Some window managers don't say they support _NET_WM_STATE, but they do say
      they support _NET_WM_STATE_FULLSCREEN.  Try that also.  */
   if (!have_net_atom)
       have_net_atom = wm_supports (f, "_NET_WM_STATE_FULLSCREEN");
 
-  if (have_net_atom)
+  if (have_net_atom && cur != f->want_fullscreen)
     {
       Lisp_Object frame;
       const char *fs = "_NET_WM_STATE_FULLSCREEN";
@@ -8594,26 +8664,41 @@
 
       XSETFRAME (frame, f);
 
-      set_wm_state (frame, 0, fs, NULL);
-      set_wm_state (frame, 0, fh, NULL);
-      set_wm_state (frame, 0, fw, NULL);
-      
-      /* If there are _NET_ atoms we assume we have extended window manager
-         hints.  */
+      /* Keep number of calls to set_wm_state as low as possible.
+         Some window managers, or possible Gtk+, hangs when too many
+         are sent at once.  */
       switch (f->want_fullscreen)
         {
         case FULLSCREEN_BOTH:
+          if (cur == FULLSCREEN_WIDTH || cur == FULLSCREEN_MAXIMIZED
+              || cur == FULLSCREEN_HEIGHT)
+            set_wm_state (frame, 0, fw, fh);
           set_wm_state (frame, 1, fs, NULL);
           break;
         case FULLSCREEN_WIDTH:
-          set_wm_state (frame, 1, fw, NULL);
+          if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_HEIGHT
+              || cur == FULLSCREEN_MAXIMIZED)
+            set_wm_state (frame, 0, fs, fh);
+          if (cur != FULLSCREEN_MAXIMIZED)
+            set_wm_state (frame, 1, fw, NULL);
           break;
         case FULLSCREEN_HEIGHT:
-          set_wm_state (frame, 1, fh, NULL);
+          if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_WIDTH
+              || cur == FULLSCREEN_MAXIMIZED)
+            set_wm_state (frame, 0, fs, fw);
+          if (cur != FULLSCREEN_MAXIMIZED)
+            set_wm_state (frame, 1, fh, NULL);
           break;
         case FULLSCREEN_MAXIMIZED:
+          if (cur == FULLSCREEN_BOTH)
+            set_wm_state (frame, 0, fs, NULL);
           set_wm_state (frame, 1, fw, fh);
           break;
+        case FULLSCREEN_NONE:
+          if (cur == FULLSCREEN_BOTH)
+            set_wm_state (frame, 0, fs, NULL);
+          else
+            set_wm_state (frame, 0, fw, fh);
         }
 
       f->want_fullscreen = FULLSCREEN_NONE;
@@ -8642,57 +8727,11 @@
      struct frame *f;
      XPropertyEvent *event;
 {
-  Atom actual_type;
-  unsigned long actual_size, bytes_remaining;
-  int i, rc, actual_format, value = FULLSCREEN_NONE;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
-  long max_len = 65536;
-  Display *dpy = FRAME_X_DISPLAY (f);
-  unsigned char *tmp_data = NULL;
-  Atom target_type = XA_ATOM;
+  int value = FULLSCREEN_NONE;
   Lisp_Object lval;
   int sticky = 0;
 
-  BLOCK_INPUT;
-  x_catch_errors (dpy);
-  rc = XGetWindowProperty (dpy, event->window,
-                           event->atom, 0, max_len, False, target_type,
-                           &actual_type, &actual_format, &actual_size,
-                           &bytes_remaining, &tmp_data);
-
-  if (rc != Success || actual_type != target_type || x_had_errors_p (dpy))
-    {
-      if (tmp_data) XFree (tmp_data);
-      x_uncatch_errors ();
-      UNBLOCK_INPUT;
-      return;
-    }
-
-  x_uncatch_errors ();
-
-  for (i = 0; i < actual_size; ++i)
-    {
-      Atom a = ((Atom*)tmp_data)[i];
-      if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) 
-        {
-          if (value == FULLSCREEN_HEIGHT)
-            value = FULLSCREEN_MAXIMIZED;
-          else
-            value = FULLSCREEN_WIDTH;
-        }
-      else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert)
-        {
-          if (value == FULLSCREEN_WIDTH)
-            value = FULLSCREEN_MAXIMIZED;
-          else
-            value = FULLSCREEN_HEIGHT;
-        }
-      else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom)
-        value = FULLSCREEN_BOTH;
-      else if (a == dpyinfo->Xatom_net_wm_state_sticky)
-        sticky = 1;
-    }
-
+  get_current_vm_state (f, event->window, &value, &sticky);
   lval = Qnil;
   switch (value) 
     {
@@ -8712,9 +8751,6 @@
       
   store_frame_param (f, Qfullscreen, lval);
   store_frame_param (f, Qsticky, sticky ? Qt : Qnil);
-
-  if (tmp_data) XFree (tmp_data);
-  UNBLOCK_INPUT;
 }
 
 /* Check if we need to resize the frame due to a fullscreen request.