The unified diff between revisions [30edf243..] and [d0ee334b..] is displayed below. It can also be downloaded as a raw diff.

#
#
# add_dir "support/libtty"
#
# add_dir "support/libtty/src"
#
# add_dir "support/libtty/src/system"
#
# add_file "support/libtty/Makefile.in"
#  content [b209162705cb27f7fa1208b8ba83f0fcddf15bfa]
#
# add_file "support/libtty/config.guess"
#  content [f38b1e93d1e0fa6f5a6913e9e7b12774b9232588]
#
# add_file "support/libtty/config.sub"
#  content [f14b07d544ca26b5d698259045136b783e18fc7f]
#
# add_file "support/libtty/configure"
#  content [40015e10af30df16c24f94972dc6b8c4dd458faa]
#
# add_file "support/libtty/configure.in"
#  content [9e549f497c9da0292e6ba1d5855d01f3b85de235]
#
# add_file "support/libtty/install-sh"
#  content [59a283253997bfc315bff71b666d751e6ac16d45]
#
# add_file "support/libtty/libtty.gpr"
#  content [a6d5344db468d944f56bf3ff41c2d9fc21a404da]
#
# add_file "support/libtty/src/g-exptty.adb"
#  content [067d7b9997dc5ef500abeffbe2647b0cff5d91b8]
#
# add_file "support/libtty/src/g-exptty.ads"
#  content [b37a9c7ee292b13e1d4c329ace02df50f398b78a]
#
# add_file "support/libtty/src/g-tty.adb"
#  content [13eca254ef68896b13c1517a5d7308d1920cccbc]
#
# add_file "support/libtty/src/g-tty.ads"
#  content [4df25af79080bfb76168a9f87d64f53a62c57650]
#
# add_file "support/libtty/src/gexpect_tty.c.in"
#  content [a4706e39df5b423e871b4f6fcd2c1d4a434bd551]
#
# add_file "support/libtty/src/syssignal.h"
#  content [bf4607234d6332280e5ec1c255020b2905bde552]
#
# add_file "support/libtty/src/system/aix3-1.h"
#  content [c95eb063dfb71061e805aecbe459f5b77c7becf7]
#
# add_file "support/libtty/src/system/aix3-2-5.h"
#  content [0972b23b1aa584a6f954e25b60f79edea64ae015]
#
# add_file "support/libtty/src/system/aix3-2.h"
#  content [fbef27941d4dac8703a4240ce25bdcf81cbbaae8]
#
# add_file "support/libtty/src/system/aix4-1.h"
#  content [fdc90e8304cd5c04b40f0bb9f25cc05a69030e2b]
#
# add_file "support/libtty/src/system/aix4-2.h"
#  content [0dd73a6f58ac99cd2f08b65b63330f94a3101641]
#
# add_file "support/libtty/src/system/aix4.h"
#  content [cd080569f500e831b44738ac107c1f98fc6b80b6]
#
# add_file "support/libtty/src/system/bsd4-3.h"
#  content [d76b5d3ce862898ade7b64aacee6bd2be6fcaff0]
#
# add_file "support/libtty/src/system/darwin.h"
#  content [d57eb40352e19e5e572e1119d0f115fb66c88573]
#
# add_file "support/libtty/src/system/freebsd.h"
#  content [fe0176ca8185f9984f70afe465cc57309b30ea5e]
#
# add_file "support/libtty/src/system/gnu-linux.h"
#  content [1f0431b67387e28b856ae12db39a9dbe2a02559c]
#
# add_file "support/libtty/src/system/hpux.h"
#  content [17da3f3f21c963acaacee86f78ccdfc28e784277]
#
# add_file "support/libtty/src/system/hpux10.h"
#  content [ded3b03d0815b8a631588e2b2cbfa047a203be45]
#
# add_file "support/libtty/src/system/hpux8.h"
#  content [3a3e0147ca555eaa84632a7d132343da7232f59a]
#
# add_file "support/libtty/src/system/hpux9.h"
#  content [b7426734a0be99254e971c8a7a9d8985dc7925bc]
#
# add_file "support/libtty/src/system/hpux9shr.h"
#  content [7222be217103febb7fa139e7c60ba7ab12410333]
#
# add_file "support/libtty/src/system/irix5-0.h"
#  content [dc5bdc01ae18e6f0a88d1ab2b42882ebbfb792dd]
#
# add_file "support/libtty/src/system/irix6-5.h"
#  content [e37ec332df30aafd4c7765bf7a2f27608eab98b2]
#
# add_file "support/libtty/src/system/osf1.h"
#  content [d3f5f83fb736f5e06951bc81caab933ee40321f3]
#
# add_file "support/libtty/src/system/sol2-3.h"
#  content [0e2b310339e65866eb14e6c75152f9c8f490765c]
#
# add_file "support/libtty/src/system/sol2-4.h"
#  content [fd28643c1f2726f63cee42f9ce0c419990324a9d]
#
# add_file "support/libtty/src/system/sol2-5.h"
#  content [38fd62a008add666be2b463caaf0ecd9b595ffa2]
#
# add_file "support/libtty/src/system/sol2.h"
#  content [61c7f5283d7c72527ee093e6b6ae7d703fe47e64]
#
# add_file "support/libtty/src/system/unixware.h"
#  content [b4600719659646c0569ce8f24e34f22965608444]
#
# add_file "support/libtty/src/system/usg5-3.h"
#  content [4ca10bfef4eb42c7c8d6f204837a146ba757bb7e]
#
# add_file "support/libtty/src/system/usg5-4-2.h"
#  content [bde2f4a6f15be0c8fc97c50f6a086aefe8af1e71]
#
# add_file "support/libtty/src/system/usg5-4.h"
#  content [1e427145a3901230fbd43dfd13ac75b8d4db664c]
#
# add_file "support/libtty/src/system/windows.h"
#  content [583597eb84b536be36f94dcc23dec370c55bbadc]
#
# add_file "support/libtty/src/systty.h"
#  content [31ad9522bdf3ed4e5beea67a5ae37acfdc933176]
#
#   set "support/libtty/Makefile.in"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/config.guess"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/config.sub"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/configure"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/configure.in"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/install-sh"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/libtty.gpr"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/g-exptty.adb"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/g-exptty.ads"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/g-tty.adb"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/g-tty.ads"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/gexpect_tty.c.in"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/syssignal.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix3-1.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix3-2-5.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix3-2.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix4-1.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix4-2.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/aix4.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/bsd4-3.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/darwin.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/freebsd.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/gnu-linux.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/hpux.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/hpux10.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/hpux8.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/hpux9.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/hpux9shr.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/irix5-0.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/irix6-5.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/osf1.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/sol2-3.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/sol2-4.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/sol2-5.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/sol2.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/unixware.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/usg5-3.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/usg5-4-2.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/usg5-4.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/system/windows.h"
#  attr "mtn:execute"
# value "true"
#
#   set "support/libtty/src/systty.h"
#  attr "mtn:execute"
# value "true"
#
============================================================
--- support/libtty/Makefile.in	b209162705cb27f7fa1208b8ba83f0fcddf15bfa
+++ support/libtty/Makefile.in	b209162705cb27f7fa1208b8ba83f0fcddf15bfa
@@ -0,0 +1,36 @@
+prefix=${shell pwd}/ins
+
+all: prepare build install
+
+prepare:
+	if [ ! -d obj ]; then mkdir obj; fi
+	if [ ! -d lib ]; then mkdir lib; fi
+
+build:
+	gcc -c -O2 @DEFS@ src/gexpect_tty.c -o obj/gexpect_tty.o
+	gcc -c -O2 src/g-exptty.adb -o obj/g-exptty.o
+	gcc -c -O2 src/g-tty.adb -o obj/g-tty.o
+	gnatmake -Plibtty -largs @TARGET_LFLAGS@
+
+install:
+	if [ ! -d ${prefix} ]; then mkdir ${prefix}; else chmod -R +w ${prefix}; fi
+	if [ ! -d ${prefix}/src ]; then mkdir ${prefix}/src; fi
+	if [ ! -d ${prefix}/obj ]; then mkdir ${prefix}/obj; fi
+	if [ ! -d ${prefix}/lib ]; then mkdir ${prefix}/lib; fi
+	cp -p src/g-exptty.ads src/g-tty.ads ${prefix}/src
+	cp -p obj/*.ali ${prefix}/obj
+	cp -p lib/*.a   ${prefix}/lib
+	cp -p libtty.gpr ${prefix}
+	chmod -w ${prefix}/*
+
+clean:
+	-rm obj/*
+	-rm lib/*
+	-chmod +w ${prefix}/*
+	-rm -rf ins/*
+	-rm src/gexpect_tty.c
+
+distclean: clean
+	-rm config.log config.cache config.status
+	-rm Makefile
+
============================================================
--- support/libtty/config.guess	f38b1e93d1e0fa6f5a6913e9e7b12774b9232588
+++ support/libtty/config.guess	f38b1e93d1e0fa6f5a6913e9e7b12774b9232588
@@ -0,0 +1,1317 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+#   Free Software Foundation, Inc.
+
+timestamp='2001-09-04'
+
+# This file 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# Please send patches to <config-patches@gnu.org>.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# Netbsd (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	# Determine the machine/vendor (is the vendor relevant).
+	case "${UNAME_MACHINE}" in
+	    amiga) machine=m68k-unknown ;;
+	    arm32) machine=arm-unknown ;;
+	    atari*) machine=m68k-atari ;;
+	    sun3*) machine=m68k-sun ;;
+	    mac68k) machine=m68k-apple ;;
+	    macppc) machine=powerpc-apple ;;
+	    hp3[0-9][05]) machine=m68k-hp ;;
+	    ibmrt|romp-ibm) machine=romp-ibm ;;
+	    *) machine=${UNAME_MACHINE}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE}" in
+	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	if test $UNAME_RELEASE = "V4.0"; then
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+	fi
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
+	.globl main
+	.align 4
+	.ent main
+main:
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
+	.end main
+EOF
+	eval $set_cc_for_build
+	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+	if test "$?" = 0 ; then
+		case `./$dummy` in
+			0-0)
+				UNAME_MACHINE="alpha"
+				;;
+			1-0)
+				UNAME_MACHINE="alphaev5"
+				;;
+			1-1)
+				UNAME_MACHINE="alphaev56"
+				;;
+			1-101)
+				UNAME_MACHINE="alphapca56"
+				;;
+			2-303)
+				UNAME_MACHINE="alphaev6"
+				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
+		esac
+	fi
+	rm -f $dummy.s $dummy
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit 0;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    arc64:OpenBSD:*:*)
+	echo mips64el-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hkmips:OpenBSD:*:*)
+	echo mips-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mips-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit 0 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:NetBSD:*)
+	echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    sun3*:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy \
+	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit 0 ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit 0 ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit 0 ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit 0 ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit 0 ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+		rm -f $dummy.c $dummy
+		echo rs6000-ibm-aix3.2.5
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+              case "${HPUX_REV}" in
+                11.[0-9][0-9])
+                  if [ -x /usr/bin/getconf ]; then
+                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+                        esac ;;
+                    esac
+                  fi ;;
+              esac
+              if [ "${HP_ARCH}" = "" ]; then
+	      eval $set_cc_for_build
+              sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+	    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+	    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+	    rm -f $dummy.c $dummy
+	fi ;;
+	esac
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit 0 ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit 0 ;;
+    hppa*:OpenBSD:*:*)
+	echo hppa-unknown-openbsd
+	exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*X-MP:*:*:*)
+	echo xmp-cray-unicos
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY-2:*:*:*)
+	echo cray2-cray-unicos
+        exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i386-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+	  big)    echo mips-unknown-linux-gnu && exit 0 ;;
+	  little) echo mipsel-unknown-linux-gnu && exit 0 ;;
+	esac
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	ld_supported_targets=`cd /; ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	cat >$dummy.c <<EOF
+#include <features.h>
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __ELF__
+# ifdef __GLIBC__
+#  if __GLIBC__ >= 2
+    printf ("%s-pc-linux-gnu\n", argv[1]);
+#  else
+    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+#  endif
+# else
+   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit 0 ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit 0 ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	if test "${UNAME_MACHINE}" = "x86pc"; then
+		UNAME_MACHINE=pc
+	fi
+	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[KW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
============================================================
--- support/libtty/config.sub	f14b07d544ca26b5d698259045136b783e18fc7f
+++ support/libtty/config.sub	f14b07d544ca26b5d698259045136b783e18fc7f
@@ -0,0 +1,1411 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+#   Free Software Foundation, Inc.
+
+timestamp='2001-09-07'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dsp16xx \
+	| fr30 \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| s390 | s390x \
+	| sh | sh[34] | sh[34]eb | shbe | shle \
+	| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+	| stormy16 | strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 \
+	| we32k \
+	| x86 | xscale \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alphapca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armv*-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cray2-* | cydra-* \
+	| d10v-* | d30v-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| s390-* | s390x-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
+	| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	cray2)
+		basic_machine=cray2-cray
+		os=-unicos
+		;;
+	[cjt]90)
+		basic_machine=${basic_machine}-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mipsel*-linux*)
+		basic_machine=mipsel-unknown
+		os=-linux-gnu
+		;;
+	mips*-linux*)
+		basic_machine=mips-unknown
+		os=-linux-gnu
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+        pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | k6 | nexgen)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i686-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+	        ;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+	        ;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sparclite-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=t3e-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
+	xmp)
+		basic_machine=xmp-cray
+		os=-unicos
+		;;
+        xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	mips)
+		if [ x$os = x-linux-gnu ]; then
+			basic_machine=mips-unknown
+		else
+			basic_machine=mips-mips
+		fi
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+        cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	c4x*)
+		basic_machine=c4x-none
+		os=-coff
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-ns2 )
+	        os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+	        os=-mint
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	pdp10-*)
+		os=-tops20
+		;;
+        pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+        *-gould)
+		os=-sysv
+		;;
+        *-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+        *-sgi)
+		os=-irix
+		;;
+        *-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
============================================================
--- support/libtty/configure	40015e10af30df16c24f94972dc6b8c4dd458faa
+++ support/libtty/configure	40015e10af30df16c24f94972dc6b8c4dd458faa
@@ -0,0 +1,4970 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 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.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  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
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    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=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # 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 before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, 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
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { 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 sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/gexpect_tty.c.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP opsysfile TARGET_CFLAGS TARGET_LFLAGS TARGET LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    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 &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    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
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # 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 this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --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
+      --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
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 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 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    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; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >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
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  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
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+TARGET_CFLAGS=""
+TARGET_LFLAGS=""
+
+ROOT=`pwd`
+TARGET=$host
+EXEC_PREFIX="$prefix"
+
+######## Support for ptys ###
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$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"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  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
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  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
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# 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.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&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'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  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
+	{ { 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
+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
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; 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
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+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
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f 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
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <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
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent 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
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  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
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <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
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent 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
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  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
+
+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
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f 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
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+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
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+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
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  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_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in sys/stropts.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  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
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in getpt
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in grantpt
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in unlockpt
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in openpty
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in _getpty
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in ptsname
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in setpgid
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in setsid
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in sigprocmask
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+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
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+opsys=''
+
+case "${host}" in
+
+  ## Alpha (DEC) machines.
+  alpha*-dec-osf* )
+    machine=alpha opsys=osf1
+  ;;
+
+  ## HP 9000 series 700 and 800, running HP/UX
+  hppa*-hp-hpux1[0-9]* )
+    machine=hp800 opsys=hpux10
+  ;;
+
+  mips-sgi-irix6.5* )
+    machine=iris4d opsys=irix6-5
+  ;;
+  mips-sgi-irix6* )
+    machine=iris4d opsys=irix6-0
+  ;;
+
+  ## IBM, AIX machines
+  rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
+    machine=ibmrs6000 opsys=aix4-1
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+  rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* | powerpc-ibm-aix4.3* )
+    machine=ibmrs6000 opsys=aix4-2
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+  rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0*  )
+    machine=ibmrs6000 opsys=aix4
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+
+  ## PowerPC
+  powerpc-*-linux-gnu )
+    machine=powerpc opsys=gnu-linux
+  ;;
+
+  powerpc-*-darwin* )
+    machine=powerpc opsys=darwin
+  ;;
+
+  ## Suns
+  *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
+    | i[3456]86-*-solaris2* | i345686-*-sunos5* | powerpc*-*-solaris2* \
+    | rs6000-*-solaris2* | sparc*-linux*-gnu )
+    case "${host}" in
+      m68*-sunos1* )    machine=sun1 ;;
+      m68*-sunos2* )    machine=sun2 ;;
+      m68* )            machine=sun3 ;;
+      i[3456]86-sun-sunos[34]* )        machine=sun386 ;;
+      i[3456]86-*-* )     machine=intel386 ;;
+      powerpcle* )      machine=powerpcle ;;
+      powerpc* | rs6000* )  machine=ibmrs6000 ;;
+      sparc* )          machine=sparc ;;
+      * )               unported=yes ;;
+    esac
+    case "${host}" in
+      ## The Sun386 didn't get past 4.0.
+      i[3456]86-*-sunos4          ) opsys=sunos4-0 ;;
+      *-sunos4.0*         ) opsys=sunos4-0 ;;
+      *-sunos4.1.[3-9]*noshare )
+                opsys=sunos413
+                ;;
+      *-sunos4.1.[3-9]* | *-sunos4shr*)
+                opsys=sunos4shr
+                ;;
+      *-sunos4* | *-sunos )
+                opsys=sunos4-1
+                ;;
+      *-sunos5.3* | *-solaris2.3* )
+                opsys=sol2-3
+                ;;
+      *-sunos5.4* | *-solaris2.4* )
+                opsys=sol2-4
+                ;;
+      *-sunos5.5* | *-solaris2.5* )
+                opsys=sol2-5
+                ;;
+      *-sunos5* | *-solaris* )
+                opsys=sol2-5
+                ;;
+      *-linux-gnu* )
+  	        opsys=gnu-linux
+		;;
+      *) opsys=bsd4-2   ;;
+    esac;;
+
+  # IA64 processors
+  ia64-*-* )
+    case "${host}" in
+      *-linux-gnu* )
+        opsys=gnu-linux
+        ;;
+    esac
+  ;;
+
+  ## Intel 386 machines where we don't care about the manufacturer
+  i[3456]86-*-* )
+    machine=intel386
+    case "${host}" in
+      *-lynxos* )               opsys=lynxos ;;
+      *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
+      *-isc2.2* )               opsys=isc2-2 ;;
+      *-isc4.0* )               opsys=isc4-0 ;;
+      *-isc4.* )                opsys=isc4-1 ;;
+      *-isc* )                  opsys=isc3-0 ;;
+      *-esix5* )                opsys=esix5r4 ;;
+      *-esix* )                 opsys=esix ;;
+      *-xenix* )                opsys=xenix ;;
+      *-linux-gnu* )
+	opsys=gnu-linux
+
+	;;
+
+      *-sco3.2v4* )             opsys=sco4  ;;
+      *-sco3.2v5* )             opsys=sco5 ;;
+      *-sysv4.2uw* | *-sysv5uw* ) opsys=unixware ;;
+      *-386bsd* )               opsys=386bsd ;;
+      *-freebsd* )              opsys=freebsd ;;
+      *-nextstep* )             opsys=nextstep ;;
+      *win32* | *mingw32* | *cygwin* )
+	machine=intel386 opsys=windows
+	TARGET_LFLAGS="-luser32 -lcomdlg32 -mwindows -Wl,--stack=0x10000000"
+	TARGET=pentium-mingw32msv
+	;;
+      ## Otherwise, we'll fall through to the generic opsys code at the bottom.
+    esac
+  ;;
+
+  *) echo "Unknown system: ${host}"
+     exit;;
+esac
+
+machfile="'\"machine/${machine}.h\"'"
+opsysfile="system/${opsys}.h"
+
+echo ${opsysfile}
+echo ${TARGET_CFLAGS}
+echo ${TARGET_LFLAGS}
+echo "DEFS: ${DEFS}"
+
+
+
+
+
+                    ac_config_files="$ac_config_files Makefile src/gexpect_tty.c"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `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"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ 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/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  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
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    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=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # 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 before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, 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
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+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 sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      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]
+		   instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+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" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "src/gexpect_tty.c" ) CONFIG_FILES="$CONFIG_FILES src/gexpect_tty.c" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@opsysfile@,$opsysfile,;t t
+s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t
+s,@TARGET_LFLAGS@,$TARGET_LFLAGS,;t t
+s,@TARGET@,$TARGET,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  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; }
+fi
+
============================================================
--- support/libtty/configure.in	9e549f497c9da0292e6ba1d5855d01f3b85de235
+++ support/libtty/configure.in	9e549f497c9da0292e6ba1d5855d01f3b85de235
@@ -0,0 +1,173 @@
+ADC_REVISION($Revision: 1.1 $)
+AC_INIT(src/gexpect_tty.c.in)
+
+AC_CANONICAL_SYSTEM
+
+TARGET_CFLAGS=""
+TARGET_LFLAGS=""
+
+ROOT=`pwd`
+TARGET=$host
+EXEC_PREFIX="$prefix"
+
+######## Support for ptys ###
+AC_CHECK_HEADERS(sys/stropts.h)
+AC_CHECK_FUNCS(getpt)
+AC_CHECK_FUNCS(grantpt)
+AC_CHECK_FUNCS(unlockpt)
+AC_CHECK_FUNCS(openpty)
+AC_CHECK_FUNCS(_getpty)
+AC_CHECK_FUNCS(ptsname)
+AC_CHECK_FUNCS(setpgid)
+AC_CHECK_FUNCS(setsid)
+AC_CHECK_FUNCS(sigprocmask)
+
+opsys=''
+
+case "${host}" in
+
+  ## Alpha (DEC) machines.
+  alpha*-dec-osf* )
+    machine=alpha opsys=osf1
+  ;;
+
+  ## HP 9000 series 700 and 800, running HP/UX
+  hppa*-hp-hpux1[[0-9]]* )
+    machine=hp800 opsys=hpux10
+  ;;
+
+  mips-sgi-irix6.5* )
+    machine=iris4d opsys=irix6-5
+  ;;
+  mips-sgi-irix6* )
+    machine=iris4d opsys=irix6-0
+  ;;
+
+  ## IBM, AIX machines
+  rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
+    machine=ibmrs6000 opsys=aix4-1
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+  rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* | powerpc-ibm-aix4.3* )
+    machine=ibmrs6000 opsys=aix4-2
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+  rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0*  )
+    machine=ibmrs6000 opsys=aix4
+    TARGET_LFLAGS="-Wl,-bbigtoc"
+  ;;
+
+  ## PowerPC
+  powerpc-*-linux-gnu )
+    machine=powerpc opsys=gnu-linux
+  ;;
+
+  powerpc-*-darwin* )
+    machine=powerpc opsys=darwin
+  ;;
+
+  ## Suns
+  *-auspex-sunos* | *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
+    | i[[3456]]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
+    | rs6000-*-solaris2* | sparc*-linux*-gnu )
+    case "${host}" in
+      m68*-sunos1* )    machine=sun1 ;;
+      m68*-sunos2* )    machine=sun2 ;;
+      m68* )            machine=sun3 ;;
+      i[[3456]]86-sun-sunos[[34]]* )        machine=sun386 ;;
+      i[[3456]]86-*-* )     machine=intel386 ;;
+      powerpcle* )      machine=powerpcle ;;
+      powerpc* | rs6000* )  machine=ibmrs6000 ;;
+      sparc* )          machine=sparc ;;
+      * )               unported=yes ;;
+    esac
+    case "${host}" in
+      ## The Sun386 didn't get past 4.0.
+      i[[3456]]86-*-sunos4          ) opsys=sunos4-0 ;;
+      *-sunos4.0*         ) opsys=sunos4-0 ;;
+      *-sunos4.1.[[3-9]]*noshare )
+                opsys=sunos413
+                ;;
+      *-sunos4.1.[[3-9]]* | *-sunos4shr*)
+                opsys=sunos4shr
+                ;;
+      *-sunos4* | *-sunos )
+                opsys=sunos4-1
+                ;;
+      *-sunos5.3* | *-solaris2.3* )
+                opsys=sol2-3
+                ;;
+      *-sunos5.4* | *-solaris2.4* )
+                opsys=sol2-4
+                ;;
+      *-sunos5.5* | *-solaris2.5* )
+                opsys=sol2-5
+                ;;
+      *-sunos5* | *-solaris* )
+                opsys=sol2-5
+                ;;
+      *-linux-gnu* )
+  	        opsys=gnu-linux
+		;;
+      *) opsys=bsd4-2   ;;
+    esac;;
+
+  # IA64 processors
+  ia64-*-* )
+    case "${host}" in
+      *-linux-gnu* )
+        opsys=gnu-linux
+        ;;
+    esac
+  ;;
+
+  ## Intel 386 machines where we don't care about the manufacturer
+  i[[3456]]86-*-* )
+    machine=intel386
+    case "${host}" in
+      *-lynxos* )               opsys=lynxos ;;
+      *-isc1.* | *-isc2.[[01]]* ) opsys=386-ix ;;
+      *-isc2.2* )               opsys=isc2-2 ;;
+      *-isc4.0* )               opsys=isc4-0 ;;
+      *-isc4.* )                opsys=isc4-1 ;;
+      *-isc* )                  opsys=isc3-0 ;;
+      *-esix5* )                opsys=esix5r4 ;;
+      *-esix* )                 opsys=esix ;;
+      *-xenix* )                opsys=xenix ;;
+      *-linux-gnu* )
+	opsys=gnu-linux
+
+	;;
+
+      *-sco3.2v4* )             opsys=sco4  ;;
+      *-sco3.2v5* )             opsys=sco5 ;;
+      *-sysv4.2uw* | *-sysv5uw* ) opsys=unixware ;;
+      *-386bsd* )               opsys=386bsd ;;
+      *-freebsd* )              opsys=freebsd ;;
+      *-nextstep* )             opsys=nextstep ;;
+      *win32* | *mingw32* | *cygwin* )
+	machine=intel386 opsys=windows
+	TARGET_LFLAGS="-luser32 -lcomdlg32 -mwindows -Wl,--stack=0x10000000"
+	TARGET=pentium-mingw32msv
+	;;
+      ## Otherwise, we'll fall through to the generic opsys code at the bottom.
+    esac
+  ;;
+
+  *) echo "Unknown system: ${host}"
+     exit;;
+esac
+
+machfile="'\"machine/${machine}.h\"'"
+opsysfile="system/${opsys}.h"
+
+echo ${opsysfile}
+echo ${TARGET_CFLAGS}
+echo ${TARGET_LFLAGS}
+echo "DEFS: ${DEFS}"
+AC_SUBST(opsysfile)
+AC_SUBST(TARGET_CFLAGS)
+AC_SUBST(TARGET_LFLAGS)
+AC_SUBST(TARGET)
+
+AC_OUTPUT(Makefile src/gexpect_tty.c)
============================================================
--- support/libtty/install-sh	59a283253997bfc315bff71b666d751e6ac16d45
+++ support/libtty/install-sh	59a283253997bfc315bff71b666d751e6ac16d45
@@ -0,0 +1,238 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	true
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+
+	if [ -d $dst ]; then
+		instcmd=:
+	else
+		instcmd=mkdir
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		true
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		true
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		true
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		true
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ]
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename |
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ]
+	then
+		dstfile=`basename $dst`
+	else
+		true
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
============================================================
--- support/libtty/libtty.gpr	a6d5344db468d944f56bf3ff41c2d9fc21a404da
+++ support/libtty/libtty.gpr	a6d5344db468d944f56bf3ff41c2d9fc21a404da
@@ -0,0 +1,10 @@
+project Libtty is
+   for Languages use ("Ada", "C");
+   for Object_Dir use "obj";
+   for Library_Name use "tty";
+   for Library_Kind use "static";
+   for Library_Version use "0.9";
+   for Source_Dirs use ("src");
+   for Library_Dir use "lib";
+end Libtty;
+
============================================================
--- support/libtty/src/g-exptty.adb	067d7b9997dc5ef500abeffbe2647b0cff5d91b8
+++ support/libtty/src/g-exptty.adb	067d7b9997dc5ef500abeffbe2647b0cff5d91b8
@@ -0,0 +1,191 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT LIBRARY COMPONENTS                          --
+--                                                                          --
+--                      G N A T . E X P E C T . T T Y                       --
+--                                                                          --
+--                                 S p e c                                  --
+--                                                                          --
+--           Copyright (C) 2000-2005 Ada Core Technologies, Inc.            --
+--                                                                          --
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
+-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
+-- MA 02111-1307, USA.                                                      --
+--                                                                          --
+-- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com).   --
+--                                                                          --
+------------------------------------------------------------------------------
+
+with GNAT.OS_Lib; use GNAT.OS_Lib;
+
+package body GNAT.Expect.TTY is
+
+   -----------
+   -- Close --
+   -----------
+
+   procedure Close
+     (Descriptor : in out TTY_Process_Descriptor;
+      Status     : out Integer)
+   is
+      procedure Terminate_Process (Process : System.Address);
+      pragma Import (C, Terminate_Process, "gvd_terminate_process");
+
+      function Waitpid (Process : System.Address) return Integer;
+      pragma Import (C, Waitpid, "gvd_waitpid");
+      --  Wait for a specific process id, and return its exit code.
+
+      procedure Free_Process (Process : System.Address);
+      pragma Import (C, Free_Process, "gvd_free_process");
+
+   begin
+      Close (Descriptor.Input_Fd);
+
+      if Descriptor.Error_Fd /= Descriptor.Output_Fd then
+         Close (Descriptor.Error_Fd);
+      end if;
+
+      Close (Descriptor.Output_Fd);
+
+      --  Send a Ctrl-C to the process first. This way, if the
+      --  launched process is a "sh" or "cmd", the child processes
+      --  will get terminated as well. Otherwise, terminating the
+      --  main process brutally will leave the children running.
+      Interrupt (Descriptor);
+      delay (0.05);
+
+      Terminate_Process (Descriptor.Process);
+      GNAT.OS_Lib.Free (Descriptor.Buffer);
+      Descriptor.Buffer_Size := 0;
+
+      Status := Waitpid (Descriptor.Process);
+
+      Free_Process (Descriptor.Process'Address);
+   end Close;
+
+   -----------------------------
+   -- Close_Pseudo_Descriptor --
+   -----------------------------
+
+   procedure Close_Pseudo_Descriptor
+     (Descriptor : in out TTY_Process_Descriptor) is
+   begin
+      Descriptor.Buffer_Size := 0;
+      GNAT.OS_Lib.Free (Descriptor.Buffer);
+   end Close_Pseudo_Descriptor;
+
+   ---------------
+   -- Interrupt --
+   ---------------
+
+   procedure Interrupt (Descriptor : in out TTY_Process_Descriptor) is
+      procedure Internal (Process : System.Address);
+      pragma Import (C, Internal, "gvd_interrupt_process");
+
+   begin
+      Internal (Descriptor.Process);
+   end Interrupt;
+
+   procedure Interrupt (Pid : Integer) is
+      procedure Internal (Pid : Integer);
+      pragma Import (C, Internal, "gvd_interrupt_pid");
+
+   begin
+      Internal (Pid);
+   end Interrupt;
+
+   -----------------------
+   -- Pseudo_Descriptor --
+   -----------------------
+
+   procedure Pseudo_Descriptor
+     (Descriptor  : out TTY_Process_Descriptor'Class;
+      TTY         : GNAT.TTY.TTY_Handle;
+      Buffer_Size : Natural := 4096) is
+   begin
+      Descriptor.Input_Fd  := GNAT.TTY.TTY_Descriptor (TTY);
+      Descriptor.Output_Fd := Descriptor.Input_Fd;
+
+      --  Create the buffer
+
+      Descriptor.Buffer_Size := Buffer_Size;
+
+      if Buffer_Size /= 0 then
+         Descriptor.Buffer := new String (1 .. Positive (Buffer_Size));
+      end if;
+   end Pseudo_Descriptor;
+
+   ---------------------------
+   -- Set_Up_Communications --
+   ---------------------------
+
+   procedure Set_Up_Communications
+     (Pid        : in out TTY_Process_Descriptor;
+      Err_To_Out : Boolean;
+      Pipe1      : access Pipe_Type;
+      Pipe2      : access Pipe_Type;
+      Pipe3      : access Pipe_Type)
+   is
+      pragma Unreferenced (Err_To_Out, Pipe1, Pipe2, Pipe3);
+
+      procedure Internal (Process : System.Address);
+      pragma Import (C, Internal, "gvd_setup_communication");
+
+   begin
+      Internal (Pid.Process'Address);
+   end Set_Up_Communications;
+
+   ----------------------------------
+   -- Set_Up_Parent_Communications --
+   ----------------------------------
+
+   procedure Set_Up_Parent_Communications
+     (Pid   : in out TTY_Process_Descriptor;
+      Pipe1 : in out Pipe_Type;
+      Pipe2 : in out Pipe_Type;
+      Pipe3 : in out Pipe_Type)
+   is
+      pragma Unreferenced (Pipe1, Pipe2, Pipe3);
+
+      procedure Internal
+        (Process  : System.Address;
+         Inputfp  : out File_Descriptor;
+         Outputfp : out File_Descriptor;
+         Errorfp  : out File_Descriptor;
+         Pid      : out Process_Id);
+      pragma Import (C, Internal, "gvd_setup_parent_communication");
+
+   begin
+      Internal
+        (Pid.Process, Pid.Input_Fd, Pid.Output_Fd, Pid.Error_Fd, Pid.Pid);
+   end Set_Up_Parent_Communications;
+
+   ---------------------------------
+   -- Set_Up_Child_Communications --
+   ---------------------------------
+
+   procedure Set_Up_Child_Communications
+     (Pid   : in out TTY_Process_Descriptor;
+      Pipe1 : in out Pipe_Type;
+      Pipe2 : in out Pipe_Type;
+      Pipe3 : in out Pipe_Type;
+      Cmd   : in String;
+      Args  : in System.Address)
+   is
+      pragma Unreferenced (Pipe1, Pipe2, Pipe3, Cmd);
+      function Internal
+        (Process : System.Address; Argv : System.Address) return Process_Id;
+      pragma Import (C, Internal, "gvd_setup_child_communication");
+
+   begin
+      Pid.Pid := Internal (Pid.Process, Args);
+   end Set_Up_Child_Communications;
+
+end GNAT.Expect.TTY;
============================================================
--- support/libtty/src/g-exptty.ads	b37a9c7ee292b13e1d4c329ace02df50f398b78a
+++ support/libtty/src/g-exptty.ads	b37a9c7ee292b13e1d4c329ace02df50f398b78a
@@ -0,0 +1,98 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT LIBRARY COMPONENTS                          --
+--                                                                          --
+--                      G N A T . E X P E C T . T T Y                       --
+--                                                                          --
+--                                 S p e c                                  --
+--                                                                          --
+--           Copyright (C) 2000-2005 Ada Core Technologies, Inc.            --
+--                                                                          --
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
+-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
+-- MA 02111-1307, USA.                                                      --
+--                                                                          --
+-- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com).   --
+--                                                                          --
+------------------------------------------------------------------------------
+
+pragma Warnings (Off);
+with GNAT.TTY;
+pragma Warnings (On);
+with GNAT.Expect; use GNAT.Expect;
+
+with System;
+
+package GNAT.Expect.TTY is
+
+   ------------------
+   --  TTY_Process --
+   ------------------
+
+   type TTY_Process_Descriptor is new Process_Descriptor with private;
+   --  Similar, but the parent is set up as a full terminal (Unix sense, see
+   --  tty(4)).
+
+   procedure Pseudo_Descriptor
+     (Descriptor  : out TTY_Process_Descriptor'Class;
+      TTY         : GNAT.TTY.TTY_Handle;
+      Buffer_Size : Natural := 4096);
+   --  Given a terminal descriptor (TTY), create a pseudo process descriptor
+   --  to be used with GNAT.Expect.
+   --  Note that it is invalid to call Close, Interrupt, Send_Signal on the
+   --  resulting descriptor. To deallocate memory associated with Process,
+   --  call Close_Pseudo_Descriptor instead.
+
+   procedure Close_Pseudo_Descriptor
+     (Descriptor : in out TTY_Process_Descriptor);
+   --  Free memory and ressources associated with Descriptor.
+   --  Do *not* close the associated TTY, it is the caller's responsibility
+   --  to call GNAT.TTY.Close_TTY.
+
+   procedure Interrupt (Pid : Integer);
+   --  Interrupt a process given its pid.
+
+private
+
+   procedure Close
+     (Descriptor : in out TTY_Process_Descriptor;
+      Status     : out Integer);
+
+   procedure Interrupt (Descriptor : in out TTY_Process_Descriptor);
+   --  When we use pseudo-terminals, we do not need to use signals to
+   --  interrupt the debugger, we can simply send the appropriate character.
+   --  This provides a better support for remote debugging for instance.
+
+   procedure Set_Up_Communications
+     (Pid        : in out TTY_Process_Descriptor;
+      Err_To_Out : Boolean;
+      Pipe1      : access Pipe_Type;
+      Pipe2      : access Pipe_Type;
+      Pipe3      : access Pipe_Type);
+
+   procedure Set_Up_Parent_Communications
+     (Pid   : in out TTY_Process_Descriptor;
+      Pipe1 : in out Pipe_Type;
+      Pipe2 : in out Pipe_Type;
+      Pipe3 : in out Pipe_Type);
+
+   procedure Set_Up_Child_Communications
+     (Pid   : in out TTY_Process_Descriptor;
+      Pipe1 : in out Pipe_Type;
+      Pipe2 : in out Pipe_Type;
+      Pipe3 : in out Pipe_Type;
+      Cmd   : in String;
+      Args  : in System.Address);
+
+   type TTY_Process_Descriptor is new Process_Descriptor with record
+      Process : System.Address;  --  Underlying structure used in C.
+   end record;
+
+end GNAT.Expect.TTY;
============================================================
--- support/libtty/src/g-tty.adb	13eca254ef68896b13c1517a5d7308d1920cccbc
+++ support/libtty/src/g-tty.adb	13eca254ef68896b13c1517a5d7308d1920cccbc
@@ -0,0 +1,134 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT LIBRARY COMPONENTS                          --
+--                                                                          --
+--                             G N A T . T T Y                              --
+--                                                                          --
+--                                 B o d y                                  --
+--                                                                          --
+--                     Copyright (C) 2002-2005 AdaCore                      --
+--                                                                          --
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
+-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
+-- MA 02111-1307, USA.                                                      --
+--                                                                          --
+-- GNAT is maintained by AdaCore (http://www.adacore.com).                  --
+--                                                                          --
+------------------------------------------------------------------------------
+
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+
+package body GNAT.TTY is
+
+   use System;
+
+   procedure Check_TTY (Handle : TTY_Handle);
+   --  Check the validity of Handle.
+   --  Raise Program_Error if ttys are not supported.
+   --  Raise Constraint_Error if Handle is an invalid handle.
+
+   ------------------
+   -- Allocate_TTY --
+   ------------------
+
+   procedure Allocate_TTY (Handle : out TTY_Handle) is
+      function Internal return System.Address;
+      pragma Import (C, Internal, "gvd_new_tty");
+
+   begin
+      if not TTY_Supported then
+         raise Program_Error;
+      end if;
+
+      Handle.Handle := Internal;
+   end Allocate_TTY;
+
+   ---------------
+   -- Check_TTY --
+   ---------------
+
+   procedure Check_TTY (Handle : TTY_Handle) is
+   begin
+      if not TTY_Supported then
+         raise Program_Error;
+      elsif Handle.Handle = System.Null_Address then
+         raise Constraint_Error;
+      end if;
+   end Check_TTY;
+
+   ---------------
+   -- Close_TTY --
+   ---------------
+
+   procedure Close_TTY (Handle : in out TTY_Handle) is
+      procedure Internal (Handle : System.Address);
+      pragma Import (C, Internal, "gvd_close_tty");
+
+   begin
+      Check_TTY (Handle);
+      Internal (Handle.Handle);
+      Handle.Handle := System.Null_Address;
+   end Close_TTY;
+
+   --------------------
+   -- TTY_Descriptor --
+   --------------------
+
+   function TTY_Descriptor
+     (Handle : TTY_Handle) return GNAT.OS_Lib.File_Descriptor
+   is
+      function Internal
+        (Handle : System.Address) return GNAT.OS_Lib.File_Descriptor;
+      pragma Import (C, Internal, "gvd_tty_fd");
+
+   begin
+      Check_TTY (Handle);
+      return Internal (Handle.Handle);
+   end TTY_Descriptor;
+
+   --------------
+   -- TTY_Name --
+   --------------
+
+   function TTY_Name (Handle : TTY_Handle) return String is
+      function Internal (Handle : System.Address) return chars_ptr;
+      pragma Import (C, Internal, "gvd_tty_name");
+
+   begin
+      Check_TTY (Handle);
+      return Value (Internal (Handle.Handle));
+   end TTY_Name;
+
+   -------------------
+   -- TTY_Supported --
+   -------------------
+
+   function TTY_Supported return Boolean is
+      function Internal return Integer;
+      pragma Import (C, Internal, "gvd_tty_supported");
+
+   begin
+      return Internal /= 0;
+   end TTY_Supported;
+
+   ---------------
+   -- Reset_TTY --
+   ---------------
+
+   procedure Reset_TTY (Handle : TTY_Handle) is
+      procedure Internal (Handle : System.Address);
+      pragma Import (C, Internal, "gvd_reset_tty");
+
+   begin
+      Check_TTY (Handle);
+      Internal (Handle.Handle);
+   end Reset_TTY;
+
+end GNAT.TTY;
============================================================
--- support/libtty/src/g-tty.ads	4df25af79080bfb76168a9f87d64f53a62c57650
+++ support/libtty/src/g-tty.ads	4df25af79080bfb76168a9f87d64f53a62c57650
@@ -0,0 +1,67 @@
+------------------------------------------------------------------------------
+--                                                                          --
+--                         GNAT LIBRARY COMPONENTS                          --
+--                                                                          --
+--                             G N A T . T T Y                              --
+--                                                                          --
+--                                 S p e c                                  --
+--                                                                          --
+--                     Copyright (C) 2002-2005 AdaCore                      --
+--                                                                          --
+-- GNAT is free software;  you can  redistribute it  and/or modify it under --
+-- terms of the  GNU General Public License as published  by the Free Soft- --
+-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT 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  distributed with GNAT;  see file COPYING.  If not, write --
+-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
+-- MA 02111-1307, USA.                                                      --
+--                                                                          --
+-- GNAT is maintained by AdaCore (http://www.adacore.com).                  --
+--                                                                          --
+------------------------------------------------------------------------------
+
+--  This package provides control over pseudo terminals, aka ttys.
+--  This package is only supported on unix systems. See function TTY_Supported
+--  to test dynamically whether other functions of this package can be called.
+
+with System;
+with GNAT.OS_Lib;
+
+package GNAT.TTY is
+
+   type TTY_Handle is private;
+   --  Handle for a tty descriptor.
+
+   function TTY_Supported return Boolean;
+   --  If True, the other functions of this package can be called.
+   --  Otherwise, all functions in this package will raise Program_Error if
+   --  called.
+
+   procedure Allocate_TTY (Handle : out TTY_Handle);
+   --  Allocate a new tty.
+
+   procedure Reset_TTY (Handle : TTY_Handle);
+   --  Reset settings of a given tty.
+
+   procedure Close_TTY (Handle : in out TTY_Handle);
+   --  Close a given tty.
+
+   function TTY_Name (Handle : TTY_Handle) return String;
+   --  Return the external name of a tty.
+   --  The name depends on the tty handling on the given target. It will
+   --  typically look like: "/dev/ptya1"
+
+   function TTY_Descriptor
+     (Handle : TTY_Handle) return GNAT.OS_Lib.File_Descriptor;
+   --  Return the low level descriptor associated with Handle.
+
+private
+
+   type TTY_Handle is record
+      Handle : System.Address := System.Null_Address;
+   end record;
+
+end GNAT.TTY;
============================================================
--- support/libtty/src/gexpect_tty.c.in	a4706e39df5b423e871b4f6fcd2c1d4a434bd551
+++ support/libtty/src/gexpect_tty.c.in	a4706e39df5b423e871b4f6fcd2c1d4a434bd551
@@ -0,0 +1,2207 @@
+/* Handling of pseudo-terminals
+   Adapted from process.c in GNU Emacs.
+   Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 1998
+      Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002 ACT-Europe.
+
+This file is part of GVD.
+
+GVD 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 2, or (at your option)
+any later version.
+
+GVD 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 GVD; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+*/
+
+/* Include the system-specific definitions */
+#include "@opsysfile@"
+
+#define P_(X) X
+#define RETSIGTYPE void
+
+#include "systty.h"
+#include <signal.h>
+#include "syssignal.h"
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>		/* some typedefs are used in sys/file.h */
+#ifndef __MINGW32__
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_STROPTS_H
+#include <sys/stropts.h>
+#endif
+
+#if defined(BSD_SYSTEM) || defined(STRIDE)
+#include <sys/ioctl.h>
+#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
+#include <fcntl.h>
+#endif /* HAVE_PTYS and no O_NDELAY */
+#endif /* BSD_SYSTEM || STRIDE */
+
+#ifdef HPUX
+#include <sys/ptyio.h>
+#endif
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#ifdef HAVE_PTYS
+/* The file name of the pty opened by allocate_pty.  */
+
+static char pty_name[24];
+#endif
+
+#ifdef AIX
+  /* Now define a symbol for the cpu type, if your compiler
+     does not define it automatically.  */
+  /* Emacs defines this in m/ibmrs6000.h, which is always included for
+     the powerpc/AIX machines (but not for x86/AIX machines) */
+#define IBMR2AIX
+#endif
+
+struct GVD_Process {
+  int infd;          /* descriptor to read from the process */
+  int outfd;         /* descriptor by which we write to the process */
+  int subtty;        /* descriptor for the tty that the process is using */
+  int pty_flag;      /* non-nil if communicating through a pty */
+  int status;        /* Symbol indicating status of the process:
+		        Qrun, Qopen, Qclosed */
+  int pid;           /* Number of this process */
+  char tty_name[24]; /* Name of TTY device */
+
+  sigset_t procmask;
+  int forkin, forkout;
+#ifdef WIN32
+  PROCESS_INFORMATION procinfo;
+#endif
+};
+
+#define NILP(x) ((x) == 0)
+#define Qnil 0
+#define Qt 1
+#define Qrun 2
+#define report_file_error(x, y) fprintf (stderr, "Error: "x"\n");
+#define XPROCESS(x) (x)
+#define XSETINT(x,y) (x)=(y)
+#define XFASTINT(a) ((a) + 0)
+#define XSETFASTINT(a, b) ((a) = (b))
+#define BLOCK_INPUT {}
+#define STRING_BYTES(x) strlen(x)
+#define fatal(a, b) fprintf(stderr, a), exit(1)
+#define INTEGERP(x) 1
+#define XINT(x) x
+
+/* Should use ptys or pipes to communicate with the processes ?
+   0 = pipe
+   1 = tty
+ */
+static int Vprocess_connection_type = 1;
+
+#ifdef WIN32
+#define pipe __gnat_pipe
+#define HAVE_NTGUI
+#define MAXPATHLEN 1024
+
+/* Control whether create_child causes the process to inherit GVD'
+   console window, or be given a new one of its own.  The default is
+   0, to allow multiple DOS programs to run on Win95.  Having separate
+   consoles also allows Gvd to cleanly terminate process groups.  */
+static int Vw32_start_process_share_console = 0;
+
+/* Control whether create_child cause the process to inherit GVD'
+   error mode setting.  The default is 1, to minimize the possibility of
+   subprocesses blocking when accessing unmounted drives.  */
+static int Vw32_start_process_inherit_error_mode = 1;
+
+/* Control whether create_child causes the process' window to be
+   hidden.  The default is 0. */
+static int Vw32_start_process_show_window = 0;
+
+/* Control whether spawnve quotes arguments as necessary to ensure
+   correct parsing by child process.  Because not all uses of spawnve
+   are careful about constructing argv arrays, we make this behaviour
+   conditional (off by default, since a similar operation is already done
+   in g-expect.adb by calling Normalize_Argument). */
+static int Vw32_quote_process_args = 0;
+
+static int
+nt_spawnve (char *exe, char **argv, char *env, PROCESS_INFORMATION *procinfo)
+{
+  STARTUPINFO start;
+  SECURITY_ATTRIBUTES sec_attrs;
+  SECURITY_DESCRIPTOR sec_desc;
+  DWORD flags;
+  char dir[ MAXPATHLEN ];
+  int pid;
+  char *cmdline, *parg, **targ;
+  int do_quoting = 0;
+  char escape_char;
+  int arglen;
+
+  /* we have to do some conjuring here to put argv and envp into the
+     form CreateProcess wants...  argv needs to be a space separated/null
+     terminated list of parameters, and envp is a null
+     separated/double-null terminated list of parameters.
+
+     Additionally, zero-length args and args containing whitespace or
+     quote chars need to be wrapped in double quotes - for this to work,
+     embedded quotes need to be escaped as well.  The aim is to ensure
+     the child process reconstructs the argv array we start with
+     exactly, so we treat quotes at the beginning and end of arguments
+     as embedded quotes.
+
+     Note that using backslash to escape embedded quotes requires
+     additional special handling if an embedded quote is already
+     preceeded by backslash, or if an arg requiring quoting ends with
+     backslash.  In such cases, the run of escape characters needs to be
+     doubled.  For consistency, we apply this special handling as long
+     as the escape character is not quote.
+
+     Since we have no idea how large argv and envp are likely to be we
+     figure out list lengths on the fly and allocate them.  */
+
+  if (!NILP (Vw32_quote_process_args))
+    {
+      do_quoting = 1;
+      /* Override escape char by binding w32-quote-process-args to
+	 desired character, or use t for auto-selection.  */
+      if (INTEGERP (Vw32_quote_process_args))
+	escape_char = XINT (Vw32_quote_process_args);
+      else
+	escape_char = '\\';
+    }
+
+  /* do argv...  */
+  arglen = 0;
+  targ = argv;
+  while (*targ)
+    {
+      char * p = *targ;
+      int need_quotes = 0;
+      int escape_char_run = 0;
+
+      if (*p == 0)
+	need_quotes = 1;
+      for ( ; *p; p++)
+	{
+	  if (*p == '"')
+	    {
+	      /* allow for embedded quotes to be escaped */
+	      arglen++;
+	      need_quotes = 1;
+	      /* handle the case where the embedded quote is already escaped */
+	      if (escape_char_run > 0)
+		{
+		  /* To preserve the arg exactly, we need to double the
+		     preceding escape characters (plus adding one to
+		     escape the quote character itself).  */
+		  arglen += escape_char_run;
+		}
+	    }
+	  else if (*p == ' ' || *p == '\t')
+	    {
+	      need_quotes = 1;
+	    }
+
+	  if (*p == escape_char && escape_char != '"')
+	    escape_char_run++;
+	  else
+	    escape_char_run = 0;
+	}
+      if (need_quotes)
+	{
+	  arglen += 2;
+	  /* handle the case where the arg ends with an escape char - we
+	     must not let the enclosing quote be escaped.  */
+	  if (escape_char_run > 0)
+	    arglen += escape_char_run;
+	}
+      arglen += strlen (*targ++) + 1;
+    }
+  cmdline = (char*)malloc (arglen + 1);
+  targ = argv;
+  parg = cmdline;
+  while (*targ)
+    {
+      char * p = *targ;
+      int need_quotes = 0;
+
+      if (*p == 0)
+	need_quotes = 1;
+
+      if (do_quoting)
+	{
+	  for ( ; *p; p++)
+	    if (*p == ' ' || *p == '\t' || *p == '"')
+	      need_quotes = 1;
+	}
+      if (need_quotes)
+	{
+	  int escape_char_run = 0;
+	  char * first;
+	  char * last;
+
+	  p = *targ;
+	  first = p;
+	  last = p + strlen (p) - 1;
+	  *parg++ = '"';
+	  for ( ; *p; p++)
+	    {
+	      if (*p == '"')
+		{
+		  /* double preceding escape chars if any */
+		  while (escape_char_run > 0)
+		    {
+		      *parg++ = escape_char;
+		      escape_char_run--;
+		    }
+		  /* escape all quote chars, even at beginning or end */
+		  *parg++ = escape_char;
+		}
+	      *parg++ = *p;
+
+	      if (*p == escape_char && escape_char != '"')
+		escape_char_run++;
+	      else
+		escape_char_run = 0;
+	    }
+	  /* double escape chars before enclosing quote */
+	  while (escape_char_run > 0)
+	    {
+	      *parg++ = escape_char;
+	      escape_char_run--;
+	    }
+	  *parg++ = '"';
+	}
+      else
+	{
+	  strcpy (parg, *targ);
+	  parg += strlen (*targ);
+	}
+      *parg++ = ' ';
+      targ++;
+    }
+  *--parg = '\0';
+
+  memset (&start, 0, sizeof (start));
+  start.cb = sizeof (start);
+
+#ifdef HAVE_NTGUI
+  if (NILP (Vw32_start_process_show_window))
+    start.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+  else
+    start.dwFlags = STARTF_USESTDHANDLES;
+  start.wShowWindow = SW_HIDE;
+
+  start.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
+  start.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
+  start.hStdError = GetStdHandle (STD_ERROR_HANDLE);
+#endif /* HAVE_NTGUI */
+
+  /* Explicitly specify no security */
+  if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION))
+    goto EH_Fail;
+  if (!SetSecurityDescriptorDacl (&sec_desc, TRUE, NULL, FALSE))
+    goto EH_Fail;
+  sec_attrs.nLength = sizeof (sec_attrs);
+  sec_attrs.lpSecurityDescriptor = &sec_desc;
+  sec_attrs.bInheritHandle = FALSE;
+
+  flags = (!NILP (Vw32_start_process_share_console)
+	   ? CREATE_NEW_PROCESS_GROUP
+	   : CREATE_NEW_CONSOLE);
+  if (NILP (Vw32_start_process_inherit_error_mode))
+    flags |= CREATE_DEFAULT_ERROR_MODE;
+  if (!CreateProcess (NULL, cmdline, &sec_attrs, NULL, TRUE,
+		      flags, env, ".", &start, procinfo))
+    goto EH_Fail;
+
+  pid = (int) procinfo->dwProcessId;
+
+  /* Hack for Windows 95, which assigns large (ie negative) pids */
+  if (pid < 0)
+    pid = -pid;
+
+  return pid;
+
+ EH_Fail:
+  return -1;
+}
+
+/* The following two routines are used to manipulate stdin, stdout, and
+   stderr of our child processes.
+
+   Assuming that in, out, and err are *not* inheritable, we make them
+   stdin, stdout, and stderr of the child as follows:
+
+   - Save the parent's current standard handles.
+   - Set the std handles to inheritable duplicates of the ones being passed in.
+     (Note that _get_osfhandle() is an io.h procedure that retrieves the
+     NT file handle for a crt file descriptor.)
+   - Spawn the child, which inherits in, out, and err as stdin,
+     stdout, and stderr. (see Spawnve)
+   - Close the std handles passed to the child.
+   - Reset the parent's standard handles to the saved handles.
+     (see reset_standard_handles)
+   We assume that the caller closes in, out, and err after calling us.  */
+
+static void
+prepare_standard_handles (int in, int out, int err, HANDLE handles[3])
+{
+  HANDLE parent;
+  HANDLE newstdin, newstdout, newstderr;
+
+  parent = GetCurrentProcess ();
+
+  handles[0] = GetStdHandle (STD_INPUT_HANDLE);
+  handles[1] = GetStdHandle (STD_OUTPUT_HANDLE);
+  handles[2] = GetStdHandle (STD_ERROR_HANDLE);
+
+  /* make inheritable copies of the new handles */
+  if (!DuplicateHandle (parent,
+		       (HANDLE) _get_osfhandle (in),
+		       parent,
+		       &newstdin,
+		       0,
+		       TRUE,
+		       DUPLICATE_SAME_ACCESS))
+    report_file_error ("Duplicating input handle for child", Qnil);
+
+  if (!DuplicateHandle (parent,
+		       (HANDLE) _get_osfhandle (out),
+		       parent,
+		       &newstdout,
+		       0,
+		       TRUE,
+		       DUPLICATE_SAME_ACCESS))
+    report_file_error ("Duplicating output handle for child", Qnil);
+
+  if (!DuplicateHandle (parent,
+		       (HANDLE) _get_osfhandle (err),
+		       parent,
+		       &newstderr,
+		       0,
+		       TRUE,
+		       DUPLICATE_SAME_ACCESS))
+    report_file_error ("Duplicating error handle for child", Qnil);
+
+  /* and store them as our std handles */
+  if (!SetStdHandle (STD_INPUT_HANDLE, newstdin))
+    report_file_error ("Changing stdin handle", Qnil);
+
+  if (!SetStdHandle (STD_OUTPUT_HANDLE, newstdout))
+    report_file_error ("Changing stdout handle", Qnil);
+
+  if (!SetStdHandle (STD_ERROR_HANDLE, newstderr))
+    report_file_error ("Changing stderr handle", Qnil);
+}
+
+static void
+reset_standard_handles (int in, int out, int err, HANDLE handles[3])
+{
+  /* close the duplicated handles passed to the child */
+  CloseHandle (GetStdHandle (STD_INPUT_HANDLE));
+  CloseHandle (GetStdHandle (STD_OUTPUT_HANDLE));
+  CloseHandle (GetStdHandle (STD_ERROR_HANDLE));
+
+  /* now restore parent's saved std handles */
+  SetStdHandle (STD_INPUT_HANDLE, handles[0]);
+  SetStdHandle (STD_OUTPUT_HANDLE, handles[1]);
+  SetStdHandle (STD_ERROR_HANDLE, handles[2]);
+}
+
+#endif /* WIN32 */
+
+/******************************************************
+ **  gvd_open ()
+ **
+ ******************************************************/
+
+static int
+gvd_open (char* path, int oflag, int mode)
+{
+  register int rtnval;
+
+#ifdef BSD4_1
+  if (oflag & O_CREAT)
+    return creat (path, mode);
+#endif
+
+  while ((rtnval = open (path, oflag, mode)) == -1
+         && (errno == EINTR));
+  return (rtnval);
+}
+
+/******************************************************
+ **  gvd_close ()
+ **
+ ******************************************************/
+
+static int
+gvd_close (fd)
+     int fd;
+{
+  int did_retry = 0;
+  register int rtnval;
+
+  while ((rtnval = close (fd)) == -1
+         && (errno == EINTR))
+    did_retry = 1;
+
+  /* If close is interrupted SunOS 4.1 may or may not have closed the
+     file descriptor.  If it did the second close will fail with
+     errno = EBADF.  That means we have succeeded.  */
+  if (rtnval == -1 && did_retry && errno == EBADF)
+    return 0;
+
+  return rtnval;
+}
+
+/*******************************************************
+ **  relocate_fd ()
+ **
+ **  Move the file descriptor FD so that its number is not less than MINFD.
+ **  If the file descriptor is moved at all, the original is freed.
+ *******************************************************/
+
+static int
+relocate_fd (fd, minfd)
+     int fd, minfd;
+{
+  if (fd >= minfd)
+    return fd;
+  else
+    {
+      int new = dup (fd);
+      if (new == -1)
+	{
+	  char *message1 = "Error while setting up child: ";
+	  char *errmessage = strerror (errno);
+	  char *message2 = "\n";
+	  write (2, message1, strlen (message1));
+	  write (2, errmessage, strlen (errmessage));
+	  write (2, message2, strlen (message2));
+	  _exit (1);
+	}
+      /* Note that we hold the original FD open while we recurse,
+	 to guarantee we'll get a new FD if we need it.  */
+      new = relocate_fd (new, minfd);
+      gvd_close (fd);
+      return new;
+    }
+}
+
+
+/********************************************************************
+ **  gvd_set_tty ()
+ **
+ **  Set the parameters of the tty on FD according to the contents of
+ **  *SETTINGS.  If FLUSHP is non-zero, we discard input.
+ **  Return 0 if all went well, and -1 if anything failed.
+ ********************************************************************/
+
+static int
+gvd_set_tty (fd, settings, flushp)
+     int fd;
+     struct gvd_tty *settings;
+     int flushp;
+{
+  /* Set the primary parameters - baud rate, character size, etcetera.  */
+#ifdef HAVE_TCATTR
+  int i;
+  /* We have those nifty POSIX tcmumbleattr functions.
+     William J. Smith <wjs@wiis.wang.com> writes:
+     "POSIX 1003.1 defines tcsetattr to return success if it was
+     able to perform any of the requested actions, even if some
+     of the requested actions could not be performed.
+     We must read settings back to ensure tty setup properly.
+     AIX requires this to keep tty from hanging occasionally."  */
+  /* This make sure that we don't loop indefinitely in here.  */
+  for (i = 0 ; i < 10 ; i++)
+    if (tcsetattr (fd, flushp ? TCSAFLUSH : TCSADRAIN, &settings->main) < 0)
+      {
+	if (errno == EINTR)
+	  continue;
+	else
+	  return -1;
+      }
+    else
+      {
+	struct termios new;
+
+	bzero (&new, sizeof (new));
+	/* Get the current settings, and see if they're what we asked for.  */
+	tcgetattr (fd, &new);
+	/* We cannot use memcmp on the whole structure here because under
+	 * aix386 the termios structure has some reserved field that may
+	 * not be filled in.
+	 */
+	if (   new.c_iflag == settings->main.c_iflag
+	    && new.c_oflag == settings->main.c_oflag
+	    && new.c_cflag == settings->main.c_cflag
+	    && new.c_lflag == settings->main.c_lflag
+	    && memcmp (new.c_cc, settings->main.c_cc, NCCS) == 0)
+	  break;
+	else
+	  continue;
+      }
+
+#else
+#ifdef HAVE_TERMIO
+  /* The SYSV-style interface?  */
+  if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0)
+    return -1;
+
+#else
+#ifdef VMS
+  /* Vehemently Monstrous System?  :-)  */
+  if (! (SYS$QIOW (0, fd, IO$_SETMODE, &input_iosb, 0, 0,
+		   &settings->main.class, 12, 0, 0, 0, 0)
+	 & 1))
+    return -1;
+
+#else
+#ifndef DOS_NT
+  /* I give up - I hope you have the BSD ioctls.  */
+  if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0)
+    return -1;
+#endif /* not DOS_NT */
+
+#endif
+#endif
+#endif
+
+  /* Suivant - Do we have to get struct ltchars data?  */
+#ifdef HAVE_LTCHARS
+  if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0)
+    return -1;
+#endif
+
+  /* How about a struct tchars and a wordful of lmode bits?  */
+#ifdef HAVE_TCHARS
+  if (ioctl (fd, TIOCSETC, &settings->tchars) < 0
+      || ioctl (fd, TIOCLSET, &settings->lmode) < 0)
+    return -1;
+#endif
+
+  /* We have survived the tempest.  */
+  return 0;
+}
+
+/****************************************************************
+ **  gvd_get_tty ()
+ **
+ **  Set *TC to the parameters associated with the terminal FD.
+ **  Return zero if all's well, or -1 if we ran into an error we
+ **  couldn't deal with.
+ ****************************************************************/
+
+static int
+gvd_get_tty (fd, settings)
+     int fd;
+     struct gvd_tty *settings;
+{
+  /* Retrieve the primary parameters - baud rate, character size, etcetera.  */
+#ifdef HAVE_TCATTR
+  /* We have those nifty POSIX tcmumbleattr functions.  */
+  bzero (&settings->main, sizeof (settings->main));
+  if (tcgetattr (fd, &settings->main) < 0)
+    return -1;
+
+#else
+#ifdef HAVE_TERMIO
+  /* The SYSV-style interface?  */
+  if (ioctl (fd, TCGETA, &settings->main) < 0)
+    return -1;
+
+#else
+#ifdef VMS
+  /* Vehemently Monstrous System?  :-)  */
+  if (! (SYS$QIOW (0, fd, IO$_SENSEMODE, settings, 0, 0,
+		   &settings->main.class, 12, 0, 0, 0, 0)
+	 & 1))
+    return -1;
+
+#else
+#ifndef DOS_NT
+  /* I give up - I hope you have the BSD ioctls.  */
+  if (ioctl (fd, TIOCGETP, &settings->main) < 0)
+    return -1;
+#endif /* not DOS_NT */
+#endif
+#endif
+#endif
+
+  /* Suivant - Do we have to get struct ltchars data?  */
+#ifdef HAVE_LTCHARS
+  if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0)
+    return -1;
+#endif
+
+  /* How about a struct tchars and a wordful of lmode bits?  */
+#ifdef HAVE_TCHARS
+  if (ioctl (fd, TIOCGETC, &settings->tchars) < 0
+      || ioctl (fd, TIOCLGET, &settings->lmode) < 0)
+    return -1;
+#endif
+
+  /* We have survived the tempest.  */
+  return 0;
+}
+
+/***********************************************************
+ **  sys_sigunblock ()
+ **
+ ***********************************************************/
+
+#ifndef WIN32
+
+sigset_t
+sys_sigunblock (sigset_t new_mask)
+{
+  sigset_t old_mask;
+  sigprocmask (SIG_UNBLOCK, (sigset_t*)&new_mask, &old_mask);
+  return (old_mask);
+}
+
+/************************************************************
+ **  sys_sigblock ()
+ **
+ ************************************************************/
+
+sigset_t
+sys_sigblock (sigset_t new_mask)
+{
+  sigset_t old_mask;
+  sigprocmask (SIG_BLOCK, &new_mask, &old_mask);
+  return (old_mask);
+}
+
+#endif /* WIN32 */
+
+/*************************************************************
+ **  sys_signal ()
+ **
+ *************************************************************/
+
+#ifdef POSIX_SIGNALS
+
+signal_handler_t
+sys_signal (int signal_number, signal_handler_t action)
+{
+  struct sigaction new_action, old_action;
+  sigemptyset (&new_action.sa_mask);
+  new_action.sa_handler = action;
+#ifdef SA_RESTART
+  /* Emacs mostly works better with restartable system services. If this
+   * flag exists, we probably want to turn it on here.
+   */
+  new_action.sa_flags = SA_RESTART;
+#else
+  new_action.sa_flags = 0;
+#endif /* SA_RESTART */
+  sigaction (signal_number, &new_action, &old_action);
+  return (old_action.sa_handler);
+}
+
+#endif  /* POSIX_SIGNALS */
+
+/***********************************************************
+ **  setup_pty ()
+ **
+ ** Set up the proper status flags for use of a pty.
+ ***********************************************************/
+
+#ifdef HAVE_PTYS
+
+static void
+setup_pty (fd)
+     int fd;
+{
+  /* We might need to set flags on via ioctl calls, which requires the
+     address of a non-null variable.  */
+  int on = 1;
+
+  /* I'm told that TOICREMOTE does not mean control chars
+     "can't be sent" but rather that they don't have
+     input-editing or signaling effects.
+     That should be good, because we have other ways
+     to do those things in Emacs.
+     However, telnet mode seems not to work on 4.2.
+     So TIOCREMOTE is turned off now. */
+
+  /* Under hp-ux, if TIOCREMOTE is turned on, some calls
+     will hang.  In particular, the "timeout" feature (which
+     causes a read to return if there is no data available)
+     does this.  Also it is known that telnet mode will hang
+     in such a way that Emacs must be stopped (perhaps this
+     is the same problem).
+
+     If TIOCREMOTE is turned off, then there is a bug in
+     hp-ux which sometimes loses data.  Apparently the
+     code which blocks the master process when the internal
+     buffer fills up does not work.  Other than this,
+     though, everything else seems to work fine.
+
+     Since the latter lossage is more benign, we may as well
+     lose that way.  -- cph */
+#if defined (FIONBIO) && defined (SYSV_PTYS)
+  ioctl (fd, FIONBIO, &on);
+#endif
+#ifdef IBMRTAIX
+  /* On AIX, the parent gets SIGHUP when a pty attached child dies.  So, we */
+  /* ignore SIGHUP once we've started a child on a pty.  Note that this may */
+  /* cause GVD not to die when it should, i.e., when its own controlling  */
+  /* tty goes away.  I've complained to the AIX developers, and they may    */
+  /* change this behavior, but I'm not going to hold my breath.             */
+  signal (SIGHUP, SIG_IGN);
+#endif
+
+  /* Beeing able to trap exceptional conditions like a "close" on the
+     slave side is useful and requires an explicit ioctl call to be enabled on
+     HPUX.  */
+#ifdef HPUX
+  ioctl (fd, TIOCTRAP, &on);
+#endif
+}
+#endif /* HAVE_PTYS */
+
+#ifdef HAVE_PTYS
+
+static int allocate_pty_the_old_fashioned_way (void);
+
+/*********************************************************
+ **  allocate_pty ()
+ **  Open an available pty, returning a file descriptor.
+ **  Finds in the case of unix by checking devices
+ ** /dev/ptmx /dev/ptm/clone /dev/ptc and /dev/ptmx_bsd
+ **  On failure it tries allocate_pty_the_old_fashioned_way
+ **  Return -1 for final failure.
+ **  The file name of the terminal corresponding to the pty
+ **  is left in the variable pty_name.
+ **
+ *********************************************************/
+
+extern char *ptsname (int);
+
+static int
+allocate_pty (void)
+{
+  /* Unix98 standardized grantpt, unlockpt, and ptsname, but not the
+     functions required to open a master pty in the first place :-(
+
+     Modern Unix systems all seems to have convenience methods to open
+     a master pty fd in one function call, but there is little
+     agreement on how to do it.
+
+     allocate_pty() tries all the different known easy ways of opening
+     a pty.  In case of failure, we resort to the old BSD-style pty
+     grovelling code in allocate_pty_the_old_fashioned_way(). */
+
+  int master_fd = -1;
+  const char *slave_name = NULL;
+  const char *clone = NULL;
+  static const char * const clones[] = /* Different pty master clone devices */
+    {
+      "/dev/ptmx",      /* Various systems */
+      "/dev/ptm/clone", /* HPUX */
+      "/dev/ptc",       /* AIX */
+      "/dev/ptmx_bsd"   /* Tru64 */
+    };
+
+#if defined (OSF1) || defined (HPUX)
+  /* GPS does not apparently support well the new way of allocating ptys
+     under these platforms, so disable it for now ??? */
+  goto lose;
+#endif
+
+#ifdef HAVE_GETPT /* glibc */
+  master_fd = getpt ();
+  if (master_fd >= 0)
+    goto have_master;
+#endif /* HAVE_GETPT */
+
+#if defined(HAVE_OPENPTY) /* BSD, Tru64, glibc */
+  {
+    int slave_fd = -1;
+    int rc;
+    BLOCK_SIGNAL (SIGCHLD);
+    rc = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
+    UNBLOCK_SIGNAL (SIGCHLD);
+    if (rc == 0)
+      {
+	slave_name = ttyname (slave_fd);
+	close (slave_fd);
+	goto have_slave_name;
+      }
+    else
+      {
+	if (master_fd >= 0)
+	  close (master_fd);
+	if (slave_fd >= 0)
+	  close (slave_fd);
+      }
+  }
+#endif /* HAVE_OPENPTY */
+
+#if defined(HAVE__GETPTY) && defined (O_NDELAY) /* SGI */
+  master_fd = -1;
+  BLOCK_SIGNAL (SIGCHLD);
+  slave_name = _getpty (&master_fd, O_RDWR | O_NDELAY, 0600, 0);
+  UNBLOCK_SIGNAL (SIGCHLD);
+  if (master_fd >= 0 && slave_name != NULL)
+    goto have_slave_name;
+#endif /* HAVE__GETPTY */
+
+  /* Master clone devices are available on most systems */
+  {
+    int i;
+    for (i = 0; i < sizeof(clones)/sizeof(char*); i++)
+      {
+	clone = clones[i];
+	master_fd = open (clone, O_RDWR | O_NONBLOCK, 0);
+	if (master_fd >= 0)
+	  goto have_master;
+      }
+    clone = NULL;
+  }
+
+  goto lose;
+
+ have_master:
+
+#if defined (HAVE_PTSNAME)
+  slave_name = ptsname (master_fd);
+  if (slave_name)
+    goto have_slave_name;
+#endif
+
+  /* AIX docs say to use ttyname, not ptsname, to get slave_name */
+  if (clone
+      && !strcmp (clone, "/dev/ptc")
+      && (slave_name = ttyname (master_fd)) != NULL)
+    goto have_slave_name;
+
+  goto lose;
+
+ have_slave_name:
+  strncpy (pty_name, slave_name, sizeof (pty_name));
+  pty_name[sizeof (pty_name) - 1] = '\0';
+  setup_pty (master_fd);
+
+  /* We jump through some hoops to frob the pty.
+     It's not obvious that checking the return code here is useful. */
+
+  /* "The grantpt() function will fail if it is unable to successfully
+      invoke the setuid root program.  It may also fail if the
+      application has installed a signal handler to catch SIGCHLD
+      signals." */
+
+#if defined (HAVE_GRANTPT) || defined (HAVE_UNLOCKPT)
+  BLOCK_SIGNAL (SIGCHLD);
+
+#if defined (HAVE_GRANTPT)
+  grantpt (master_fd);
+#endif /* HAVE_GRANTPT */
+
+#if defined (HAVE_UNLOCKPT)
+  unlockpt (master_fd);
+#endif
+
+  UNBLOCK_SIGNAL (SIGCHLD);
+#endif /* HAVE_GRANTPT || HAVE_UNLOCKPT */
+
+  return master_fd;
+
+ lose:
+  if (master_fd >= 0)
+    close (master_fd);
+
+  return allocate_pty_the_old_fashioned_way ();
+}
+
+/*********************************************************
+ **  allocate_pty_the_old_fashioned_way ()
+ **  Open an available pty, returning a file descriptor.
+ **  Finds in the case of unix the bsd type ptys by search.
+ **  Return -1 on failure.
+ **  The file name of the terminal corresponding to the pty
+ **  is left in the variable pty_name.
+ **
+ *********************************************************/
+
+static int
+allocate_pty_the_old_fashioned_way ()
+{
+  struct stat stb;
+  int c, i;
+  int fd;
+
+  /* Some systems name their pseudoterminals so that there are gaps in
+     the usual sequence - for example, on HP9000/S700 systems, there
+     are no pseudoterminals with names ending in 'f'.  So we wait for
+     three failures in a row before deciding that we've reached the
+     end of the ptys.  */
+  int failed_count = 0;
+
+#ifdef PTY_ITERATION
+  PTY_ITERATION
+#else
+  for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
+    for (i = 15; i >= 0; i--)
+#endif
+      {
+#ifdef PTY_NAME_SPRINTF
+	PTY_NAME_SPRINTF
+#else
+	sprintf (pty_name, "/dev/pty%c%x", c, i);
+#endif /* no PTY_NAME_SPRINTF */
+
+#ifdef PTY_OPEN
+	PTY_OPEN;
+#else /* no PTY_OPEN */
+	if (stat (pty_name, &stb) < 0)
+	  {
+	    failed_count++;
+	    if (failed_count >= 3)
+	      return -1;
+	  }
+	else
+	  failed_count = 0;
+#ifdef O_NONBLOCK
+	fd = gvd_open (pty_name, O_RDWR | O_NONBLOCK, 0);
+#else
+	fd = gvd_open (pty_name, O_RDWR | O_NDELAY, 0);
+#endif
+#endif /* no PTY_OPEN */
+
+	if (fd >= 0)
+	  {
+	    /* check to make certain that both sides are available
+	       this avoids a nasty yet stupid bug in rlogins */
+#ifdef PTY_TTY_NAME_SPRINTF
+	    PTY_TTY_NAME_SPRINTF
+#else
+            sprintf (pty_name, "/dev/tty%c%x", c, i);
+#endif /* no PTY_TTY_NAME_SPRINTF */
+            if (access (pty_name, 6) == 0)
+              {
+                setup_pty (fd);
+                return fd;
+              }
+            close (fd);
+	  }
+      }
+  fprintf (stderr, "return -1 from allocate_tty\n");
+  return -1;
+}
+#endif /* HAVE_PTYS */
+
+
+/**********************************************************
+ **  child_setup_tty ()
+ **
+ **  Set up the terminal at the other end of a pseudo-terminal that
+ **  we will be controlling an inferior through.
+ **  It should not echo or do line-editing, since that is done
+ **  in GVD. No padding needed for insertion into a buffer.
+ **
+ ***********************************************************/
+
+static void
+child_setup_tty (out)
+     int out;
+{
+#ifndef DOS_NT
+  struct gvd_tty s;
+
+  GVD_GET_TTY (out, &s);
+
+#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
+  s.main.c_oflag |= OPOST;	/* Enable output postprocessing */
+  s.main.c_oflag &= ~ONLCR;	/* Disable map of NL to CR-NL on output */
+#ifdef NLDLY
+  s.main.c_oflag &= ~(NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY);
+  				/* No output delays */
+#endif
+  s.main.c_lflag &= ~ECHO;	/* Disable echo */
+  s.main.c_lflag |= ISIG;	/* Enable signals */
+#ifdef IUCLC
+  s.main.c_iflag &= ~IUCLC;	/* Disable downcasing on input.  */
+#endif
+#ifdef ISTRIP
+  s.main.c_iflag &= ~ISTRIP;	/* don't strip 8th bit on input */
+#endif
+#ifdef OLCUC
+  s.main.c_oflag &= ~OLCUC;	/* Disable upcasing on output.  */
+#endif
+  /*s.main.c_oflag &= ~TAB3;	/* Disable tab expansion */
+  s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */
+#if 0
+  /* Said to be unnecessary:  */
+  s.main.c_cc[VMIN] = 1;	/* minimum number of characters to accept  */
+  s.main.c_cc[VTIME] = 0;	/* wait forever for at least 1 character  */
+#endif
+
+  s.main.c_lflag |= ICANON;	/* Enable erase/kill and eof processing */
+  s.main.c_cc[VEOF] = 04;	/* insure that EOF is Control-D */
+  s.main.c_cc[VERASE] = CDISABLE;	/* disable erase processing */
+  s.main.c_cc[VKILL] = CDISABLE;	/* disable kill processing */
+
+
+#ifdef HPUX
+  s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */
+#endif /* HPUX */
+
+#ifdef OSF1
+  /* ??? For some unknown reason, Control-C character is set to Ctrl-D, so
+     force settings to a known value */
+  s.main.c_cc[VQUIT] = '\\'&037;      /* Control-\ */
+  s.main.c_cc[VINTR] = 'C'&037;       /* Control-C */
+#endif
+
+#ifdef AIX
+/* AIX enhanced edit loses NULs, so disable it */
+#ifndef IBMR2AIX
+  s.main.c_line = 0;
+  s.main.c_iflag &= ~ASCEDIT;
+#endif
+  /* Also, PTY overloads NUL and BREAK.
+     don't ignore break, but don't signal either, so it looks like NUL.  */
+  s.main.c_iflag &= ~IGNBRK;
+  s.main.c_iflag &= ~BRKINT;
+  /* QUIT and INTR work better as signals, so disable character forms */
+  s.main.c_cc[VINTR] = 0377;
+#ifdef SIGNALS_VIA_CHARACTERS
+  /* the QUIT and INTR character are used in process_send_signal
+     so set them here to something useful.  */
+  if (s.main.c_cc[VQUIT] == 0377)
+    s.main.c_cc[VQUIT] = '\\'&037;	/* Control-\ */
+  if (s.main.c_cc[VINTR] == 0377)
+    s.main.c_cc[VINTR] = 'C'&037;	/* Control-C */
+#else /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */
+  /* QUIT and INTR work better as signals, so disable character forms */
+  s.main.c_cc[VQUIT] = 0377;
+  s.main.c_cc[VINTR] = 0377;
+  s.main.c_lflag &= ~ISIG;
+#endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */
+  s.main.c_cc[VEOL] = 0377;
+  s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */
+#endif /* AIX */
+
+#else /* not HAVE_TERMIO */
+
+  s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE
+		       | CBREAK | TANDEM);
+  s.main.sg_flags |= LPASS8;
+  s.main.sg_erase = 0377;
+  s.main.sg_kill = 0377;
+  s.lmode = LLITOUT | s.lmode;        /* Don't strip 8th bit */
+
+#endif /* not HAVE_TERMIO */
+
+  GVD_SET_TTY (out, &s, 0);
+
+#ifdef BSD4_1
+  if (interrupt_input)
+    reset_sigio ();
+#endif /* BSD4_1 */
+#ifdef RTU
+  {
+    int zero = 0;
+    ioctl (out, FIOASYNC, &zero);
+  }
+#endif /* RTU */
+#endif /* not DOS_NT */
+}
+
+/************************************************************
+ **  child_setup ()
+ **
+ **  This is the last thing run in a newly forked inferior
+ **  either synchronous or asynchronous.
+ **  Copy descriptors IN, OUT and ERR as descriptors 0, 1 and 2.
+ **  Initialize inferior's priority, pgrp, connected dir and environment.
+ **  then exec another program based on new_argv.
+ **
+ **  This function may change environ for the superior process.
+ **  Therefore, the superior process must save and restore the value
+ **  of environ around the vfork and the call to this function.
+ **
+ **  SET_PGRP is nonzero if we should put the subprocess into a separate
+ **  process group.
+ **
+ **  CURRENT_DIR is a string giving the path of the current
+ **  directory the subprocess should have.  Since we can't really signal
+ **  a decent error from within the child, this should be verified as an
+ **  executable directory by the parent.
+ **
+ **************************************************************/
+
+#ifndef VMS /* VMS version is in vmcproc.c */
+static int
+child_setup (in, out, err, new_argv, set_pgrp, current_dir, process)
+     int in, out, err;
+     register char **new_argv;
+     int set_pgrp;
+     char *current_dir;
+     struct GVD_Process *process;
+{
+  char **env;
+  char *pwd_var;
+#ifdef WINDOWSNT
+  int cpid;
+  HANDLE handles[3];
+#endif /* WINDOWSNT */
+
+  int pid = getpid ();
+
+  /* ??? Original Emacs code had a section to deal with the current directory.
+     This code has been removed completely. */
+
+  /* ??? Original Emacs code had a section to deal with the setting of
+     `env' to a vector of the strings in Vprocess_environment.
+     This code has been removed completely. */
+
+#ifdef WINDOWSNT
+  prepare_standard_handles (in, out, err, handles);
+
+#else  /* not WINDOWSNT */
+  /* Make sure that in, out, and err are not actually already in
+     descriptors zero, one, or two; this could happen if GVD is
+     started with its standard in, out, or error closed, as might
+     happen under X.  */
+  {
+    int oin = in, oout = out;
+
+    /* We have to avoid relocating the same descriptor twice!  */
+
+    in = relocate_fd (in, 3);
+
+    if (out == oin)
+      out = in;
+    else
+      out = relocate_fd (out, 3);
+
+    if (err == oin)
+      err = in;
+    else if (err == oout)
+      err = out;
+    else
+      err = relocate_fd (err, 3);
+  }
+
+#ifndef MSDOS
+  gvd_close (0);
+  gvd_close (1);
+  gvd_close (2);
+
+  dup2 (in, 0);
+  dup2 (out, 1);
+  dup2 (err, 2);
+  gvd_close (in);
+  gvd_close (out);
+  gvd_close (err);
+#endif /* not MSDOS */
+#endif /* not WINDOWSNT */
+
+#if defined(USG) && !defined(BSD_PGRPS)
+#ifndef SETPGRP_RELEASES_CTTY
+  setpgrp ();			/* No arguments but equivalent in this case */
+#endif
+#else
+#ifdef HAVE_SETPGID
+  setpgid (pid, pid);
+#endif /* HAVE_SETPGID */
+#endif /* USG */
+
+  /* setpgrp_of_tty is incorrect here; it uses input_fd.  */
+  GVD_SET_TTY_PGRP (0, &pid);
+
+#ifdef vipc
+  something missing here;
+#endif /* vipc */
+
+#ifdef MSDOS
+  pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
+  if (pid == -1)
+    /* An error occurred while trying to run the subprocess.  */
+    report_file_error ("Spawning child process", Qnil);
+  return pid;
+#else  /* not MSDOS */
+#ifdef WINDOWSNT
+  /* Spawn the child. */
+  cpid = nt_spawnve (new_argv[0], new_argv, NULL, &process->procinfo);
+  if (cpid == -1)
+    /* An error occurred while trying to spawn the process.  */
+    report_file_error ("Spawning child process", Qnil);
+  reset_standard_handles (in, out, err, handles);
+  return cpid;
+#else /* not WINDOWSNT */
+  /* execvp does not accept an environment arg so the only way
+     to pass this environment is to set environ.  Our caller
+     is responsible for restoring the ambient value of environ.  */
+  /* Disabled env handling in GVD ??? */
+  execvp (new_argv[0], new_argv);
+
+  write (1, "Can't exec program: ", 20);
+  write (1, new_argv[0], strlen (new_argv[0]));
+  write (1, "\n", 1);
+  _exit (1);
+#endif /* not WINDOWSNT */
+#endif /* not MSDOS */
+}
+#endif /* VMS */
+
+/********************************
+ **  gvd_free_process ()
+ ********************************/
+
+void
+gvd_free_process (struct GVD_Process** process)
+{
+   free (*process);
+   *process = NULL;
+}
+
+/********************************
+ **  gvd_setup_communication ()
+ ********************************/
+
+int
+gvd_setup_communication (struct GVD_Process** process_out) /* output param */
+{
+  struct GVD_Process* process;
+  int pid, inchannel, outchannel;
+  int sv[2];
+#ifdef POSIX_SIGNALS
+  sigset_t blocked;
+  struct sigaction sigint_action;
+  struct sigaction sigquit_action;
+#ifdef AIX
+  struct sigaction sighup_action;
+#endif /* AIX */
+#endif /* !POSIX_SIGNALS */
+  /* Use volatile to protect variables from being clobbered by longjmp.  */
+  volatile int forkin, forkout;
+  volatile int pty_flag = 0;
+
+
+  process = (struct GVD_Process*)malloc (sizeof (struct GVD_Process));
+  *process_out = process;
+
+  inchannel = outchannel = -1;
+
+#ifdef HAVE_PTYS
+  if (!NILP (Vprocess_connection_type))
+    outchannel = inchannel = allocate_pty ();
+
+  if (inchannel >= 0)
+    {
+#ifndef USG
+      /* On USG systems it does not work to open the pty's tty here
+	       and then close and reopen it in the child.  */
+#ifdef O_NOCTTY
+      /* Don't let this terminal become our controlling terminal
+	 (in case we don't have one).  */
+      forkout = forkin = gvd_open (pty_name, O_RDWR | O_NOCTTY, 0);
+#else  /* O_NOCTTY */
+      forkout = forkin = gvd_open (pty_name, O_RDWR, 0);
+#endif /* O_NOCTTY */
+      if (forkin < 0)
+	report_file_error ("Opening pty", Qnil);
+#else /* not USG */
+      forkin = forkout = -1;
+#endif /* not USG */
+      pty_flag = 1;
+    }
+  else
+#endif /* HAVE_PTYS */
+#ifdef SKTPAIR
+    {
+      if (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) < 0)
+	report_file_error ("Opening socketpair", Qnil);
+      outchannel = inchannel = sv[0];
+      forkout = forkin = sv[1];
+    }
+#else /* not SKTPAIR */
+    {
+      int tem;
+      tem = pipe (sv);
+      if (tem < 0)
+	report_file_error ("Can't create pipe", Qnil);
+      inchannel = sv[0];
+      forkout = sv[1];
+      tem = pipe (sv);
+      if (tem < 0)
+	{
+	  gvd_close (inchannel);
+	  gvd_close (forkout);
+	  report_file_error ("Can't create pipe", Qnil);
+	}
+      outchannel = sv[1];
+      forkin = sv[0];
+    }
+#endif /* not SKTPAIR */
+
+/* Stride people say it's a mystery why this is needed
+   as well as the O_NDELAY, but that it fails without this.  */
+#if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS))
+  {
+    int one = 1;
+    ioctl (inchannel, FIONBIO, &one);
+  }
+#endif /* STRIDE */
+
+#ifdef O_NONBLOCK
+  fcntl (inchannel, F_SETFL, O_NONBLOCK);
+  fcntl (outchannel, F_SETFL, O_NONBLOCK);
+#else /* O_NONBLOCK */
+#ifdef O_NDELAY
+  fcntl (inchannel, F_SETFL, O_NDELAY);
+  fcntl (outchannel, F_SETFL, O_NDELAY);
+#endif /* O_NDELAY */
+#endif /* O_NONBLOCK */
+
+  /* Record this as an active process, with its channels.
+     As a result, child_setup will close Gvd's side of the pipes.  */
+  XSETINT (XPROCESS (process)->infd, inchannel);
+  XSETINT (XPROCESS (process)->outfd, outchannel);
+  /* Record the tty descriptor used in the subprocess.  */
+  if (forkin < 0)
+    XPROCESS (process)->subtty = Qnil;
+  else
+    XSETFASTINT (XPROCESS (process)->subtty, forkin);
+  XPROCESS (process)->pty_flag = (pty_flag ? Qt : Qnil);
+  XPROCESS (process)->status = Qrun;
+
+  /* Delay interrupts until we have a chance to store
+     the new fork's pid in its process structure */
+#ifdef POSIX_SIGNALS
+  sigemptyset (&blocked);
+#ifdef SIGCHLD
+  sigaddset (&blocked, SIGCHLD);
+#endif /* SIGCHLD */
+#ifdef HAVE_VFORK
+  /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal',
+     this sets the parent's signal handlers as well as the child's.
+     So delay all interrupts whose handlers the child might munge,
+     and record the current handlers so they can be restored later.  */
+  sigaddset (&blocked, SIGINT );  sigaction (SIGINT , 0, &sigint_action );
+  sigaddset (&blocked, SIGQUIT);  sigaction (SIGQUIT, 0, &sigquit_action);
+#ifdef AIX
+  sigaddset (&blocked, SIGHUP );  sigaction (SIGHUP , 0, &sighup_action );
+#endif /* AIX */
+#endif /* HAVE_VFORK */
+  sigprocmask (SIG_BLOCK, &blocked, &(process->procmask));
+#else /* !POSIX_SIGNALS */
+#ifdef SIGCHLD
+#ifdef BSD4_1
+  sighold (SIGCHLD);
+#else /* not BSD4_1 */
+#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+  sigsetmask (sigmask (SIGCHLD));
+#endif /* ordinary USG */
+#endif /* not BSD4_1 */
+#endif /* SIGCHLD */
+#endif /* !POSIX_SIGNALS */
+
+  /* Until we store the proper pid, enable sigchld_handler
+     to recognize an unknown pid as standing for this process.
+     It is very important not to let this `marker' value stay
+     in the table after this function has returned; if it does
+     it might cause call-process to hang and subsequent asynchronous
+     processes to get their return values scrambled.  */
+  XSETINT (XPROCESS (process)->pid, -1);
+
+  BLOCK_INPUT;
+
+  /* child_setup must clobber environ on systems with true vfork.
+     Protect it from permanent change.
+
+     process->save_environ = environ; */
+  process->forkin = forkin;
+  process->forkout = forkout;
+}
+
+/***************************************************************
+ ** gvd_setup_child_communication ()
+ **
+ ***************************************************************/
+
+int
+gvd_setup_child_communication (struct GVD_Process* process, char** new_argv)
+{
+  char* current_dir = ".";
+  int pid = 0;
+
+  int xforkin = process->forkin;
+  int xforkout = process->forkout;
+
+  /* Make the pty be the controlling terminal of the process.  */
+#ifdef HAVE_PTYS
+  /* First, disconnect its current controlling terminal.  */
+#ifdef HAVE_SETSID
+  /* We tried doing setsid only if pty_flag, but it caused
+     process_set_signal to fail on SGI when using a pipe.  */
+  setsid ();
+  /* Make the pty's terminal the controlling terminal.  */
+  if (process->pty_flag == Qt)
+    {
+#ifdef TIOCSCTTY
+      /* We ignore the return value
+	 because faith@cs.unc.edu says that is necessary on Linux.  */
+      ioctl (xforkin, TIOCSCTTY, 0);
+#endif /* TIOCSCTTY */
+    }
+#else /* not HAVE_SETSID */
+#ifdef USG
+  /* It's very important to call setpgrp here and no time
+     afterwards.  Otherwise, we lose our controlling tty which
+     is set when we open the pty. */
+  setpgrp ();
+#endif /* USG */
+#endif /* not HAVE_SETSID */
+#if defined (HAVE_TERMIOS) && defined (LDISC1)
+  if (process->pty_flag == Qt && xforkin >= 0)
+    {
+      struct termios t;
+      tcgetattr (xforkin, &t);
+      t.c_lflag = LDISC1;
+      if (tcsetattr (xforkin, TCSANOW, &t) < 0)
+	write (1, "create_process/tcsetattr LDISC1 failed\n", 39);
+    }
+#else
+#if defined (NTTYDISC) && defined (TIOCSETD)
+  if (process->pty_flag == Qt && xforkin >= 0)
+    {
+      /* Use new line discipline.  */
+      int ldisc = NTTYDISC;
+      ioctl (xforkin, TIOCSETD, &ldisc);
+    }
+#endif
+#endif
+#ifdef TIOCNOTTY
+  /* In 4.3BSD, the TIOCSPGRP bug has been fixed, and now you
+     can do TIOCSPGRP only to the process's controlling tty.  */
+  if (process->pty_flag == Qt)
+    {
+      /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here?
+	 I can't test it since I don't have 4.3.  */
+      int j = gvd_open ("/dev/tty", O_RDWR, 0);
+      ioctl (j, TIOCNOTTY, 0);
+      gvd_close (j);
+#ifndef USG
+      /* In order to get a controlling terminal on some versions
+	 of BSD, it is necessary to put the process in pgrp 0
+	 before it opens the terminal.  */
+#ifdef HAVE_SETPGID
+      setpgid (0, 0);
+#else
+      setpgrp (0, 0);
+#endif
+#endif
+    }
+#endif /* TIOCNOTTY */
+
+#if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY)
+/*** There is a suggestion that this ought to be a
+     conditional on TIOCSPGRP,
+     or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)).
+     Trying the latter gave the wrong results on Debian GNU/Linux 1.1;
+     that system does seem to need this code, even though
+     both HAVE_SETSID and TIOCSCTTY are defined.  */
+  /* Now close the pty (if we had it open) and reopen it.
+     This makes the pty the controlling terminal of the subprocess.  */
+  if (process->pty_flag == Qt)
+    {
+#ifdef SET_CHILD_PTY_PGRP
+      int pgrp = getpid ();
+#endif
+
+      /* I wonder if gvd_close (gvd_open (pty_name, ...))
+	 would work?  */
+      if (xforkin >= 0)
+	gvd_close (xforkin);
+      xforkout = xforkin = gvd_open (pty_name, O_RDWR, 0);
+
+      if (xforkin < 0)
+	{
+	  write (1, "Couldn't open the pty terminal ", 31);
+	  write (1, pty_name, strlen (pty_name));
+	  write (1, "\n", 1);
+	  _exit (1);
+	}
+
+#ifdef SET_CHILD_PTY_PGRP
+      ioctl (xforkin, TIOCSPGRP, &pgrp);
+      ioctl (xforkout, TIOCSPGRP, &pgrp);
+#endif
+    }
+#endif /* not UNIPLUS and not RTU and not DONT_REOPEN_PTY */
+
+#ifdef SETUP_SLAVE_PTY
+  if (process->pty_flag == Qt)
+    {
+      SETUP_SLAVE_PTY;
+    }
+#endif /* SETUP_SLAVE_PTY */
+#ifdef AIX
+  /* On AIX, we've disabled SIGHUP above once we start a child on a pty.
+     Now reenable it in the child, so it will die when we want it to.  */
+  if (process->pty_flag == Qt)
+    signal (SIGHUP, SIG_DFL);
+#endif
+#endif /* HAVE_PTYS */
+
+  signal (SIGINT, SIG_DFL);
+
+#ifndef WIN32
+  signal (SIGQUIT, SIG_DFL);
+#endif /* WIN32 */
+
+  /* Stop blocking signals in the child.  */
+#ifdef POSIX_SIGNALS
+  sigprocmask (SIG_SETMASK, &(process->procmask), 0);
+#else /* !POSIX_SIGNALS */
+#ifdef SIGCHLD
+#ifdef BSD4_1
+  sigrelse (SIGCHLD);
+#else /* not BSD4_1 */
+#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+  sigsetmask (SIGEMPTYMASK);
+#endif /* ordinary USG */
+#endif /* not BSD4_1 */
+#endif /* SIGCHLD */
+#endif /* !POSIX_SIGNALS */
+
+  if (process->pty_flag)
+    child_setup_tty (xforkout);
+#ifdef WINDOWSNT
+  pid = child_setup (xforkin, xforkout, xforkout,
+		     new_argv, 1, current_dir, process);
+#else  /* not WINDOWSNT */
+  child_setup (xforkin, xforkout, xforkout,
+	       new_argv, 1, current_dir, process);
+#endif /* not WINDOWSNT */
+
+  process->pid=pid;
+  return pid;
+}
+
+
+/**************************************************************
+ **  gvd_setup_parent_communication ()
+ **
+ **************************************************************/
+
+int
+gvd_setup_parent_communication
+   (struct GVD_Process* process,
+    int*   in_fd,  /* output */
+    int*   out_fd, /* output */
+    int*   err_fd, /* output */
+    int*   pid_out) /* in-out parameter */
+{
+  process->pid = *pid_out;
+
+  /* This runs in the Gvd process.  */
+  if (process->pid < 0)
+    {
+      if (process->forkin >= 0)
+	gvd_close (process->forkin);
+      if (process->forkin != process->forkout && process->forkout >= 0)
+	gvd_close (process->forkout);
+    }
+  else
+    {
+      /* ??? Removed Emacs code that deals with the following situation:
+	 If the subfork execv fails, and it exits,
+	 this close hangs.  I don't know why.
+	 So have an interrupt jar it loose.  */
+
+      if (process->forkin != process->forkout && process->forkout >= 0)
+	gvd_close (process->forkout);
+
+#ifdef HAVE_PTYS
+      strcpy (process->tty_name, pty_name);
+#else
+      *process->tty_name = '\0';
+#endif
+    }
+
+  /* Restore the signal state whether vfork succeeded or not.
+     (We will signal an error, below, if it failed.)  */
+#ifdef POSIX_SIGNALS
+#ifdef HAVE_VFORK
+  /* Restore the parent's signal handlers.  */
+  sigaction (SIGINT, &sigint_action, 0);
+  sigaction (SIGQUIT, &sigquit_action, 0);
+#ifdef AIX
+  sigaction (SIGHUP, &sighup_action, 0);
+#endif
+#endif /* HAVE_VFORK */
+  /* Stop blocking signals in the parent.  */
+  sigprocmask (SIG_SETMASK, &(process->procmask), 0);
+#else /* !POSIX_SIGNALS */
+#ifdef SIGCHLD
+#ifdef BSD4_1
+  sigrelse (SIGCHLD);
+#else /* not BSD4_1 */
+#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX)
+  sigsetmask (SIGEMPTYMASK);
+#endif /* ordinary USG */
+#endif /* not BSD4_1 */
+#endif /* SIGCHLD */
+#endif /* !POSIX_SIGNALS */
+
+  /* Now generate the error if vfork failed.  */
+  if (process->pid < 0)
+    report_file_error ("Doing vfork", Qnil);
+
+  *in_fd = process->outfd;
+  *out_fd = process->infd;
+  *err_fd = process->infd;
+}
+
+/* Ctrl-C Handling */
+
+#ifndef WIN32
+
+#ifdef subprocesses
+
+/*
+ *    flush any pending output
+ *      (may flush input as well; it does not matter the way we use it)
+ */
+
+static void
+flush_pending_output (channel)
+     int channel;
+{
+#ifdef HAVE_TERMIOS
+  /* If we try this, we get hit with SIGTTIN, because
+     the child's tty belongs to the child's pgrp. */
+#else
+#ifdef TCFLSH
+  ioctl (channel, TCFLSH, 1);
+#else
+#ifdef TIOCFLUSH
+  int zero = 0;
+  /* 3rd arg should be ignored
+     but some 4.2 kernels actually want the address of an int
+     and nonzero means something different.  */
+  ioctl (channel, TIOCFLUSH, &zero);
+#endif  /* TIOCFLUSH */
+#endif  /* TCFLSH */
+#endif  /* HAVE_TERMIOS */
+}
+
+#endif  /* subprocess */
+
+/* send a signal number SIGNO to PROCESS.
+   If CURRENT_GROUP is t, that means send to the process group
+   that currently owns the terminal being used to communicate with PROCESS.
+   This is used for various commands in shell mode.
+   If CURRENT_GROUP is lambda, that means send to the process group
+   that currently owns the terminal, but only if it is NOT the shell itself.
+
+   If we can, we try to signal PROCESS by sending control characters
+   down the pty.  This allows us to signal inferiors who have changed
+   their uid, for which killpg would return an EPERM error.  */
+
+static void
+process_send_signal (p, signo, current_group)
+     struct GVD_Process* p;
+     int signo;
+     int current_group;
+{
+  int gid;
+  int no_pgrp = 0;
+
+  if (NILP (p->pty_flag))
+    current_group = Qnil;
+
+  /* If we are using pgrps, get a pgrp number and make it negative.  */
+  if (!NILP (current_group))
+    {
+#ifdef SIGNALS_VIA_CHARACTERS
+      /* If possible, send signals to the entire pgrp
+	 by sending an input character to it.  */
+
+      /* TERMIOS is the latest and bestest, and seems most likely to
+         work.  If the system has it, use it.  */
+#ifdef HAVE_TERMIOS
+      struct termios t;
+
+      switch (signo)
+	{
+	case SIGINT:
+	  tcgetattr (XINT (p->infd), &t);
+	  write (p->outfd, &t.c_cc[VINTR], 1);
+	  return;
+
+	case SIGQUIT:
+	  tcgetattr (XINT (p->infd), &t);
+	  write (p->outfd, &t.c_cc[VQUIT], 1);
+  	  return;
+
+  	case SIGTSTP:
+	  tcgetattr (XINT (p->infd), &t);
+#if defined (VSWTCH) && !defined (PREFER_VSUSP)
+	  write (p->outfd, &t.c_cc[VSWTCH], 1);
+#else
+	  write (p->outfd, &t.c_cc[VSUSP], 1);
+#endif
+  	  return;
+	}
+
+#else /* ! HAVE_TERMIOS */
+
+      /* On Berkeley descendants, the following IOCTL's retrieve the
+	 current control characters.  */
+#if defined (TIOCGLTC) && defined (TIOCGETC)
+
+      struct tchars c;
+      struct ltchars lc;
+
+      switch (signo)
+	{
+	case SIGINT:
+	  ioctl (XINT (p->infd), TIOCGETC, &c);
+	  write (p->outfd, &c.t_intrc, 1);
+	  return;
+	case SIGQUIT:
+	  ioctl (XINT (p->infd), TIOCGETC, &c);
+	  write (p->outfd, &c.t_quitc, 1);
+	  return;
+#ifdef SIGTSTP
+	case SIGTSTP:
+	  ioctl (XINT (p->infd), TIOCGLTC, &lc);
+	  write (p->outfd, &lc.t_suspc, 1);
+	  return;
+#endif /* ! defined (SIGTSTP) */
+	}
+
+#else /* ! defined (TIOCGLTC) && defined (TIOCGETC) */
+
+      /* On SYSV descendants, the TCGETA ioctl retrieves the current control
+	 characters.  */
+#ifdef TCGETA
+      struct termio t;
+      switch (signo)
+	{
+	case SIGINT:
+	  ioctl (XINT (p->infd), TCGETA, &t);
+	  write (p->outfd, &t.c_cc[VINTR], 1);
+	  return;
+	case SIGQUIT:
+	  ioctl (XINT (p->infd), TCGETA, &t);
+	  write (p->outfd, &t.c_cc[VQUIT], 1);
+	  return;
+#ifdef SIGTSTP
+	case SIGTSTP:
+	  ioctl (XINT (p->infd), TCGETA, &t);
+	  write (p->outfd, &t.c_cc[VSWTCH], 1);
+	  return;
+#endif /* ! defined (SIGTSTP) */
+	}
+#else /* ! defined (TCGETA) */
+      Your configuration files are messed up.
+      /* If your system configuration files define SIGNALS_VIA_CHARACTERS,
+	 you'd better be using one of the alternatives above!  */
+#endif /* ! defined (TCGETA) */
+#endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */
+#endif /* ! defined HAVE_TERMIOS */
+#endif /* ! defined (SIGNALS_VIA_CHARACTERS) */
+
+#ifdef TIOCGPGRP
+      /* Get the pgrp using the tty itself, if we have that.
+	 Otherwise, use the pty to get the pgrp.
+	 On pfa systems, saka@pfu.fujitsu.co.JP writes:
+	 "TIOCGPGRP symbol defined in sys/ioctl.h at E50.
+	 But, TIOCGPGRP does not work on E50 ;-P works fine on E60"
+	 His patch indicates that if TIOCGPGRP returns an error, then
+	 we should just assume that p->pid is also the process group id.  */
+      {
+	int err;
+
+	if (!NILP (p->subtty))
+	  err = ioctl (XFASTINT (p->subtty), TIOCGPGRP, &gid);
+	else
+	  err = ioctl (XINT (p->infd), TIOCGPGRP, &gid);
+
+	if (err == -1)
+	  gid = - XFASTINT (p->pid);
+      }
+      if (gid == -1)
+	no_pgrp = 1;
+      else
+	gid = - gid;
+#else  /* ! defined (TIOCGPGRP ) */
+      /* Can't select pgrps on this system, so we know that
+	 the child itself heads the pgrp.  */
+      gid = - XFASTINT (p->pid);
+#endif /* ! defined (TIOCGPGRP ) */
+
+      /* If current_group is lambda, and the shell owns the terminal,
+	 don't send any signal.  */
+      /* if (EQ (current_group, Qlambda) && gid == - XFASTINT (p->pid))
+	 return;*/
+    }
+  else
+    gid = - XFASTINT (p->pid);
+
+  switch (signo)
+    {
+#ifdef SIGCONT
+    case SIGCONT:
+      /* ??? This signal is not handled properly currently */
+      break;
+#endif /* ! defined (SIGCONT) */
+    case SIGINT:
+#ifdef VMS
+      write (proc->outfd, "\003", 1);   /* ^C */
+      goto whoosh;
+#endif
+    case SIGQUIT:
+#ifdef VMS
+      send_process (proc, "\031", 1, Qnil);	/* ^Y */
+      goto whoosh;
+#endif
+    case SIGKILL:
+#ifdef VMS
+      sys$forcex (&(XFASTINT (p->pid)), 0, 1);
+      whoosh:
+#endif
+      flush_pending_output (XINT (p->infd));
+      break;
+    }
+
+  /* If we don't have process groups, send the signal to the immediate
+     subprocess.  That isn't really right, but it's better than any
+     obvious alternative.  */
+  if (no_pgrp)
+    {
+      kill (XFASTINT (p->pid), signo);
+      return;
+    }
+
+  /* gid may be a pid, or minus a pgrp's number */
+#ifdef TIOCSIGSEND
+  if (!NILP (current_group)) {
+    ioctl (XINT (p->infd), TIOCSIGSEND, signo);
+  }
+  else
+    {
+      gid = - XFASTINT (p->pid);
+      kill (gid, signo);
+    }
+#else /* ! defined (TIOCSIGSEND) */
+  GVD_KILLPG (-gid, signo);
+#endif /* ! defined (TIOCSIGSEND) */
+}
+
+int
+gvd_interrupt_process (struct GVD_Process* p)
+{
+  process_send_signal (p, SIGINT, 1);
+}
+
+int
+gvd_interrupt_pid (int pid)
+{
+  kill (-pid, SIGINT);
+}
+
+/* kill a process. */
+
+int
+gvd_terminate_process (struct GVD_Process* p)
+{
+  return kill (p->pid, SIGKILL);
+}
+
+/* wait for process pid to terminate and return the process status. */
+
+int
+gvd_waitpid (struct GVD_Process* p)
+{
+  int status = 0;
+
+  waitpid (p->pid, &status, 0);
+  return WEXITSTATUS (status);
+}
+
+#else /* !WIN32 */
+
+typedef struct _child_process
+{
+  HWND                  hwnd;
+  PROCESS_INFORMATION   *procinfo;
+} child_process;
+
+/* The major and minor versions of NT.  */
+static int w32_major_version;
+static int w32_minor_version;
+
+/* Distinguish between Windows NT and Windows 95.  */
+static enum {OS_UNKNOWN, OS_WIN95, OS_NT} os_subtype = OS_UNKNOWN;
+
+/* Cache information describing the NT system for later use.  */
+static void
+cache_system_info (void)
+{
+  union
+    {
+      struct info
+        {
+          char  major;
+          char  minor;
+          short platform;
+        } info;
+      DWORD data;
+    } version;
+
+  /* Cache the version of the operating system.  */
+  version.data = GetVersion ();
+  w32_major_version = version.info.major;
+  w32_minor_version = version.info.minor;
+
+  if (version.info.platform & 0x8000)
+    os_subtype = OS_WIN95;
+  else
+    os_subtype = OS_NT;
+}
+
+static BOOL CALLBACK
+find_child_console (HWND hwnd, child_process * cp)
+{
+  DWORD thread_id;
+  DWORD process_id;
+
+  thread_id = GetWindowThreadProcessId (hwnd, &process_id);
+  if (process_id == cp->procinfo->dwProcessId)
+    {
+      char window_class[32];
+
+      GetClassName (hwnd, window_class, sizeof (window_class));
+      if (strcmp (window_class,
+                  (os_subtype == OS_WIN95)
+                  ? "tty"
+                  : "ConsoleWindowClass") == 0)
+        {
+          cp->hwnd = hwnd;
+          return FALSE;
+        }
+    }
+  /* keep looking */
+  return TRUE;
+}
+
+int
+gvd_interrupt_process (struct GVD_Process* p)
+{
+  volatile child_process cp;
+  int rc = 0;
+
+  cp.procinfo = &p->procinfo;
+
+  if (os_subtype == OS_UNKNOWN)
+    cache_system_info ();
+
+  /* Try to locate console window for process. */
+  EnumWindows ((ENUMWINDOWSPROC) find_child_console, (LPARAM) &cp);
+
+  if (NILP (Vw32_start_process_share_console) && cp.hwnd)
+    {
+      BYTE control_scan_code = (BYTE) MapVirtualKey (VK_CONTROL, 0);
+      /* Retrieve Ctrl-C scancode */
+      BYTE vk_break_code = 'C';
+      BYTE break_scan_code = (BYTE) MapVirtualKey (vk_break_code, 0);
+      HWND foreground_window;
+
+      foreground_window = GetForegroundWindow ();
+      if (foreground_window)
+        {
+          /* NT 5.0, and apparently also Windows 98, will not allow
+             a Window to be set to foreground directly without the
+             user's involvement. The workaround is to attach
+             ourselves to the thread that owns the foreground
+             window, since that is the only thread that can set the
+             foreground window.  */
+          DWORD foreground_thread, child_thread;
+
+          foreground_thread =
+            GetWindowThreadProcessId (foreground_window, NULL);
+          if (foreground_thread == GetCurrentThreadId ()
+              || !AttachThreadInput (GetCurrentThreadId (),
+                                     foreground_thread, TRUE))
+            foreground_thread = 0;
+
+          child_thread = GetWindowThreadProcessId (cp.hwnd, NULL);
+          if (child_thread == GetCurrentThreadId ()
+              || !AttachThreadInput (GetCurrentThreadId (),
+                                     child_thread, TRUE))
+            child_thread = 0;
+
+          /* Set the foreground window to the child.  */
+          if (SetForegroundWindow (cp.hwnd))
+            {
+              /* Generate keystrokes as if user had typed Ctrl-Break or
+                 Ctrl-C.  */
+              keybd_event (VK_CONTROL, control_scan_code, 0, 0);
+              keybd_event (vk_break_code, break_scan_code,
+                (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY), 0);
+              keybd_event (vk_break_code, break_scan_code,
+                (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY)
+                 | KEYEVENTF_KEYUP, 0);
+              keybd_event (VK_CONTROL, control_scan_code, KEYEVENTF_KEYUP, 0);
+
+              /* Sleep for a bit to give time for the main frame to respond
+              to focus change events.  */
+              Sleep (100);
+
+              SetForegroundWindow (foreground_window);
+            }
+          /* Detach from the foreground and child threads now that
+             the foreground switching is over.  */
+          if (foreground_thread)
+	    AttachThreadInput (GetCurrentThreadId (), foreground_thread, FALSE);
+	  if (child_thread)
+            AttachThreadInput (GetCurrentThreadId (), child_thread, FALSE);
+        }
+    }
+  /* Ctrl-Break is NT equivalent of SIGINT.  */
+  else if (!GenerateConsoleCtrlEvent
+             (CTRL_BREAK_EVENT, cp.procinfo->dwProcessId))
+    {
+      errno = EINVAL;
+      rc = -1;
+    }
+
+  return rc;
+}
+
+int
+gvd_interrupt_pid (int pid)
+{
+  struct GVD_Process process;
+
+  process.procinfo.dwProcessId = pid;
+  gvd_interrupt_process (&process);
+}
+
+/* kill a process, as this implementation use CreateProcess on Win32 we need
+   to use Win32 TerminateProcess API */
+int
+gvd_terminate_process (struct GVD_Process* p)
+{
+  if (TerminateProcess (p->procinfo.hProcess, 1) == FALSE)
+    return -1;
+  else
+    return 0;
+}
+
+/* wait for process pid to terminate and return the process status. This
+   implementation is different from the a-adaint.c one for Windows as it uses
+   the Win32 API instead of the C one. */
+
+int
+gvd_waitpid (struct GVD_Process* p)
+{
+  int status = 0;
+
+  DWORD exitcode;
+  DWORD res;
+  HANDLE proc_hand = p->procinfo.hProcess;
+
+  res = WaitForSingleObject (proc_hand, 0);
+  GetExitCodeProcess (proc_hand, &exitcode);
+
+  return (int) exitcode;
+}
+#endif /* !WIN32 */
+
+/* TTY handling */
+
+typedef struct {
+  int tty_fd;        /* descriptor for the tty */
+  char tty_name[24]; /* Name of TTY device */
+} TTY_Handle;
+
+int
+gvd_tty_supported ()
+{
+#ifdef HAVE_PTYS
+  return 1;
+#else
+  return 0;
+#endif
+}
+
+/* Return the tty name associated with p */
+
+char *
+gvd_tty_name (TTY_Handle* t)
+{
+  return t->tty_name;
+}
+
+int
+gvd_tty_fd (TTY_Handle* t)
+{
+  return t->tty_fd;
+}
+
+TTY_Handle*
+gvd_new_tty ()
+{
+#ifdef HAVE_PTYS
+  TTY_Handle *handle = (TTY_Handle*) malloc (sizeof (TTY_Handle));
+
+  handle->tty_fd = allocate_pty ();
+  strcpy (handle->tty_name, pty_name);
+  child_setup_tty (handle->tty_fd);
+
+  return handle;
+
+#else
+  return (TTY_Handle*)0;
+#endif
+}
+
+void
+gvd_reset_tty (TTY_Handle* t)
+{
+#ifdef HAVE_PTYS
+  child_setup_tty (t->tty_fd);
+#endif
+}
+
+void
+gvd_close_tty (TTY_Handle* t)
+{
+  gvd_close (t->tty_fd);
+  free (t);
+}
============================================================
--- support/libtty/src/syssignal.h	bf4607234d6332280e5ec1c255020b2905bde552
+++ support/libtty/src/syssignal.h	bf4607234d6332280e5ec1c255020b2905bde552
@@ -0,0 +1,204 @@
+/* syssignal.h - System-dependent definitions for signals.
+   Copyright (C) 1993, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifdef POSIX_SIGNALS
+
+/* Don't #include <signal.h>.  That header should always be #included
+   before "config.h", because some configuration files (like s/hpux.h)
+   indicate that SIGIO doesn't work by #undef-ing SIGIO.  If this file
+   #includes <signal.h>, then that will re-#define SIGIO and confuse
+   things.  */
+
+#define SIGMASKTYPE sigset_t
+
+#define SIGEMPTYMASK (empty_mask)
+#define SIGFULLMASK (full_mask)
+extern sigset_t empty_mask, full_mask;
+extern void init_signals P_ ((void));
+
+/* POSIX pretty much destroys any possibility of writing sigmask as a
+   macro in standard C.  We always define our own version because the
+   predefined macro in Glibc 2.1 is only provided for compatility for old
+   programs that use int as signal mask type.  */
+#undef sigmask
+#ifdef __GNUC__
+#define sigmask(SIG) 				\
+  ({						\
+    sigset_t _mask;				\
+    sigemptyset (&_mask);			\
+    sigaddset (&_mask, SIG);			\
+    _mask;					\
+  })
+#else /* ! defined (__GNUC__) */
+extern sigset_t sys_sigmask ();
+#define sigmask(SIG) (sys_sigmask (SIG))
+#endif /* ! defined (__GNUC__) */
+
+#undef sigpause
+#define sigpause(MASK)    sigsuspend (&(MASK))
+
+#define sigblock(SIG)    sys_sigblock (SIG)
+#define sigunblock(SIG)  sys_sigunblock (SIG)
+#ifndef sigsetmask
+#define sigsetmask(SIG)  sys_sigsetmask (SIG)
+#endif
+#define sighold(SIG)     ONLY_USED_IN_BSD_4_1
+#define sigrelse(SIG)    ONLY_USED_IN_BSD_4_1
+#undef signal
+#define signal(SIG,ACT)      sys_signal(SIG,ACT)
+
+/* Whether this is what all systems want or not, this is what
+   appears to be assumed in the source, for example data.c:arith_error.  */
+typedef RETSIGTYPE (*signal_handler_t) (/*int*/);
+
+signal_handler_t sys_signal P_ ((int signal_number, signal_handler_t action));
+sigset_t sys_sigblock   P_ ((sigset_t new_mask));
+sigset_t sys_sigunblock P_ ((sigset_t new_mask));
+sigset_t sys_sigsetmask P_ ((sigset_t new_mask));
+
+#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)
+
+#else /* ! defined (POSIX_SIGNALS) */
+#ifdef USG5_4
+
+#ifndef sigblock
+#define sigblock(sig) (sigprocmask (SIG_BLOCK, SIGEMPTYMASK | sig, NULL))
+#endif
+
+#define sigunblock(sig) (sigprocmask (SIG_SETMASK, SIGFULLMASK & ~(sig), NULL))
+
+#else
+#ifdef USG
+
+#define sigunblock(sig)
+
+#else
+
+#define sigunblock(SIG) \
+{ SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); }
+
+#endif /* ! defined (USG) */
+#endif /* ! defined (USG5_4) */
+#endif /* ! defined (POSIX_SIGNALS) */
+
+#ifndef SIGMASKTYPE
+#define SIGMASKTYPE int
+#endif
+
+#ifndef SIGEMPTYMASK
+#define SIGEMPTYMASK (0)
+#endif
+
+#ifndef SIGFULLMASK
+#define SIGFULLMASK (0xffffffff)
+#endif
+
+#ifndef sigmask
+#define sigmask(no) (1L << ((no) - 1))
+#endif
+
+#ifndef sigunblock
+#define sigunblock(SIG) \
+{ SIGMASKTYPE omask = sigblock (SIGFULLMASK); sigsetmask (omask & ~SIG); }
+#endif
+
+#ifndef BSD4_1
+#define sigfree() sigsetmask (SIGEMPTYMASK)
+#endif /* not BSD4_1 */
+
+#if defined (SIGINFO) && defined (BROKEN_SIGINFO)
+#undef SIGINFO
+#endif
+#if defined (SIGIO) && defined (BROKEN_SIGIO)
+#undef SIGIO
+#endif
+#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL)
+#undef SIGPOLL
+#endif
+#if defined (SIGTSTP) && defined (BROKEN_SIGTSTP)
+#undef SIGTSTP
+#endif
+#if defined (SIGURG) && defined (BROKEN_SIGURG)
+#undef SIGURG
+#endif
+
+#if NSIG < NSIG_MINIMUM
+# ifdef NSIG
+#  undef NSIG
+# endif
+# define NSIG NSIG_MINIMUM
+#endif
+
+#ifdef BSD4_1
+#define SIGIO SIGTINT
+/* sigfree is in sysdep.c */
+#endif /* BSD4_1 */
+
+/* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
+   Must do that using the killpg call.  */
+#ifdef BSD_SYSTEM
+#define GVD_KILLPG(gid, signo) (killpg ( (gid), (signo)))
+#else
+#ifdef WINDOWSNT
+#define GVD_KILLPG(gid, signo) (kill (gid, signo))
+#else
+#define GVD_KILLPG(gid, signo) (kill   (-(gid), (signo)))
+#endif
+#endif
+
+/* Define SIGCHLD as an alias for SIGCLD.  There are many conditionals
+   testing SIGCHLD.  */
+#ifndef VMS
+#ifdef SIGCLD
+#ifndef SIGCHLD
+#define SIGCHLD SIGCLD
+#endif /* SIGCHLD */
+#endif /* ! defined (SIGCLD) */
+#endif /* VMS */
+
+#ifndef HAVE_STRSIGNAL
+/* strsignal is in sysdep.c */
+char *strsignal ();
+
+#if defined (HAVE_SIGPROCMASK)
+
+#define BLOCK_SIGNAL(sig) do			\
+{                                               \
+  sigset_t ES_mask;                             \
+  sigemptyset (&ES_mask);                       \
+  sigaddset (&ES_mask, sig);                    \
+  sigprocmask (SIG_BLOCK, &ES_mask, NULL);      \
+} while (0)
+#define UNBLOCK_SIGNAL(sig) do			\
+{                                               \
+  sigset_t ES_mask;                             \
+  sigemptyset (&ES_mask);                       \
+  sigaddset (&ES_mask, sig);                    \
+  sigprocmask (SIG_UNBLOCK, &ES_mask, NULL);    \
+} while (0)
+
+#else /* HAVE_SIGPROCMASK */
+
+#define BLOCK_SIGNAL(sig) 0
+#define UNBLOCK_SIGNAL(sig) 0
+
+#endif /* HAVE_SIGPROCMASK */
+
+#endif
============================================================
--- support/libtty/src/system/aix3-1.h	c95eb063dfb71061e805aecbe459f5b77c7becf7
+++ support/libtty/src/system/aix3-1.h	c95eb063dfb71061e805aecbe459f5b77c7becf7
@@ -0,0 +1,215 @@
+/* Definitions file for GNU Emacs running on IBM AIX version 3.1
+   Copyright (C) 1985, 1986, 1990, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+#define USG				/* System III, System V, etc */
+#define USG5
+
+/*      Specify IBM AIX version of system */
+
+#ifndef AIX
+#define AIX
+#endif
+
+/*      turn off c prototypes */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+/*      This symbol should be defined on AIX Version 3  ??????? */
+#ifndef _AIX
+#define _AIX
+#endif
+
+/*      Specify "_BSD" to invoke Berkeley compatibility in header files */
+/*#ifndef _BSD
+#define _BSD
+#endif
+*/
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "aix"
+
+
+/* nomultiplejobs should be defined if your system's shell
+ does not have "job control" (the ability to stop a program,
+ run some other program, then continue the first one).  */
+
+/* #define NOMULTIPLEJOBS */
+
+/* Default is to set interrupt_input to 0: don't do input buffering within Emacs */
+
+/* #define INTERRUPT_INPUT */
+
+/* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
+   To get the name of the slave side, you just ttyname() the master side.  */
+
+#define PTY_ITERATION for (c = 0; !c ; c++)
+#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
+#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
+
+/*
+ *	Define HAVE_TERMIO if the system provides sysV-style ioctls
+ *	for terminal control.
+ */
+
+#define HAVE_TERMIOS
+
+/*
+ *	Define HAVE_PTYS if the system supports pty devices.
+ */
+
+#define HAVE_PTYS
+
+/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
+
+#define HAVE_SOCKETS
+
+/*
+ *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
+ *      The 4.2 opendir, etc., library functions.
+ */
+
+/* #define NONSYSTEM_DIR_LIBRARY */
+
+/*
+ * 	Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
+ *	library functions.  Almost, but not quite the same as
+ *	the 4.2 functions
+ */
+
+#define SYSV_SYSTEM_DIR
+
+/* Define this symbol if your system has the functions bcopy, etc. */
+
+#define BSTRING
+
+/* subprocesses should be defined if you want to
+ have code for asynchronous subprocesses
+ (as used in M-x compile and M-x shell).
+ This is supposed to work now on system V release 2.  */
+
+#define subprocesses
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+/* #define COFF */
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+/* #define MAIL_USE_FLOCK */
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+/* #define CLASH_DETECTION */
+
+/* Define SHORTNAMES if the C compiler can distinguish only
+   short names.  It means that the stuff in ../shortnames
+   must be run to convert the long names to short ones.  */
+
+/* #define SHORTNAMES */
+
+/* The file containing the kernel's symbol table is called /unix.  */
+
+#define KERNEL_FILE "/unix"
+
+/* The symbol in the kernel where the load average is found
+   is named avenrun.  */
+
+#define LDAV_SYMBOL "avenrun"
+
+/* Special itemss needed to make Emacs run on this system.  */
+
+/*
+ *	Make the sigsetmask function go away.  Don't know what the
+ *	ramifications of this are, but doesn't seem possible to
+ *	emulate it properly anyway at this point.
+ */
+
+#define sigsetmask(mask)	/* Null expansion */
+
+/* setjmp and longjmp can safely replace _setjmp and _longjmp,
+   but they will run slower.  */
+
+#define _setjmp setjmp
+#define _longjmp longjmp
+
+/* On USG systems these have different names */
+
+#define index strchr
+#define rindex strrchr
+
+/* USG systems tend to put everything declared static
+   into the initialized data area, which becomes pure after dumping Emacs.
+   Foil this.  Emacs carefully avoids static vars inside functions.  */
+
+#undef static
+
+/* Compiler bug bites on many systems when default ADDR_CORRECT is used.  */
+
+/* #define ADDR_CORRECT(x) (x) */
+
+#ifndef __GNUC__
+#define LINKER cc
+#endif
+
+/* Prevent -lg from being used for debugging.  Not needed.  */
+
+#define LIBS_DEBUG
+
+/* No need to specify -lc when linking.  */
+
+#define LIB_STANDARD
+
+/* Use terminfo instead of termcap.  */
+
+#define TERMINFO
+
+/* The following definition seems to be needed in AIX version 3.1.6.8.
+   It may not have been needed in certain earlier versions.  */
+#define HAVE_TCATTR
+
+#define SYSTEM_MALLOC
+
+/* Include unistd.h, even though we don't define POSIX.  */
+#define NEED_UNISTD_H
+
+/* AIX doesn't define this.  */
+#define unix 1
+
+/* AIX 3.1 has the HFT features.  */
+#define AIXHFT
+
+/* For unexaix.c. */
+#define ALIGN_DATA_RELOC
+
============================================================
--- support/libtty/src/system/aix3-2-5.h	0972b23b1aa584a6f954e25b60f79edea64ae015
+++ support/libtty/src/system/aix3-2-5.h	0972b23b1aa584a6f954e25b60f79edea64ae015
@@ -0,0 +1,30 @@
+/* s- file for building Emacs on AIX 3.2.5.  */
+
+#include "aix3-2.h"
+
+/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g"
+   because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because
+   "cc -g" crashes. Go figure.  --floppy@merlin.mit.edu */
+/* The above isn't generally true.  If it occurs with some compiler
+   release, seek a fixed version, be it XLC or GCC.  The XLC version
+   isn't tied to the OS version on AIX any more than elsewhere.  XLC
+   (the IBM compiler) can use -g with -O.  (-O3 is also a possibility
+   for the optimization level.)  -- fx, after David Edelsohn.  */
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH -g -O
+
+/* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
+#define SIGNALS_VIA_CHARACTERS
+#define MAIL_USE_LOCKF
+#define CLASH_DETECTION
+
+/* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
+#define POSIX_SIGNALS
+#undef sigmask
+#undef sigsetmask
+#undef _setjmp
+#undef _longjmp
+
+/* Bill Woodward <wpwood@austin.ibm.com> says:
+   libIM *must* precede libXm, to avoid getting aixLoadIM error messages.  */
+#define LIB_MOTIF -lIM -lXm
============================================================
--- support/libtty/src/system/aix3-2.h	fbef27941d4dac8703a4240ce25bdcf81cbbaae8
+++ support/libtty/src/system/aix3-2.h	fbef27941d4dac8703a4240ce25bdcf81cbbaae8
@@ -0,0 +1,54 @@
+/* s- file for building Emacs on AIX 3.2.  */
+
+#include "aix3-1.h"
+
+#define AIX3_2
+
+/* No need to define this--the header files indicate X11R4,
+   and that's supposedly what 3.2 will come with.  */
+#undef SPECIFY_X11R4
+
+#ifndef __GNUC__
+/* Some programs in src produce warnings saying certain subprograms
+   are to comples and need a MAXMEM value greater than 2000 for
+   additional optimization.  --nils@exp-math.uni-essen.de */
+#define C_SWITCH_SYSTEM -ma -qmaxmem=4000
+#endif
+
+#define HAVE_ALLOCA
+/* Adrian Colley <Adrian.Colley@three.serpentine.com> says this is needed.  */
+#ifndef NOT_C_CODE
+#ifndef AIX4
+ #pragma alloca
+#endif
+#endif
+
+#undef rindex
+#undef index
+
+#define HAVE_FSYNC
+
+/* With this defined, a gcc-compiled Emacs crashed in realloc under AIX
+   3.2, and a cc-compiled Emacs works with this undefined.
+   --karl@cs.umb.edu.  */
+#undef SYSTEM_MALLOC
+
+/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g"
+   because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because
+   "cc -g" crashes. Go figure.  --floppy@merlin.mit.edu */
+/* See comments about this in aix3-2-5.h.  -- fx */
+#ifndef __GNUC__
+#define C_DEBUG_SWITCH -g -O
+#endif
+
+/* The character-composition stuff is broken in X11R5.
+   Even with XIMStatusNothing aliased to XIMStatusNone,
+   tranle@intellicorp.com (Minh Tran-Le) reports that enabling
+   the internationalization code causes the modifier keys C, M and Shift
+   to beep after a mouse click.  */
+#define X11R5_INHIBIT_I18N
+
+/* string.h defines rindex as a macro, at least with native cc, so we
+   lose declaring char * rindex without this.
+   It is just a guess which versions of AIX need this definition.  */
+#undef HAVE_STRING_H
============================================================
--- support/libtty/src/system/aix4-1.h	fdc90e8304cd5c04b40f0bb9f25cc05a69030e2b
+++ support/libtty/src/system/aix4-1.h	fdc90e8304cd5c04b40f0bb9f25cc05a69030e2b
@@ -0,0 +1,42 @@
+#define AIX4_1
+
+#include "aix4.h"
+
+/* olson@mcs.anl.gov says -li18n is needed by -lXm.  */
+#undef LIB_MOTIF
+#define LIB_MOTIF -lXm -li18n
+
+#ifdef __GNUC__
+#undef _NO_PROTO
+#endif
+
+/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g"
+   because "cc -O" crashes.  Under AIX 3.2.5, "cc -O" is required because
+   "cc -g" crashes. Go figure.  --floppy@merlin.mit.edu.
+   4.1 seems to need -g again. -- larry@vaquita.mitra.com.  */
+/* David Edelsohn <dje@watson.ibm.com> says that this actually depends
+   on the version of XLC, which can't be predicted from the system version.
+   What a mess!  */
+/* No more of a mess than other systems, GNU+GCC included.  See
+   comments in aix3-2-5.h.  -- fx */
+#if 0
+#ifndef __GNUC__
+#undef C_DEBUG_SWITCH
+#undef C_OPTIMIZE_SWITCH
+#define C_DEBUG_SWITCH -g
+#endif
+#endif
+
+/* The X internationalization stuff is still broken in AIX 4.1, so
+   don't #undef X11R5_INHIBIT_I18N
+   It still causes shift, ctrl, and alt to resend the last character,
+   if it was a control character like tab, enter, backspace, or ESC.
+   Bill_Mann @ PraxisInt.com   */
+/* #undef X11R5_INHIBIT_I18N */
+
+#ifndef HAVE_LIBXMU
+#define LIBXMU
+
+/* Unfortunately without libXmu we cannot support EditRes.  */
+#define NO_EDITRES
+#endif
============================================================
--- support/libtty/src/system/aix4-2.h	0dd73a6f58ac99cd2f08b65b63330f94a3101641
+++ support/libtty/src/system/aix4-2.h	0dd73a6f58ac99cd2f08b65b63330f94a3101641
@@ -0,0 +1,9 @@
+/* AIX 4.2 is missing alloca.  */
+
+#include "aix4-1.h"
+
+#undef ALIGN_DATA_RELOC
+
+#ifndef __GNUC__
+#undef HAVE_ALLOCA
+#endif
============================================================
--- support/libtty/src/system/aix4.h	cd080569f500e831b44738ac107c1f98fc6b80b6
+++ support/libtty/src/system/aix4.h	cd080569f500e831b44738ac107c1f98fc6b80b6
@@ -0,0 +1,14 @@
+#define AIX4
+
+#include "aix3-2-5.h"
+
+/* AIX 4 does not have HFT any more.  */
+#undef AIXHFT
+
+/* Dave Love <d.love@dl.ac.uk> reported this as needed on AIX 4.1.
+   It is just a guess which versions of AIX need this definition.  */
+#define HAVE_WAIT_HEADER
+
+/* Specify the type that the 3rd arg of `accept' points to.
+   It is just a guess which versions of AIX need this definition.  */
+#define SOCKLEN_TYPE int
============================================================
--- support/libtty/src/system/bsd4-3.h	d76b5d3ce862898ade7b64aacee6bd2be6fcaff0
+++ support/libtty/src/system/bsd4-3.h	d76b5d3ce862898ade7b64aacee6bd2be6fcaff0
@@ -0,0 +1,120 @@
+/* Definitions file for GNU Emacs running on bsd 4.3
+   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+/* We give these symbols the numeric values found in <sys/param.h> to
+   avoid warnings about redefined macros.  */
+#ifndef BSD4_3
+#define BSD4_3 1
+#endif /* BSD4_3 */
+
+#ifndef BSD_SYSTEM
+#define BSD_SYSTEM 43
+#endif /* BSD_SYSTEM */
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "berkeley-unix"
+
+/* nomultiplejobs should be defined if your system's shell
+ does not have "job control" (the ability to stop a program,
+ run some other program, then continue the first one).  */
+
+/* #define NOMULTIPLEJOBS */
+
+/* Do not use interrupt_input = 1 by default, because in 4.3
+   we can make noninterrupt input work properly.  */
+
+#undef INTERRUPT_INPUT
+
+/* First pty name is /dev/ptyp0.  */
+
+#define FIRST_PTY_LETTER 'p'
+
+/*
+ *	Define HAVE_PTYS if the system supports pty devices.
+ */
+
+#define HAVE_PTYS
+
+/* Define this macro if system defines a type `union wait'.  */
+
+#define HAVE_UNION_WAIT
+
+/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
+
+#define HAVE_SOCKETS
+
+/*
+ *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
+ *      The 4.2 opendir, etc., library functions.
+ */
+
+/* #define NONSYSTEM_DIR_LIBRARY */
+
+/* Define this symbol if your system has the functions bcopy, etc. */
+
+#define BSTRING
+
+/* subprocesses should be defined if you want to
+   have code for asynchronous subprocesses
+   (as used in M-x compile and M-x shell).
+   This is generally OS dependent, and not supported
+   under most USG systems. */
+
+#define subprocesses
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+/* #define COFF */
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+#define MAIL_USE_FLOCK
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+#define CLASH_DETECTION
+
+/* The file containing the kernel's symbol table is called /vmunix.  */
+
+#define KERNEL_FILE "/vmunix"
+
+/* The symbol in the kernel where the load average is found
+   is named _avenrun.  */
+
+#define LDAV_SYMBOL "_avenrun"
+
+/* Send signals to subprocesses by "typing" special chars at them.  */
+
+#define SIGNALS_VIA_CHARACTERS
+
============================================================
--- support/libtty/src/system/darwin.h	d57eb40352e19e5e572e1119d0f115fb66c88573
+++ support/libtty/src/system/darwin.h	d57eb40352e19e5e572e1119d0f115fb66c88573
@@ -0,0 +1,355 @@
+/* System description header file for Darwin (Mac OS X).
+   Copyright (C) 2001, 02, 2004  Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+/* #define UNIPLUS */
+/* #define USG5 */
+/* #define USG */
+/* #define HPUX */
+/* #define UMAX */
+/* #define BSD4_1 */
+#define BSD4_2
+/* BSD4_3 and BSD4_4 are already defined in sys/param.h */
+/* #define BSD4_3 */
+/* #define BSD4_4 */
+#define BSD_SYSTEM
+/* #define VMS */
+
+#if 0 /* Don't define DARWIN on Mac OS X because CoreFoundation.h uses
+	 it to distinguish Mac OS X from bare Darwin.  */
+#ifndef	DARWIN
+#define	DARWIN 1
+#endif
+#endif
+
+/* MAC_OS is used to conditionally compile code common to both MAC_OS8
+   and MAC_OSX.  */
+#ifdef MAC_OSX
+#ifdef HAVE_CARBON
+#define MAC_OS
+#endif
+#endif
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "darwin"
+
+/* NOMULTIPLEJOBS should be defined if your system's shell
+ does not have "job control" (the ability to stop a program,
+ run some other program, then continue the first one).  */
+
+/* #define NOMULTIPLEJOBS */
+
+/* Emacs can read input using SIGIO and buffering characters itself,
+   or using CBREAK mode and making C-g cause SIGINT.
+   The choice is controlled by the variable interrupt_input.
+
+   Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
+
+   Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros
+   to indicate whether or not signal-driven I/O is possible.  It uses
+   INTERRUPT_INPUT to decide whether to use it by default.
+
+   SIGIO can be used only on systems that implement it (4.2 and 4.3).
+   CBREAK mode has two disadvantages
+     1) At least in 4.2, it is impossible to handle the Meta key properly.
+        I hear that in system V this problem does not exist.
+     2) Control-G causes output to be discarded.
+        I do not know whether this can be fixed in system V.
+
+   Another method of doing input is planned but not implemented.
+   It would have Emacs fork off a separate process
+   to read the input and send it to the true Emacs process
+   through a pipe. */
+
+#define INTERRUPT_INPUT
+
+/* Letter to use in finding device name of first pty,
+  if system supports pty's.  'a' means it is /dev/ptya0  */
+
+#define FIRST_PTY_LETTER 'p'
+
+/*
+ *	Define HAVE_TERMIOS if the system provides POSIX-style
+ *	functions and macros for terminal control.
+ *
+ *	Define HAVE_TERMIO if the system provides sysV-style ioctls
+ *	for terminal control.
+ *
+ *	Do not define both.  HAVE_TERMIOS is preferred, if it is
+ *	supported on your system.
+ */
+
+#define HAVE_TERMIOS
+/* #define HAVE_TERMIO */
+
+#define NO_TERMIO
+
+/*
+ *	Define HAVE_PTYS if the system supports pty devices.
+ *      Note: PTYs are broken on darwin <6.  Use at your own risk.
+ */
+
+#define HAVE_PTYS
+
+/**
+ * PTYs only work correctly on Darwin 7 or higher.  So make the
+ * default for process-connection-type dependent on the kernel
+ * version.
+ */
+#define MIN_PTY_KERNEL_VERSION '7'
+
+/*
+ *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
+ *      The 4.2 opendir, etc., library functions.
+ */
+
+/* #define NONSYSTEM_DIR_LIBRARY */
+
+/* Define this symbol if your system has the functions bcopy, etc. */
+
+#define BSTRING
+
+/* subprocesses should be defined if you want to
+   have code for asynchronous subprocesses
+   (as used in M-x compile and M-x shell).
+   This is generally OS dependent, and not supported
+   under most USG systems. */
+
+#define subprocesses
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+/* #define COFF */
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+#define MAIL_USE_FLOCK
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+#define CLASH_DETECTION
+
+/* Define this if your operating system declares signal handlers to
+   have a type other than the usual.  `The usual' is `void' for ANSI C
+   systems (i.e. when the __STDC__ macro is defined), and `int' for
+   pre-ANSI systems.  If you're using GCC on an older system, __STDC__
+   will be defined, but the system's include files will still say that
+   signal returns int or whatever; in situations like that, define
+   this to be what the system's include files want.  */
+/* #define SIGTYPE int */
+
+/* If the character used to separate elements of the executable path
+   is not ':', #define this to be the appropriate character constant.  */
+/* #define SEPCHAR ':' */
+
+/* Define this if the system can use mmap for buffer text allocation.  */
+/* #define USE_MMAP_FOR_BUFFERS 1 */
+
+/* ============================================================ */
+
+/* Here, add any special hacks needed
+   to make Emacs work on this system.  For example,
+   you might define certain system call names that don't
+   exist on your system, or that do different things on
+   your system and must be used only through an encapsulation
+   (Which you should place, by convention, in sysdep.c).  */
+
+/* Some compilers tend to put everything declared static
+   into the initialized data area, which becomes pure after dumping Emacs.
+   On these systems, you must #define static as nothing to foil this.
+   Note that emacs carefully avoids static vars inside functions.  */
+
+/* #define static */
+
+/* If the system's imake configuration file defines `NeedWidePrototypes'
+   as `NO', we must define NARROWPROTO manually.  Such a define is
+   generated in the Makefile generated by `xmkmf'.  If we don't
+   define NARROWPROTO, we will see the wrong function prototypes
+   for X functions taking float or double parameters.  */
+
+/*  #define NARROWPROTO 1 */
+
+/* ============================================================ */
+
+/* After adding support for a new system, modify the large case
+   statement in the `configure' script to recognize reasonable
+   configuration names, and add a description of the system to
+   `etc/MACHINES'.
+
+   If you've just fixed a problem in an existing configuration file,
+   you should also check `etc/MACHINES' to make sure its descriptions
+   of known problems in that configuration should be updated.  */
+
+
+/* Avoid the use of the name init_process (process.c) because it is
+   also the name of a Mach system call.  */
+#define init_process emacs_init_process
+
+/* Fix compilation problem for regex.c.  */
+#define __restrict
+
+/* Used in dispnew.c.  Copied from freebsd.h. */
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
+/* System uses OXTABS instead of the expected TAB3.  (Copied from
+   bsd386.h.)  */
+#define TAB3 OXTABS
+
+/* Darwin ld insists on the use of malloc routines in the System
+   framework.  */
+#define SYSTEM_MALLOC
+
+/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
+#define HAVE_SOCKETS
+
+/* In Carbon, asynchronous I/O (using SIGIO) can't be used for window
+   events because they don't come from sockets, even though it works
+   fine on tty's.  */
+#ifdef HAVE_CARBON
+#define NO_SOCK_SIGIO
+#endif
+
+/* Extra initialization calls in main for Mac OS X system type.  */
+#ifdef HAVE_CARBON
+#define SYMS_SYSTEM syms_of_mac()
+#endif
+
+/* Definitions for how to dump.  Copied from nextstep.h.  */
+
+#define UNEXEC unexmacosx.o
+
+#define START_FILES pre-crt0.o
+
+/* start_of_text isn't actually used, so make it compile without error.  */
+#define TEXT_START (0)
+
+/* This seems to be right for end_of_text, but it may not be used anyway.  */
+#define TEXT_END get_etext()
+
+/* This seems to be right for end_of_data, but it may not be used anyway.  */
+#define DATA_END get_edata()
+
+/* Definitions for how to compile & link.  */
+
+/* Indicate that we are compiling for Mac OS X and where to find Mac
+   specific headers.  */
+#define C_SWITCH_SYSTEM -fpascal-strings -fno-common -DMAC_OSX -I../mac/src
+
+/* Link in the Carbon lib. */
+#ifdef HAVE_CARBON
+#define LIBS_CARBON -framework Carbon -framework QuickTime
+#else
+#define LIBS_CARBON -framework Carbon
+#endif
+
+/* The -headerpad option tells ld (see man page) to leave room at the
+   end of the header for adding load commands.  Needed for dumping.
+   0x690 is the total size of 30 segment load commands (at 56
+   each).  */
+#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON -Xlinker -headerpad -Xlinker 690
+
+#define C_SWITCH_SYSTEM_TEMACS -Dtemacs
+
+/* The ncurses library has been moved out of the System framework in
+   Mac OS X 10.2.  So if ./configure detects it, set the command-line
+   option to use it.  */
+#ifdef HAVE_LIBNCURSES
+#define LIBS_TERMCAP -lncurses
+/* This prevents crashes when running Emacs in Terminal.app under
+   10.2.  */
+#define TERMINFO
+#endif
+
+/* Link this program just by running cc.  */
+#define ORDINARY_LINK
+
+/* We don't have a g library, so override the -lg LIBS_DEBUG switch.  */
+#define LIBS_DEBUG
+
+/* Adding -lm confuses the dynamic linker, so omit it.  */
+#define LIB_MATH
+
+/* Tell src/Makefile.in to create files in the Mac OS X application
+   bundle mac/Emacs.app.  */
+#ifdef HAVE_CARBON
+#define OTHER_FILES macosx-app
+#endif
+
+
+/* Define the following so emacs symbols will not conflict with those
+   in the System framework.  Otherwise -prebind will not work.  */
+
+/* Do not define abort in emacs.c.  */
+#define NO_ABORT
+
+/* Do not define matherr in floatfns.c.  */
+#define NO_MATHERR
+
+
+/* This prevents a compilation error in xfaces.c: struct kboard * is
+   used in a function protocol the first time this type appears in the
+   file, since MULTI_KBOARD is undefined for the Mac OS X build.  */
+#ifndef NOT_C_CODE
+struct kboard;
+#endif
+
+/* The following solves the problem that Emacs hangs when evaluating
+   (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile
+   does not exist.  */
+#undef HAVE_WORKING_VFORK
+#define vfork fork
+#define DONT_REOPEN_PTY
+
+#ifdef temacs
+#define malloc unexec_malloc
+#define realloc unexec_realloc
+#define free unexec_free
+#endif
+
+/* This makes create_process in process.c save and restore signal
+   handlers correctly.  Suggested by Nozomu Ando.*/
+#define POSIX_SIGNALS
+
+/* Reroute calls to SELECT to the version defined in mac.c to fix the
+   problem of Emacs requiring an extra return to be typed to start
+   working when started from the command line.  */
+#if defined (HAVE_CARBON) && (defined (emacs) || defined (temacs))
+#define select sys_select
+#endif
+
+/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the
+   stack.  */
+#define GC_MARK_STACK   GC_MAKE_GCPROS_NOOPS
+
+/* arch-tag: 481d443d-4f89-43ea-b5fb-49706d95fa41
+   (do not change this comment) */
============================================================
--- support/libtty/src/system/freebsd.h	fe0176ca8185f9984f70afe465cc57309b30ea5e
+++ support/libtty/src/system/freebsd.h	fe0176ca8185f9984f70afe465cc57309b30ea5e
@@ -0,0 +1,169 @@
+/* s/ file for freebsd system.  */
+
+/* Get the correct __FreeBSD_version, even if this is before that was
+   defined. */
+#ifndef __FreeBSD__
+#define __FreeBSD_version 199401
+#elif __FreeBSD__ == 1
+#define __FreeBSD_version 199405
+#else
+#include <osreldate.h>
+#endif
+
+/* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
+   Earlier versions do not have shared libraries, so inhibit them.
+   You can inhibit them on newer systems if you wish
+   by defining NO_SHARED_LIBS.  */
+#ifndef __FreeBSD__
+#define NO_SHARED_LIBS
+#endif
+
+
+#if 0 /* This much, alone, seemed sufficient as of 19.23.
+	 But it seems better to be independent of netbsd.h.  */
+#include "netbsd.h"
+
+#undef LIB_GCC
+#define LIB_GCC -lgcc
+#undef NEED_ERRNO
+#endif /* 0 */
+
+
+/* Get most of the stuff from bsd4.3 */
+#include "bsd4-3.h"
+
+/* For mem-limits.h. */
+#define BSD4_2
+
+/* These aren't needed, since we have getloadavg.  */
+#undef KERNEL_FILE
+#undef LDAV_SYMBOL
+
+#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
+/* Use XPG4 Library for FreeBSD */
+#define LIBS_XPG
+#if (__FreeBSD_version >= 220000 && __FreeBSD_version < 400020) \
+    || (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
+#ifdef USE_XPG
+#undef LIBS_XPG
+#define LIBS_XPG -lxpg4
+#endif
+#endif
+
+#define LIBS_DEBUG
+#define LIBS_SYSTEM -lutil LIBS_XPG
+#if __FreeBSD_version < 400000
+#define LIBS_TERMCAP -ltermcap
+#endif
+
+#define SYSV_SYSTEM_DIR
+
+/* freebsd has POSIX-style pgrp behavior. */
+#undef BSD_PGRPS
+#define GETPGRP_NO_ARG
+
+#ifdef __ELF__
+
+#define LD_SWITCH_SYSTEM
+
+#ifdef __alpha__
+#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crtbegin.o
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
+#else
+#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+#endif
+
+#define UNEXEC unexelf.o
+#undef LIB_GCC
+#define LIB_GCC
+
+#else /* not __ELF__ */
+
+#ifndef NO_SHARED_LIBS
+#define LD_SWITCH_SYSTEM -e start -dc
+#define HAVE_TEXT_START		/* No need to define `start_of_text'. */
+#if __FreeBSD_version >= 300002
+#define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
+#else /* __FreeBSD_version < 300002 */
+#define START_FILES pre-crt0.o /usr/lib/crt0.o
+#endif /* __FreeBSD_version < 300002 */
+#define UNEXEC unexsunos4.o
+#define RUN_TIME_REMAP
+#define LIB_GCC -lgcc
+
+#ifndef N_TRELOFF
+#define N_PAGSIZ(x) __LDPGSZ
+#define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
+#define N_TRELOFF(x) N_RELOFF(x)
+#endif
+#else /* NO_SHARED_LIBS */
+#ifdef __FreeBSD__  /* shared libs are available, but the user prefers
+                     not to use them.  */
+#define LD_SWITCH_SYSTEM -Bstatic
+#define A_TEXT_OFFSET(x) (sizeof (struct exec))
+#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
+#endif /* __FreeBSD__ */
+#endif /* NO_SHARED_LIBS */
+
+#endif /* not __ELF__ */
+
+#define HAVE_WAIT_HEADER
+#define HAVE_GETLOADAVG
+/*#define HAVE_GETPAGESIZE  /* configure now puts this in config.h */
+#define HAVE_TERMIOS
+#define NO_TERMIO
+#define DECLARE_GETPWUID_WITH_UID_T
+
+/* freebsd uses OXTABS instead of the expected TAB3. */
+#define TABDLY OXTABS
+#define TAB3 OXTABS
+
+/* this silences a few compilation warnings */
+#undef BSD_SYSTEM
+#if __FreeBSD__ == 1
+#define BSD_SYSTEM 199103
+#elif __FreeBSD__ == 2
+#define BSD_SYSTEM 199306
+#elif __FreeBSD__ >= 3
+#define BSD_SYSTEM 199506
+#endif
+
+#define WAITTYPE int
+/* get this since it won't be included if WAITTYPE is defined */
+#ifdef emacs
+#include <sys/wait.h>
+#endif
+#define WRETCODE(w) (_W_INT(w) >> 8)
+
+/* Needed to avoid hanging when child process writes an error message
+   and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>.  */
+#define vfork fork
+
+/* Don't close pty in process.c to make it as controlling terminal.
+   It is already a controlling terminal of subprocess, because we did
+   ioctl TIOCSCTTY.  */
+#define DONT_REOPEN_PTY
+
+/* CLASH_DETECTION is defined in bsd4-3.h.
+   In FreeBSD 2.1.5 (and other 2.1.x), this results useless symbolic links
+   remaining in /tmp or other directories with +t bit.
+   To avoid this problem, you could #undef it to use no file lock. */
+/* #undef CLASH_DETECTION */
+
+/* Circumvent a bug in FreeBSD.  In the following sequence of
+   writes/reads on a PTY, read(2) returns bogus data:
+
+   write(2)  1022 bytes
+   write(2)   954 bytes, get EAGAIN
+   read(2)   1024 bytes in process_read_output
+   read(2)     11 bytes in process_read_output
+
+   That is, read(2) returns more bytes than have ever been written
+   successfully.  The 1033 bytes read are the 1022 bytes written
+   successfully after processing (for example with CRs added if the
+   terminal is set up that way which it is here).  The same bytes will
+   be seen again in a later read(2), without the CRs.  */
+
+#define BROKEN_PTY_READ_AFTER_EAGAIN 1
============================================================
--- support/libtty/src/system/gnu-linux.h	1f0431b67387e28b856ae12db39a9dbe2a02559c
+++ support/libtty/src/system/gnu-linux.h	1f0431b67387e28b856ae12db39a9dbe2a02559c
@@ -0,0 +1,317 @@
+/* This file is the configuration file for Linux-based GNU systems
+   Copyright (C) 1985, 86, 92, 94, 96, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* This file was put together by Michael K. Johnson and Rik Faith.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+/* #define UNIPLUS */
+/* #define USG5 */
+#define USG
+/* #define BSD_SYSTEM */
+#define LINUX
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "gnu/linux"		/* All the best software is free. */
+
+/* Check the version number of Linux--if it is at least 1.2.0,
+   it is safe to use SIGIO.  */
+#ifndef NOT_C_CODE
+#ifdef emacs
+#ifdef HAVE_LINUX_VERSION_H
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE > 0x10200
+#define LINUX_SIGIO_DOES_WORK
+#endif /* LINUX_VERSION_CODE > 0x10200 */
+#if LINUX_VERSION_CODE >= 0x20000
+#define LINUX_MAP_SHARED_DOES_WORK
+#endif /* LINUX_VERSION_CODE >= 0x20000 */
+#endif /* HAVE_LINUX_VERSION_H */
+#endif /* emacs */
+#endif /* NOT_C_CODE */
+
+#if defined HAVE_GRANTPT
+#define UNIX98_PTYS
+
+/* Run only once.  We need a `for'-loop because the code uses
+   `continue'.  */
+
+#define PTY_ITERATION	for (i = 0; i < 1; i++)
+
+#ifdef HAVE_GETPT
+#define PTY_NAME_SPRINTF
+#define PTY_OPEN fd = getpt ()
+#else /* not HAVE_GETPT */
+#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
+#endif /* not HAVE_GETPT */
+
+/* Note that grantpt and unlockpt may fork.  We must block SIGCHLD to
+   prevent sigchld_handler from intercepting the child's death.  */
+
+#define PTY_TTY_NAME_SPRINTF				\
+  {							\
+    char *ptyname;					\
+							\
+    sigblock (sigmask (SIGCHLD));			\
+    if (grantpt (fd) == -1 || unlockpt (fd) == -1	\
+        || !(ptyname = (char *)ptsname(fd)))			\
+      {							\
+	sigunblock (sigmask (SIGCHLD));			\
+	close (fd);					\
+	return -1;					\
+      }							\
+    strncpy (pty_name, ptyname, sizeof (pty_name));	\
+    pty_name[sizeof (pty_name) - 1] = 0;		\
+    sigunblock (sigmask (SIGCHLD));			\
+  }
+
+#else /* not HAVE_GRANDPT */
+
+/* Letter to use in finding device name of first pty,
+   if system supports pty's.  'p' means it is /dev/ptyp0  */
+
+#define FIRST_PTY_LETTER 'p'
+
+#endif  /* not HAVE_GRANDPT */
+
+/*  Define HAVE_TERMIOS if the system provides POSIX-style
+    functions and macros for terminal control.  */
+
+#define HAVE_TERMIOS
+
+/* Define HAVE_PTYS if the system supports pty devices. */
+
+#define HAVE_PTYS
+
+/* Uncomment this later when other problems are dealt with -mkj */
+
+#define HAVE_SOCKETS
+
+/* Define this symbol if your system has the functions bcopy, etc. */
+
+#define BSTRING
+
+/* subprocesses should be defined if you want to
+   have code for asynchronous subprocesses
+   (as used in M-x compile and M-x shell).
+   This is generally OS dependent, and not supported
+   under most USG systems. */
+
+#define subprocesses
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+/* On GNU/Linux systems, both methods are used by various mail
+   programs.  I assume that most people are using newer mailers that
+   have heard of flock.  Change this if you need to. */
+
+#define MAIL_USE_FLOCK
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+#define CLASH_DETECTION
+
+/* Here, on a separate page, add any special hacks needed
+   to make Emacs work on this system.  For example,
+   you might define certain system call names that don't
+   exist on your system, or that do different things on
+   your system and must be used only through an encapsulation
+   (Which you should place, by convention, in sysdep.c).  */
+
+/* If you mount the proc file system somewhere other than /proc
+   you will have to uncomment the following and make the proper
+   changes */
+
+/* #define LINUX_LDAV_FILE "/proc/loadavg" */
+
+/* This is needed for dispnew.c:update_frame */
+
+#ifdef emacs
+#include <stdio.h>  /* Get the definition of _IO_STDIO_H.  */
+#if defined(_IO_STDIO_H) || defined(_STDIO_USES_IOSTREAM)
+/* new C libio names */
+#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
+  ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
+#else /* !_IO_STDIO_H */
+/* old C++ iostream names */
+#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
+  ((FILE)->_pptr - (FILE)->_pbase)
+#endif /* !_IO_STDIO_H */
+#endif /* emacs */
+
+/* Ask GCC where to find libgcc.a.  */
+#define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
+
+#ifndef __ELF__
+/* GNU/Linux usually has crt0.o in a non-standard place */
+#define START_FILES pre-crt0.o /usr/lib/crt0.o
+#else
+#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
+#endif
+
+#ifdef __ELF__
+/* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
+   says where to find X windows at run time.  */
+
+#ifdef __mips__
+#define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX
+#else
+#define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
+#endif /* __mips__ */
+#endif /* __ELF__ */
+
+/* As of version 1.1.51, Linux did not actually implement SIGIO.
+   But it works in newer versions.  */
+#ifdef emacs
+#ifdef LINUX_SIGIO_DOES_WORK
+#define INTERRUPT_INPUT
+#else
+#define BROKEN_SIGIO
+/* Some versions of Linux define SIGURG and SIGPOLL as aliases for SIGIO.
+   This prevents lossage in process.c.  */
+#define BROKEN_SIGURG
+#define BROKEN_SIGPOLL
+#endif
+#endif
+
+/* This is needed for sysdep.c */
+
+#define NO_SIOCTL_H           /* don't have sioctl.h */
+
+#define HAVE_GETWD            /* cure conflict with getcwd? */
+#define HAVE_WAIT_HEADER
+
+#define SYSV_SYSTEM_DIR       /* use dirent.h */
+
+#define POSIX                 /* affects getpagesize.h and systty.h */
+#define POSIX_SIGNALS
+
+/* Best not to include -lg, unless it is last on the command line */
+#define LIBS_DEBUG
+#ifndef __ELF__
+#define LIB_STANDARD -lc /* avoid -lPW */
+#else
+#undef LIB_GCC
+#define LIB_GCC
+#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
+#endif
+
+/* Don't use -g in test compiles in configure.
+   This is so we will use the same shared libs for that linking
+   that are used when linking temacs.  */
+#ifdef THIS_IS_CONFIGURE
+#define C_DEBUG_SWITCH
+#endif
+
+/* Let's try this out, just in case.
+   Nah.  Rik Faith <faith@cs.unc.edu> says it doesn't work well.  */
+/* #define SIGNALS_VIA_CHARACTERS */
+
+/* Rob Malouf <malouf@csli.stanford.edu> says:
+   SYSV IPC is standard a standard part of Linux since version 0.99pl10,
+   and is a very common addition to previous versions.  */
+
+#ifdef TERM
+#define LIBS_SYSTEM -lclient
+#define C_SWITCH_SYSTEM -D_BSD_SOURCE -I/usr/src/term
+#else
+/* alane@wozzle.linet.org says that -lipc is not a separate library,
+   since libc-4.4.1.  So -lipc was deleted.  */
+#define LIBS_SYSTEM
+#define C_SWITCH_SYSTEM -D_BSD_SOURCE -D_XOPEN_SOURCE
+#endif
+
+/* Paul Abrahams <abrahams@equinox.shaysnet.com> says this is needed.  */
+#define LIB_MOTIF -lXm -lXpm
+
+#ifdef HAVE_LIBNCURSES
+#define TERMINFO
+#define LIBS_TERMCAP -lncurses
+#endif
+
+#define HAVE_SYSVIPC
+
+#ifdef __ELF__
+#define UNEXEC unexelf.o
+#ifndef LINUX_MAP_SHARED_DOES_WORK
+#define UNEXEC_USE_MAP_PRIVATE
+#endif
+#endif
+
+#ifdef LINUX_QMAGIC
+
+#define HAVE_TEXT_START
+#define UNEXEC unexsunos4.o
+#define N_PAGSIZ(x) PAGE_SIZE
+
+#else /* not LINUX_QMAGIC */
+
+#define A_TEXT_OFFSET(hdr) (N_MAGIC(hdr) == QMAGIC ? sizeof (struct exec) : 0)
+#define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
+#define ADJUST_EXEC_HEADER \
+  unexec_text_start = N_TXTADDR(ohdr) + A_TEXT_OFFSET(ohdr)
+
+#endif /* not LINUX_QMAGIC */
+
+/* This is to work around mysterious gcc failures in some system versions.
+   It is unlikely that Emacs changes will work around this problem;
+   therefore, this should remain permanently.  */
+#ifndef HAVE_XRMSETDATABASE
+#define HAVE_XRMSETDATABASE
+#endif
+
+/* The regex.o routines are a part of the GNU C-library used with Linux.  */
+/* However, sometimes they disagree with the src/regex.h that comes with Emacs,
+   and that can make trouble in etags.c because it gets the regex.h from Emacs
+   and the function definitions in libc.  So turn this off.  */
+/* #define REGEXP_IN_LIBC */
+
+/* Use BSD process groups, but use setpgid() instead of setpgrp() to
+   actually set a process group. */
+
+#define BSD_PGRPS
+
+#define NARROWPROTO 1
+
+/* Use mmap directly for allocating larger buffers.  */
+#ifdef DOUG_LEA_MALLOC
+#undef REL_ALLOC
+#endif
+
+/* Tell that garbage collector that setjmp is known to save all
+   registers relevant for conservative garbage collection in the
+   jmp_buf.  */
+/* m68k and alpha aren't tested, but there are Debian packages for SCM
+   and/or Guile on them, so the technique must work.  */
+#if #cpu (i386) || #cpu (sparc) || #cpu (m68k) || #cpu (alpha)
+#define GC_SETJMP_WORKS 1
+#endif
============================================================
--- support/libtty/src/system/hpux.h	17da3f3f21c963acaacee86f78ccdfc28e784277
+++ support/libtty/src/system/hpux.h	17da3f3f21c963acaacee86f78ccdfc28e784277
@@ -0,0 +1,218 @@
+/* Definitions file for GNU Emacs running on HPUX release 7.0.
+   Based on AT&T System V.2.
+   Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+#define USG				/* System III, System V, etc */
+
+#define USG5
+
+#define HPUX
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "hpux"
+
+/* `nomultiplejobs' should be defined if your system's shell
+ does not have "job control" (the ability to stop a program,
+ run some other program, then continue the first one).
+
+ On hpux this depends on the precise kind of machine in use,
+ so the m- file defines this symbol if appropriate.  */
+
+/* Default is to set interrupt_input to 0: don't do input buffering within Emacs */
+
+/* #define INTERRUPT_INPUT */
+
+/* Letter to use in finding device name of first pty,
+  if system supports pty's.  'p' means it is /dev/ptym/ptyp0  */
+
+#define FIRST_PTY_LETTER 'p'
+
+/*
+ *	Define HAVE_TERMIO if the system provides sysV-style ioctls
+ *	for terminal control.
+ */
+
+#define HAVE_TERMIO
+
+/*
+ *	Define HAVE_PTYS if the system supports pty devices.
+ */
+
+#define HAVE_PTYS
+
+/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
+
+#define HAVE_SOCKETS
+
+/*
+ *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
+ *      The 4.2 opendir, etc., library functions.
+ */
+
+/* #define NONSYSTEM_DIR_LIBRARY */
+
+/* Define this symbol if your system has the functions bcopy, etc.
+ * s800 and later versions of s300 (s200) kernels have equivalents
+ * of the BSTRING functions of BSD.  If your s200 kernel doesn't have
+ * em comment out this section.
+ */
+
+#define BSTRING
+
+/* subprocesses should be defined if you want to
+ have code for asynchronous subprocesses
+ (as used in M-x compile and M-x shell).
+ This is generally OS dependent, and not supported
+ under most USG systems.  */
+
+#define subprocesses
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+/* #define COFF */
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+/* #define MAIL_USE_FLOCK */
+
+/* Say we have the SYSV style of interprocess communication.  */
+
+#define HAVE_SYSVIPC
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+#define CLASH_DETECTION
+
+/* Define SHORTNAMES if the C compiler can distinguish only
+   short names.  It means that the stuff in ../shortnames
+   must be run to convert the long names to short ones.
+
+   Some USG systems support long names.
+   If yours is one, DO NOT change this file!
+   Do #undef SHORTNAMES in the m- file or in config.h.  */
+
+/* #define SHORTNAMES */
+
+/* The file containing the kernel's symbol table is called /hp-ux.  */
+
+#define KERNEL_FILE "/hp-ux"
+
+/* The symbol in the kernel where the load average is found
+   depends on the cpu type, so we let the m- files define LDAV_SYMBOL.  */
+
+/* Special hacks needed to make Emacs run on this system.  */
+
+/*
+ *	Make the sigsetmask function go away.  Don't know what the
+ *	ramifications of this are, but doesn't seem possible to
+ *	emulate it properly anyway at this point.
+ */
+
+/* HPUX has sigsetmask */
+/* #define sigsetmask(mask)	/ * Null expansion * / */
+
+/* setjmp and longjmp can safely replace _setjmp and _longjmp,
+   but they will run slower.  */
+
+/* HP-UX has _setjmp and _longjmp */
+/*
+#define _setjmp setjmp
+#define _longjmp longjmp
+*/
+
+/* Use the system provided termcap(3) library */
+#define TERMINFO
+
+/* The 48-bit versions are more winning for Emacs;
+   the ordinary ones don't give even 32 bits.  */
+#define random lrand48
+#define srandom srand48
+
+/* In hpux, the symbol SIGIO is defined, but the feature
+   doesn't work in the way Emacs needs it to.  */
+
+#define BROKEN_SIGIO
+
+/* USG systems tend to put everything declared static
+   into the initialized data area, which becomes pure after dumping Emacs.
+   Foil this.  Emacs carefully avoids static vars inside functions.  */
+
+#define static
+
+/* Define extra libraries to load.
+   This should have -lBSD, but that library is said to make
+   `signal' fail to work.  */
+
+#ifdef HPUX_NET
+#define LIBS_SYSTEM -ln
+#else
+#define LIBS_SYSTEM
+#endif
+
+/* Some additional system facilities exist.  */
+
+#define HAVE_PERROR  /* Delete this line for version 6.  */
+
+/* The following maps shared exec file to demand loaded exec.
+   Don't do this as demand loaded exec is broken in hpux.  */
+
+#if 0
+
+/* Adjust a header field for the executable file about to be dumped.  */
+
+#define ADJUST_EXEC_HEADER   \
+  hdr.a_magic = ((ohdr.a_magic.file_type == OLDMAGIC.file_type) ?  \
+		 NEWMAGIC : ohdr.a_magic);
+
+#endif
+
+/* Baud-rate values in tty status have nonstandard meanings.  */
+
+#define BAUD_CONVERT  \
+{ 0, 50, 75, 110, 135, 150, 200, 300, 600, 900, 1200,  \
+  1800, 2400, 3600, 4800, 7200, 9600, 19200, 38400 }
+
+/* This is needed for HPUX version 6.2; it may not be needed for 6.2.1.  */
+#define SHORT_CAST_BUG
+
+/* This is how to get the device name of the tty end of a pty.  */
+#define PTY_TTY_NAME_SPRINTF \
+            sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
+
+/* This is how to get the device name of the control end of a pty.  */
+#define PTY_NAME_SPRINTF \
+	sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);
+
+/* This triggers a conditional in xfaces.c.  */
+#define XOS_NEEDS_TIME_H
============================================================
--- support/libtty/src/system/hpux10.h	ded3b03d0815b8a631588e2b2cbfa047a203be45
+++ support/libtty/src/system/hpux10.h	ded3b03d0815b8a631588e2b2cbfa047a203be45
@@ -0,0 +1,47 @@
+#include "hpux9shr.h"
+
+#define HPUX10
+
+/* We have to go this route, rather than hpux9's approach of renaming the
+   functions via macros.  The system's stdlib.h has fully prototyped
+   declarations, which yields a conflicting definition of srand48; it
+   tries to redeclare what was once srandom to be srand48.  So we go
+   with HAVE_LRAND48 being defined.  */
+#undef srandom
+#undef srand48
+#undef HAVE_RANDOM
+#define HPUX10
+#define FORCE_ALLOCA_H
+
+/* AlainF 20-Jul-1996 says this is right.  */
+#undef KERNEL_FILE
+#define KERNEL_FILE "/stand/vmunix"
+
+#ifdef LIBS_SYSTEM
+#undef LIBS_SYSTEM
+#endif
+#ifdef HPUX_NET
+#define LIBS_SYSTEM -ln -l:libdld.sl
+#else
+#define LIBS_SYSTEM -l:libdld.sl
+#endif
+
+/* Rainer Malzbender <rainer@displaytech.com> says definining
+   HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20
+   using GCC.  */
+
+#ifndef HAVE_XRMSETDATABASE
+#define HAVE_XRMSETDATABASE
+#endif
+
+/* Make sure we get select from libc rather than from libcurses
+   because libcurses on HPUX 10.10 has a broken version of select.
+   We used to use -lc -lcurses, but this may be cleaner.  */
+#define LIBS_TERMCAP -ltermcap
+
+#undef C_SWITCH_X_SYSTEM
+#undef LD_SWITCH_X_DEFAULT
+/* However, HPUX 10 puts Xaw and Xmu in a strange place
+   (if you install them at all).  So search that place.  */
+#define C_SWITCH_X_SYSTEM -I/usr/include/X11R5 -I/usr/include/Motif1.2 -I/usr/contrib/X11R5/include
+#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R5 -L/usr/lib/Motif1.2 -L/usr/contrib/X11R5/lib
============================================================
--- support/libtty/src/system/hpux8.h	3a3e0147ca555eaa84632a7d132343da7232f59a
+++ support/libtty/src/system/hpux8.h	3a3e0147ca555eaa84632a7d132343da7232f59a
@@ -0,0 +1,71 @@
+/* system description file for hpux version 8.
+   This contains changes that were suggested "for the hp700".
+   They were not needed for the 800.
+   Our conjecture that they are needed for hpux version 8,
+   which is what runs on the 700.  */
+
+#include "hpux.h"
+
+#define HPUX8
+
+/* dob@inel.gov says HPUX 8.07 needs this.  He was using X11R5, I think.  */
+#define LIBX11_SYSTEM -lXext
+
+#define LIB_X11_LIB -L/usr/lib/X11R5 -L/usr/lib/X11R4 -lX11
+#define C_SWITCH_X_SYSTEM -I/usr/include/X11R5 -I/usr/include/X11R4
+#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R5 -L/usr/lib/X11R4
+
+/* Don't use shared libraries.  unexec doesn't handle them.
+   Note GCC automatically passes -a archive to ld, and it has its own
+   conflicting -a.  */
+#ifdef __GNUC__
+/* No need to specify roundabout way of linking temacs.  */
+#define ORDINARY_LINK
+
+#ifdef HPUX_USE_SHLIBS
+#define LD_SWITCH_SYSTEM_TEMACS
+#else
+#define LD_SWITCH_SYSTEM_TEMACS -Xlinker -a -Xlinker archive
+#endif
+
+#else /* not __GNUC__ */
+/* Note, -a only works for hpux ld, not cc.  And "cc LD_SWITCH_SYSTEM"
+   is used in configure's $ac_link to do various autoconf checks.
+   Since we only need -a when unexec'ing, only pass in -a to
+   "ld temacs" (ghazi@caip.rutgers.edu  7/10/97).  */
+#if (defined(hp9000s700) || defined(__hp9000s700))
+#ifdef HPUX_USE_SHLIBS
+#define LD_SWITCH_SYSTEM_TEMACS -L/lib/pa1.1
+#else
+#define LD_SWITCH_SYSTEM_TEMACS -a archive -L/lib/pa1.1
+#endif
+#else /* not (defined(hp9000s700) || defined(__hp9000s700)) */
+#ifdef HPUX_USE_SHLIBS
+#define LD_SWITCH_SYSTEM_TEMACS
+#else
+#define LD_SWITCH_SYSTEM_TEMACS -a archive
+#endif
+#endif /* not (defined(hp9000s700) || defined(__hp9000s700)) */
+#endif /* not __GNUC__ */
+
+/* Some hpux 8 machines seem to have TIOCGWINSZ,
+   and none have sioctl.h, so might as well define this.  */
+#define NO_SIOCTL_H
+
+#if 0 /* autoconf should be detecting the presence or absence of
+	 random and srandom now.  */
+/* If you use X11R4 you must define this.  If you use
+   X11R5 you must comment this out */
+/* #define HAVE_RANDOM */
+#define random foo_random
+#define srandom foo_srandom
+#endif
+
+#if 0  /* This seems to be spurious.  */
+/* "X11R5" on hpux8 doesn't have this function, which is supposed to exist
+   in X11R5.  Maybe things will work if we just don't call it.  */
+#define NO_XRM_SET_DATABASE
+#endif
+
+/* Enable a special hack in XTread_socket.  */
+#define X_IO_BUG
============================================================
--- support/libtty/src/system/hpux9.h	b7426734a0be99254e971c8a7a9d8985dc7925bc
+++ support/libtty/src/system/hpux9.h	b7426734a0be99254e971c8a7a9d8985dc7925bc
@@ -0,0 +1,73 @@
+/* System description file for hpux version 9.  */
+
+#include "hpux8.h"
+
+#define HPUX9
+
+/* If Emacs doesn't seem to work when built to use GNU malloc, you
+   probably need to get the latest patches to the HP/UX compiler.
+   See `etc/MACHINES' for more information.  */
+#if 0
+#define SYSTEM_MALLOC 1
+#undef GNU_MALLOC
+#undef REL_ALLOC
+#endif
+
+#ifndef __GNUC__
+/* Make room for enough symbols, so dispnew.c does not fail.  */
+#define C_SWITCH_SYSTEM -Wp,-H200000 -D_BSD
+#else
+#define C_SWITCH_SYSTEM -D_BSD
+#endif
+
+#if 0 /* These definitions run into a bug in hpux
+	 whereby trying to disable the vdsusp character has no effect.
+	 supposedly there is no particular need for this.  */
+/* neal@ctd.comsat.com */
+#undef HAVE_TERMIO
+#define HAVE_TERMIOS
+#define NO_TERMIO
+#endif
+
+/* According to ngorelic@speclab.cr.usgs.gov,
+   references to the X11R4 directories in these variables
+   (inherited from hpux8.h)
+   cause the wrong libraries to be found,
+   and the options to specify the X11R5 directories are unnecessary
+   since the R5 files are found without them.  */
+#undef LIB_X11_LIB
+#undef C_SWITCH_X_SYSTEM
+#undef LD_SWITCH_X_DEFAULT
+/* However, HPUX 9 has Motif includes in a strange place.
+   So search that place.  These definitions assume that X11R5 is being
+   used -- if X11R4 is used, "s/hpux9-x11r4.h" gets loaded instead.  */
+/* horst@tkm.physik.uni-karlsruhe.de says that the /usr/contrib/... dirs
+   are needed to find the Xmu and Xaw libraries.  */
+#define C_SWITCH_X_SYSTEM -I/usr/include/X11R5 -I/usr/contrib/X11R5/include -I/usr/include/Motif1.2
+#define LD_SWITCH_X_DEFAULT -L/usr/lib/X11R5 -L/usr/contrib/X11R5/lib -L/usr/lib/Motif1.2
+
+#ifndef HAVE_LIBXMU
+/* HP-UX doesn't supply Xmu.  */
+#define LIBXMU
+
+#endif
+
+/* Assar Westerlund <assar@sics.se> says this is necessary for
+   HP-UX 10.20, and that it works for HP-UX 0 as well.  */
+#define NO_EDITRES
+
+/* zoo@armadillo.com says we don't need -lXext in HPUX 9.  */
+#undef LIBX11_SYSTEM
+
+/* Tested in getloadavg.c.  */
+#define HAVE_PSTAT_GETDYNAMIC
+
+/* Eric Backus <ericb@lsid.hp.com> says, HP-UX 9.x on HP 700 machines
+   has a broken `rint' in some library versions including math library
+   version number A.09.05.
+
+   You can fix the math library by installing patch number PHSS_4630.
+   But we can fix it more reliably for Emacs like this. */
+#undef HAVE_RINT
+
+
============================================================
--- support/libtty/src/system/hpux9shr.h	7222be217103febb7fa139e7c60ba7ab12410333
+++ support/libtty/src/system/hpux9shr.h	7222be217103febb7fa139e7c60ba7ab12410333
@@ -0,0 +1,13 @@
+#define ORDINARY_LINK
+#define HPUX_USE_SHLIBS
+#define RUN_TIME_REMAP
+
+#include "hpux9.h"
+
+#if 0 /* No longer needed, since in current GCC -g no longer does that.  */
+/* We must turn off -g since it forces -static.  */
+#ifdef __GNUC__
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH
+#endif
+#endif
============================================================
--- support/libtty/src/system/irix5-0.h	dc5bdc01ae18e6f0a88d1ab2b42882ebbfb792dd
+++ support/libtty/src/system/irix5-0.h	dc5bdc01ae18e6f0a88d1ab2b42882ebbfb792dd
@@ -0,0 +1,123 @@
+#include "usg5-4.h"
+
+#define IRIX5
+
+#undef sigsetmask  /* use sys_sigsetmask */
+#undef _longjmp /* use system versions, not conservative aliases */
+#undef _setjmp
+
+#define SETPGRP_RELEASES_CTTY
+
+#ifdef LIBS_SYSTEM
+#undef LIBS_SYSTEM
+#endif
+
+#ifdef LIB_STANDARD
+#undef LIB_STANDARD
+#endif
+
+#ifdef SYSTEM_TYPE
+#undef SYSTEM_TYPE
+#endif
+#define SYSTEM_TYPE "irix"
+
+#ifdef SETUP_SLAVE_PTY
+#undef SETUP_SLAVE_PTY
+#endif
+
+/* thomas@mathematik.uni-bremen.de says this is needed.  */
+/* Make process_send_signal work by "typing" a signal character on the pty.  */
+#define SIGNALS_VIA_CHARACTERS
+
+/* Define HAVE_ALLOCA to say that the system provides a properly
+   working alloca function and it should be used. */
+#define HAVE_ALLOCA
+#undef C_ALLOCA
+
+#ifndef NOT_C_CODE
+#ifndef __GNUC__
+#include <alloca.h>
+#endif
+#endif
+
+/* SGI has all the fancy wait stuff, but we can't include sys/wait.h
+   because it defines BIG_ENDIAN and LITTLE_ENDIAN (ugh!.)  Instead
+   we'll just define WNOHANG right here.
+   (An implicit decl is good enough for wait3.)  */
+
+/* #define WNOHANG		0x1 */
+
+/* No need to use sprintf to get the tty name--we get that from _getpty.  */
+#ifdef PTY_TTY_NAME_SPRINTF
+#undef PTY_TTY_NAME_SPRINTF
+#endif
+#define PTY_TTY_NAME_SPRINTF
+/* No need to get the pty name at all.  */
+#ifdef PTY_NAME_SPRINTF
+#undef PTY_NAME_SPRINTF
+#endif
+#define PTY_NAME_SPRINTF
+#ifdef emacs
+char *_getpty();
+#endif
+/* We need only try once to open a pty.  */
+#define PTY_ITERATION
+/* Here is how to do it.  */
+#define PTY_OPEN					    \
+{							    \
+  struct sigaction ocstat, cstat;			    \
+  char * name;						    \
+  sigemptyset(&cstat.sa_mask);				    \
+  cstat.sa_handler = SIG_DFL;				    \
+  cstat.sa_flags = 0;					    \
+  sigaction(SIGCLD, &cstat, &ocstat);			    \
+  name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0);	    \
+  sigaction(SIGCLD, &ocstat, (struct sigaction *)0);	    \
+  if (name == 0)					    \
+    return -1;						    \
+  if (fd < 0)						    \
+    return -1;						    \
+  if (fstat (fd, &stb) < 0)				    \
+    return -1;						    \
+  strcpy (pty_name, name);				    \
+}
+
+/* Since we use POSIX constructs in PTY_OPEN, we must force POSIX
+   throughout. */
+#define POSIX_SIGNALS
+
+/* Info from simon@lia.di.epfl.ch (Simon Leinen) suggests this is needed.  */
+#define GETPGRP_NO_ARG
+
+/* Ulimit(UL_GMEMLIM) is busted...  */
+#define ULIMIT_BREAK_VALUE 0x14000000
+
+/* Tell process_send_signal to use VSUSP instead of VSWTCH.  */
+#define PREFER_VSUSP
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+#define MAIL_USE_FLOCK
+
+/* use K&R C */
+#if 0
+#ifndef __GNUC__
+#define C_SWITCH_SYSTEM -cckr
+#endif
+#endif
+
+/* -g does not work on Irix, and since gcc warns if you use it,
+   turn off the warning.  */
+#ifdef __GNUC__
+#define C_DEBUG_SWITCH
+#endif
+
+/* Prevent the variable ospeed from being defined by -lcurses
+   because it defines it with too few bytes.  */
+#define ospeed ospeed_
+
+#define NARROWPROTO 1
+
============================================================
--- support/libtty/src/system/irix6-5.h	e37ec332df30aafd4c7765bf7a2f27608eab98b2
+++ support/libtty/src/system/irix6-5.h	e37ec332df30aafd4c7765bf7a2f27608eab98b2
@@ -0,0 +1,44 @@
+#define IRIX6
+#define IRIX6_5
+#include "irix5-0.h"
+
+/* Irix 6 tries to do 64 bits, but doesn't do it fully,
+   so inhibit that.  */
+#define IRIX_FORCE_32_BITS
+
+#ifndef __GNUC__
+#ifndef IRIX6_5
+#define LD_SWITCH_SYSTEM -32
+#else
+#define LD_SWITCH_SYSTEM -n32
+#endif
+#endif
+
+/* This macro definition, which we inherited from irix5-0.h,
+   is needed in configure on Irix 5, but gets in the way there
+   on Irix 6.  So get rid of it except in Makefile.in where we need it.  */
+#ifndef THIS_IS_MAKEFILE
+#undef C_SWITCH_SYSTEM
+#endif
+
+/* The only supported configuration of GCC under IRIX6.x produces
+   n32 MIPS ABI binaries and also supports -g. */
+#ifdef __GNUC__
+#undef C_DEBUG_SWITCH
+#define C_DEBUG_SWITCH -g
+#else
+/* Optimize, inaccurate debugging, increase limit on size of what's
+   optimized.
+
+   This should also be applicable other than on Irix 6.5, but I don't
+   know for which compiler versions.  -- fx */
+#define C_DEBUG_SWITCH -g3 -O -OPT:Olimit=3500
+#endif
+
+#undef SA_RESTART
+
+/* It turns out that the #define in irix5-0.h is needed in Irix 6 as well.  */
+#if 0
+/* Canced the #define that is in irix5-0.h.  */
+#undef ospeed
+#endif
============================================================
--- support/libtty/src/system/osf1.h	d3f5f83fb736f5e06951bc81caab933ee40321f3
+++ support/libtty/src/system/osf1.h	d3f5f83fb736f5e06951bc81caab933ee40321f3
@@ -0,0 +1,35 @@
+#include "bsd4-3.h"
+
+/* Identify OSF1 for the m- files. */
+
+#define OSF1
+
+/* Define _BSD to tell the include files we're running under
+   the BSD universe and not the SYSV universe.  */
+
+#define C_SWITCH_SYSTEM	-D_BSD
+#define LIBS_SYSTEM	-lbsd
+
+#define GETPGRP_NO_ARG
+
+#define SYSV_SYSTEM_DIR
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+#define COFF
+
+/* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
+   says where to find X windows at run time.  We convert it to a -rpath option
+   which is what OSF1 uses.  */
+#define LD_SWITCH_SYSTEM `echo LD_SWITCH_X_SITE_AUX | sed -e 's/-R/-Wl,-rpath,/'`
+
+#define HAVE_TERMIOS
+
+/* Specify the type that the 3rd arg of `accept' points to.  */
+#define SOCKLEN_TYPE int
+
+#ifndef __GNUC__
+/* Optimize, inaccurate debugging.  */
+#define C_DEBUG_SWITCH -g3
+#endif
============================================================
--- support/libtty/src/system/sol2-3.h	0e2b310339e65866eb14e6c75152f9c8f490765c
+++ support/libtty/src/system/sol2-3.h	0e2b310339e65866eb14e6c75152f9c8f490765c
@@ -0,0 +1,50 @@
+#include "sol2.h"
+
+/* Solaris 2.3 has a bug in XListFontsWithInfo.  */
+#define BROKEN_XLISTFONTSWITHINFO
+
+/* Override LD_SWITCH_SYSTEM: add  -L /usr/ccs/lib to the sol2.h value.  */
+
+#undef LD_SWITCH_SYSTEM
+
+#ifndef __GNUC__
+#define LD_SWITCH_SYSTEM -L /usr/ccs/lib LD_SWITCH_X_SITE_AUX
+#else /* GCC */
+/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX
+   has anything in it.  It can be empty.
+   This works ok in src.  Luckily lib-src does not use LD_SWITCH_SYSTEM.  */
+#define LD_SWITCH_SYSTEM -L /usr/ccs/lib \
+ `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX`
+#endif /* GCC */
+
+/* Info from fnf@cygnus.com suggests this is appropriate.  */
+#define POSIX_SIGNALS
+
+/* We don't need the definition from usg5-3.h with POSIX_SIGNALS.  */
+#undef sigsetmask
+
+/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
+   rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't
+   work if POSIX_SIGNALS is defined.  It may also be appropriate for SVR4.x
+   (x<2) but I'm not sure.   fnf@cygnus.com */
+/* This sets the name of the slave side of the PTY.  On SysVr4,
+   grantpt(3) forks a subprocess, so keep sigchld_handler() from
+   intercepting that death.  If any child but grantpt's should die
+   within, it should be caught after sigrelse(2). */
+
+#undef PTY_TTY_NAME_SPRINTF
+#define PTY_TTY_NAME_SPRINTF			\
+  {						\
+    char *ptsname (), *ptyname;			\
+						\
+    sigblock (sigmask (SIGCLD));		\
+    if (grantpt (fd) == -1)			\
+      { gvd_close (fd); return -1; }		\
+    sigunblock (sigmask (SIGCLD));		\
+    if (unlockpt (fd) == -1)			\
+      { gvd_close (fd); return -1; }		\
+    if (!(ptyname = ptsname (fd)))		\
+      { gvd_close (fd); return -1; }		\
+    strncpy (pty_name, ptyname, sizeof (pty_name)); \
+    pty_name[sizeof (pty_name) - 1] = 0;	\
+  }
============================================================
--- support/libtty/src/system/sol2-4.h	fd28643c1f2726f63cee42f9ce0c419990324a9d
+++ support/libtty/src/system/sol2-4.h	fd28643c1f2726f63cee42f9ce0c419990324a9d
@@ -0,0 +1,35 @@
+/* Handle Solaris 2.4.  */
+
+#include "sol2-3.h"
+
+#define SOLARIS2_4
+
+/* Get rid of -traditional and let const really do its thing.  */
+
+#ifdef __GNUC__
+#undef C_SWITCH_SYSTEM
+#undef const
+#endif /* __GNUC__ */
+
+#undef LD_SWITCH_SYSTEM
+
+/* `#ifdef USE_MOTIF' won't work here, since USE_MOTIF isn't defined yet.
+   Instead, dynamically check whether USE_MOTIF expands to something.  */
+#define NOT_USING_MOTIF { set x USE_MOTIF; test "$$2" = "USE_MOTIF"; }
+
+#ifndef __GNUC__
+#define LD_SWITCH_SYSTEM_TEMACS -L/usr/ccs/lib LD_SWITCH_X_SITE_AUX \
+  `NOT_USING_MOTIF || echo ' -R/usr/dt/lib'`
+#else /* GCC */
+/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX
+   has anything in it.  It can be empty.
+   This works ok in temacs.  */
+#define LD_SWITCH_SYSTEM_TEMACS -L/usr/ccs/lib \
+ `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX` \
+  `NOT_USING_MOTIF || echo ' -R/usr/dt/lib -L/usr/dt/lib'`
+#endif /* GCC */
+
+/* Gregory Neil Shapiro <gshapiro@hhmi.org> reports the Motif header files
+   are in this directory on Solaris 2.4.  */
+#define C_SWITCH_X_SYSTEM -I/usr/dt/include
+
============================================================
--- support/libtty/src/system/sol2-5.h	38fd62a008add666be2b463caaf0ecd9b595ffa2
+++ support/libtty/src/system/sol2-5.h	38fd62a008add666be2b463caaf0ecd9b595ffa2
@@ -0,0 +1,15 @@
+/* Handle Solaris 2.5.  */
+
+/* Enable large-file support if available (Solaris 2.6 and later).
+   Do this before including any system include file.  */
+#ifndef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE 1
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
+#include <sys/ioctl.h>
+#include <sys/stropts.h>
+#include "sol2-4.h"
+
============================================================
--- support/libtty/src/system/sol2.h	61c7f5283d7c72527ee093e6b6ae7d703fe47e64
+++ support/libtty/src/system/sol2.h	61c7f5283d7c72527ee093e6b6ae7d703fe47e64
@@ -0,0 +1,41 @@
+#include "usg5-4.h"
+
+#define SOLARIS2
+
+/* eggert@twinsun.com said these work in Solaris.
+   Perhaps they work in all kinds of SVR4, but this is more conservative.  */
+#undef BROKEN_TIOCGETC
+#undef BROKEN_TIOCGWINSZ
+
+/* This triggers a conditional in xfaces.c.  */
+#define XOS_NEEDS_TIME_H
+
+#define POSIX
+
+/* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
+   says where to find X windows at run time.  */
+#ifndef __GNUC__
+#define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX
+#else /* GCC */
+/* We use ./prefix-args because we don't know whether LD_SWITCH_X_SITE_AUX
+   has anything in it.  It can be empty.
+   This works ok in src.  Luckily lib-src does not use LD_SWITCH_SYSTEM.  */
+#define LD_SWITCH_SYSTEM `./prefix-args -Xlinker LD_SWITCH_X_SITE_AUX`
+#endif /* GCC */
+
+#undef LIBS_SYSTEM
+#define LIBS_SYSTEM -lsocket -lnsl -lkstat
+
+/* Prefer kstat over kvm in getloadavg.c, kstat doesn't require root.
+   ghazi@caip.rutgers.edu, 7/21/97. */
+#define HAVE_LIBKSTAT
+
+/* eggert thinks all versions of SunPro C allowed this.  */
+#ifndef __GNUC__
+#define C_DEBUG_SWITCH -g -O
+#endif
+
+/* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
+   XIM support.  */
+
+#define INHIBIT_X11R6_XIM
============================================================
--- support/libtty/src/system/unixware.h	b4600719659646c0569ce8f24e34f22965608444
+++ support/libtty/src/system/unixware.h	b4600719659646c0569ce8f24e34f22965608444
@@ -0,0 +1,8 @@
+#include "usg5-4-2.h"
+
+#ifndef __GNUC__
+#undef HAVE_ALLOCA
+#define C_ALLOCA
+#endif
+
+#define	PENDING_OUTPUT_COUNT(FILE) ((FILE)->__ptr - (FILE)->__base)
============================================================
--- support/libtty/src/system/usg5-3.h	4ca10bfef4eb42c7c8d6f204837a146ba757bb7e
+++ support/libtty/src/system/usg5-3.h	4ca10bfef4eb42c7c8d6f204837a146ba757bb7e
@@ -0,0 +1,203 @@
+/* Definitions file for GNU Emacs running on AT&T's System V Release 3
+   Copyright (C) 1987, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+/*
+ *	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.
+ */
+
+#define USG				/* System III, System V, etc */
+
+#define USG5
+
+#define USG5_3
+
+/* SYSTEM_TYPE should indicate the kind of system you are using.
+ It sets the Lisp variable system-type.  */
+
+#define SYSTEM_TYPE "usg-unix-v"
+
+/* nomultiplejobs should be defined if your system's shell
+ does not have "job control" (the ability to stop a program,
+ run some other program, then continue the first one).  */
+
+#define NOMULTIPLEJOBS
+
+/* Default is to set interrupt_input to 0: don't do input buffering within Emacs */
+
+/* #define INTERRUPT_INPUT */
+
+/* Letter to use in finding device name of first pty,
+  if system supports pty's.  'p' means it is /dev/ptyp0  */
+
+#define FIRST_PTY_LETTER 'p'
+
+/*
+ *	Define HAVE_TERMIO if the system provides sysV-style ioctls
+ *	for terminal control.
+ */
+
+#define HAVE_TERMIO
+
+/*
+ *	Define HAVE_PTYS if the system supports pty devices.
+ */
+
+/* Some versions of V.3 have this, but not all.
+   #define HAVE_PTYS
+   #define SYSV_PTYS  */
+
+/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
+
+/* #define HAVE_SOCKETS */
+
+/*
+ *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
+ *      The 4.2 opendir, etc., library functions.
+ */
+
+/* #define NONSYSTEM_DIR_LIBRARY */
+
+/*
+ * 	Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
+ *	library functions.  Almost, but not quite the same as
+ *	the 4.2 functions
+ */
+#define SYSV_SYSTEM_DIR
+
+/* Define this symbol if your system has the functions bcopy, etc. */
+
+/* #define BSTRING */
+
+/* subprocesses should be defined if you want to
+ have code for asynchronous subprocesses
+ (as used in M-x compile and M-x shell).
+ This is supposed to work now on system V release 2.  */
+
+#define subprocesses
+
+/* If your system uses COFF (Common Object File Format) then define the
+   preprocessor symbol "COFF". */
+
+#define COFF
+
+/* define MAIL_USE_FLOCK if the mailer uses flock
+   to interlock access to /usr/spool/mail/$USER.
+   The alternative is that a lock file named
+   /usr/spool/mail/$USER.lock.  */
+
+/* #define MAIL_USE_FLOCK */
+
+/* Define CLASH_DETECTION if you want lock files to be written
+   so that Emacs can tell instantly when you try to modify
+   a file that someone else has modified in his Emacs.  */
+
+/* #define CLASH_DETECTION */
+
+/* Define SHORTNAMES if the C compiler can distinguish only
+   short names.  It means that the stuff in ../shortnames
+   must be run to convert the long names to short ones.  */
+
+/* #define SHORTNAMES */
+
+/* The file containing the kernel's symbol table is called /unix.  */
+
+#define KERNEL_FILE "/unix"
+
+/* The symbol in the kernel where the load average is found
+   is named avenrun.  */
+
+#define LDAV_SYMBOL "avenrun"
+
+/* Define this if system V IPC is available.  */
+
+#define HAVE_SYSVIPC
+
+/* Special hacks needed to make Emacs run on this system.  */
+
+/*
+ *	Make the sigsetmask function go away.  Don't know what the
+ *	ramifications of this are, but doesn't seem possible to
+ *	emulate it properly anyway at this point.
+ */
+
+#define sigsetmask(mask)	/* Null expansion */
+
+/* setjmp and longjmp can safely replace _setjmp and _longjmp,
+   but they will run slower.  */
+
+#define _setjmp setjmp
+#define _longjmp longjmp
+
+/* On USG systems these have different names */
+#define index strchr
+#define rindex strrchr
+
+/* USG systems tend to put everything declared static
+   into the initialized data area, which becomes pure after dumping Emacs.
+   Foil this.  Emacs carefully avoids static vars inside functions.  */
+
+#define static
+
+/* Compiler bug bites on many systems when default ADDR_CORRECT is used.  */
+
+#define ADDR_CORRECT(x) (x)
+
+/* Use terminfo instead of termcap.  */
+
+#define TERMINFO
+
+/* Some variants have TIOCGETC, but the structures to go with it
+   are not declared.  */
+
+#define BROKEN_TIOCGETC
+
+/* AT&T SVr3 X wants to be linked with shared libraries */
+
+#define LIB_X11_LIB -lX11_s
+
+/* X needs to talk on the network, so search the network library.  */
+
+#define LIBX10_SYSTEM -lnsl_s
+#define LIBX11_SYSTEM -lpt -lnls -lnsl_s -lc_s
+
+/* The docs for system V/386 suggest v.3 has sigpause,
+   so let's give it a try.  */
+#define HAVE_SYSV_SIGPAUSE
+
+/* Some variants have TIOCGWINSZ, but the structures to go with it
+   are not declared.  */
+
+#define BROKEN_TIOCGWINSZ
+
+/* If we're using the System V X port, BSD bstring functions will be handy */
+
+#ifdef HAVE_X_WINDOWS
+#define BSTRING
+#endif /* HAVE_X_WINDOWS */
+
+/* Enable support for shared libraries in unexec.  */
+
+#define USG_SHARED_LIBRARIES
+
+/* On USG systems signal handlers return void */
+
+#define SIGTYPE void
============================================================
--- support/libtty/src/system/usg5-4-2.h	bde2f4a6f15be0c8fc97c50f6a086aefe8af1e71
+++ support/libtty/src/system/usg5-4-2.h	bde2f4a6f15be0c8fc97c50f6a086aefe8af1e71
@@ -0,0 +1,59 @@
+/* s/ file for System V release 4.2.  */
+
+#include "usg5-4.h"
+
+/* pcg@aber.ac.uk says this is useless since fork does copy-on-write
+   #define HAVE_VFORK */
+/* fnf@cygnus.com says these exist.  */
+#define HAVE_TCATTR
+#if 0 /* autoconf should take care of this.  */
+#define HAVE_GETHOSTNAME
+#define HAVE_RANDOM
+#endif
+/* #define HAVE_GETWD  (appears to be buggy on SVR4.2) */
+
+/* Info from fnf@cygnus.com suggests this is appropriate.  */
+#define POSIX_SIGNALS
+
+/* We don't need the definition from usg5-3.h with POSIX_SIGNALS.  */
+#undef sigsetmask
+#undef HAVE_SYSV_SIGPAUSE
+
+/* Motif needs -lgen.  */
+#undef LIBS_SYSTEM
+#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
+
+/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
+   rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't
+   work if POSIX_SIGNALS is defined.  It may also be appropriate for SVR4.x
+   (x<2) but I'm not sure.   fnf@cygnus.com */
+/* This sets the name of the slave side of the PTY.  On SysVr4,
+   grantpt(3) forks a subprocess, so keep sigchld_handler() from
+   intercepting that death.  If any child but grantpt's should die
+   within, it should be caught after sigrelse(2). */
+
+#undef PTY_TTY_NAME_SPRINTF
+#define PTY_TTY_NAME_SPRINTF			\
+  {						\
+    char *ptsname(), *ptyname;			\
+						\
+    sigblock(sigmask(SIGCLD));			\
+    if (grantpt(fd) == -1)			\
+      fatal("could not grant slave pty", errno);	\
+    sigunblock(sigmask(SIGCLD));		\
+    if (unlockpt(fd) == -1)			\
+      fatal("could not unlock slave pty", errno);	\
+    if (!(ptyname = ptsname(fd)))		\
+      fatal ("could not enable slave pty", errno);	\
+    strncpy(pty_name, ptyname, sizeof(pty_name)); \
+    pty_name[sizeof(pty_name) - 1] = 0;		\
+  }
+
+/* Use libw.a along with X11R6 Xt.  */
+#define NEED_LIBW
+
+/* ryanr@ellingtn.ftc.nrcs.usda.gov (Richard Anthony Ryan) says -lXimp
+   is needed in UNIX_SV ... 4.2 1.1.2.  */
+#define LIB_MOTIF -lXm -lXimp
+
+#define VFORK_RETURN_TYPE pid_t
============================================================
--- support/libtty/src/system/usg5-4.h	1e427145a3901230fbd43dfd13ac75b8d4db664c
+++ support/libtty/src/system/usg5-4.h	1e427145a3901230fbd43dfd13ac75b8d4db664c
@@ -0,0 +1,210 @@
+/* Definitions file for GNU Emacs running on AT&T's System V Release 4
+   Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* This file written by James Van Artsdalen of Dell Computer Corporation.
+ * james@bigtex.cactus.org.  Subsequently improved for Dell 2.2 by Eric
+ * S. Raymond <esr@snark.thyrsus.com>.
+ */
+
+/* Use the SysVr3 file for at least base configuration. */
+
+#include "usg5-3.h"
+
+#define USG5_4
+
+/* We do have multiple jobs.  Handle ^Z. */
+
+#undef NOMULTIPLEJOBS
+
+/* Motif needs -lgen.  */
+#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
+#define ORDINARY_LINK
+
+#if 0
+#ifdef ORDINARY_LINK
+#define LIB_STANDARD -lc /usr/ucblib/libucb.a
+#else
+#define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
+#define LIB_STANDARD -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
+#endif
+#else
+
+#ifdef ORDINARY_LINK
+#define LIB_STANDARD
+#else
+#define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
+#define LIB_STANDARD -lc /usr/ccs/lib/crtn.o
+#endif
+#endif
+
+/* there are no -lg libraries on this system, and no libPW */
+
+#define LIBS_DEBUG
+/* This is turned off because nobody actually uses LIBS_STANDARD (Nov 1995).
+   That name is a typo.  The next step is to delete this entirely.  */
+/* #define LIBS_STANDARD -lc */
+
+/* No <sioctl.h> */
+
+#define NO_SIOCTL_H
+
+/* Undump with ELF */
+
+#undef COFF
+
+#define UNEXEC unexelf.o
+
+/* <sys/stat.h> *defines* stat(2) as a static function.  If "static"
+ * is blank, then many files will have a public definition for stat(2).
+ */
+
+#undef static
+
+/* Get FIONREAD from <sys/filio.h>.  Get <sys/ttold.h> to get struct
+ * tchars. But get <termio.h> first to make sure ttold.h doesn't
+ * interfere.  And don't try to use SIGIO yet.
+ */
+
+#ifndef NOT_C_CODE
+#include <sys/wait.h>
+#endif
+
+#ifdef emacs
+#ifndef NO_FILIO_H
+#include <sys/filio.h>
+#endif
+#include <termio.h>
+#include <sys/ttold.h>
+#include <signal.h>
+#include <sys/stream.h>
+#include <sys/stropts.h>
+#include <sys/termios.h>
+#define BROKEN_SIGIO
+#endif
+
+/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
+ * instead, there's a system variable _sys_nsig.  Unfortunately, we need the
+ * constant to dimension an array.  So wire in the appropriate value here.
+ */
+#define NSIG_MINIMUM 32
+
+/* We need bss_end from emacs.c for undumping */
+
+#ifndef USG_SHARED_LIBRARIES
+#define USG_SHARED_LIBRARIES
+#endif
+
+/* We can support this */
+
+#define CLASH_DETECTION
+
+#define HAVE_PTYS
+#define HAVE_TERMIOS
+#undef BROKEN_TIOCGWINSZ
+#undef BROKEN_TIOCGETC
+
+/* It is possible to receive SIGCHLD when there are no children
+   waiting, because a previous waitsys(2) cleaned up the carcass of child
+   without clearing the SIGCHLD pending info.  So, use a non-blocking
+   wait3 instead, which maps to waitpid(2) in SysVr4. */
+
+#define HAVE_WAIT_HEADER
+#define WAITTYPE int
+#define wait3(status, options, rusage) \
+  waitpid ((pid_t) -1, (status), (options))
+#define WRETCODE(w) (w >> 8)
+
+/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
+   subprocesses the usual way.  But TIOCSIGNAL does work for PTYs, and
+   this is all we need.  */
+
+#ifndef IRIX6
+#define TIOCSIGSEND TIOCSIGNAL
+#endif
+
+/* This change means that we don't loop through allocate_pty too many
+   times in the (rare) event of a failure. */
+
+#undef FIRST_PTY_LETTER
+#define FIRST_PTY_LETTER 'z'
+
+/* This sets the name of the master side of the PTY. */
+
+#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
+
+/* This sets the name of the slave side of the PTY.  On SysVr4,
+   grantpt(3) forks a subprocess, so keep sigchld_handler() from
+   intercepting that death.  If any child but grantpt's should die
+   within, it should be caught after sigrelse(2). */
+
+#define PTY_TTY_NAME_SPRINTF				\
+  {							\
+    char *ptsname (), *ptyname;				\
+							\
+    sighold (SIGCLD);					\
+    if (grantpt (fd) == -1)				\
+      { gvd_close (fd); return -1; }			\
+    sigrelse (SIGCLD);					\
+    if (unlockpt (fd) == -1)				\
+      { gvd_close (fd); return -1; }			\
+    if (!(ptyname = ptsname (fd)))			\
+      { gvd_close (fd); return -1; }			\
+    strncpy (pty_name, ptyname, sizeof (pty_name));	\
+    pty_name[sizeof (pty_name) - 1] = 0;		\
+  }
+
+/* Push various streams modules onto a PTY channel. */
+
+#define SETUP_SLAVE_PTY \
+  if (ioctl (xforkin, I_PUSH, "ptem") == -1)	\
+    fatal ("ioctl I_PUSH ptem", errno);		\
+  if (ioctl (xforkin, I_PUSH, "ldterm") == -1)	\
+    fatal ("ioctl I_PUSH ldterm", errno);	\
+  if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
+    fatal ("ioctl I_PUSH ttcompat", errno);
+
+/* Undo the SVr3 X11 library definition */
+#undef LIB_X11_LIB
+
+/* The definition of this in s-usg5-3.h is not needed in 5.4.  */
+/* liblnsl_s should never be used.  The _s suffix implies a shared
+   library, as opposed to a DLL.  Share libraries were used in SVR3, and are
+   available only in order to allow SVR3 binaries to run.  They should not be
+   linked in to new binaries. -- caraway!pinkas@caraway.intel.com.  */
+#undef LIBX10_SYSTEM
+#undef LIBX11_SYSTEM
+
+/* Tell x11term.c and keyboard.c we have the system V streams feature.  */
+#define SYSV_STREAMS
+
+/* This definition was suggested for next release.
+   So give it a try.  */
+#define HAVE_SOCKETS
+
+#ifndef IRIX6
+#define bcopy(src,dst,n)	memmove (dst,src,n)
+#define bcmp(src,dst,n)		memcmp (src,dst,n)
+#define bzero(s,n)		memset (s,0,n)
+#endif
+
+/* Markus Weiand <weiand@khof.com> says this is needed for Motif on
+   SINIX.  */
+#undef LIBS_SYSTEM
+#define LIBS_SYSTEM -lgen
============================================================
--- support/libtty/src/system/windows.h	583597eb84b536be36f94dcc23dec370c55bbadc
+++ support/libtty/src/system/windows.h	583597eb84b536be36f94dcc23dec370c55bbadc
@@ -0,0 +1,10 @@
+/* System description file for Windows 95.  */
+
+#define WINDOWS95
+#define WINDOWSNT
+#define DOS_NT
+
+#define _P_WAIT 0
+#define _P_NOWAIT 1	/* from process.h */
+
+#undef HAVE_VFORK
============================================================
--- support/libtty/src/systty.h	31ad9522bdf3ed4e5beea67a5ae37acfdc933176
+++ support/libtty/src/systty.h	31ad9522bdf3ed4e5beea67a5ae37acfdc933176
@@ -0,0 +1,406 @@
+/* systty.h - System-dependent definitions for terminals.
+   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 ACT-Europe.
+
+This file is part of GVD.
+
+GVD 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 2, or (at your option)
+any later version.
+
+GVD 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 GVD; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_TTY
+#define _SYS_TTY
+
+#ifdef HAVE_TERMIOS
+#define HAVE_TCATTR
+#endif
+
+/* If we defined these before and we are about to redefine them,
+   prevent alarming warnings.  */
+#ifdef BSD_TERMIOS
+#undef NL0
+#undef NL1
+#undef CR0
+#undef CR1
+#undef CR2
+#undef CR3
+#undef TAB0
+#undef TAB1
+#undef TAB2
+#undef XTABS
+#undef BS0
+#undef BS1
+#undef FF0
+#undef FF1
+#undef ECHO
+#undef NOFLSH
+#undef TOSTOP
+#undef FLUSHO
+#undef PENDIN
+#endif
+
+/* Include the proper files.  */
+#ifdef HAVE_TERMIO
+#ifdef __DGUX
+#include <sys/ioctl.h>
+#endif
+#ifndef NO_TERMIO
+#include <termio.h>
+#endif /* not NO_TERMIO */
+#ifndef INCLUDED_FCNTL
+#define INCLUDED_FCNTL
+#include <fcntl.h>
+#endif
+#else /* not HAVE_TERMIO */
+#ifdef HAVE_TERMIOS
+#if defined(_AIX) && defined(_I386)
+#include <termios.h>		/* termios.h needs to be before termio.h */
+#include <termio.h>
+#else /* not (_AIX && _I386) */
+#ifndef NO_TERMIO
+#include <termio.h>
+#endif
+#include <termios.h>
+#endif /* not (_AIX && _I386) */
+#define INCLUDED_FCNTL
+#include <fcntl.h>
+#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
+#ifndef VMS
+#ifndef DOS_NT
+#include <sgtty.h>
+#endif /* not DOS_NT */
+#else /* VMS */
+#include <descrip.h>
+static struct iosb
+{
+  short status;
+  short offset;
+  short termlen;
+  short term;
+} input_iosb;
+
+extern int waiting_for_ast;
+extern int stop_input;
+extern int input_ef;
+extern int timer_ef;
+extern int process_ef;
+extern int input_eflist;
+extern int timer_eflist;
+
+static $DESCRIPTOR (input_dsc, "TT");
+static int terminator_mask[2] = { 0, 0 };
+
+static struct sensemode {
+  short status;
+  unsigned char xmit_baud;
+  unsigned char rcv_baud;
+  unsigned char crfill;
+  unsigned char lffill;
+  unsigned char parity;
+  unsigned char unused;
+  char class;
+  char type;
+  short scr_wid;
+  unsigned long tt_char : 24, scr_len : 8;
+  unsigned long tt2_char;
+} sensemode_iosb;
+#endif /* VMS */
+#endif /* not HAVE_TERMIOS */
+#endif /* not HAVE_TERMIO */
+
+#ifdef __GNU_LIBRARY__
+#include <sys/ioctl.h>
+#include <termios.h>
+#endif
+
+#ifdef AIXHFT
+/* Get files for keyboard remapping */
+#define HFNKEYS 2
+#include <sys/hft.h>
+#include <sys/devinfo.h>
+#endif
+
+/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs.  */
+#ifdef BSD4_1
+#undef LLITOUT
+#define LLITOUT 0
+#endif /* 4.1 */
+
+#ifdef NEED_BSDTTY
+#include <sys/bsdtty.h>
+#endif
+
+#if defined (HPUX) && defined (HAVE_PTYS)
+#include <sys/ptyio.h>
+#endif
+
+#ifdef AIX
+#include <sys/pty.h>
+#endif /* AIX */
+
+#if (defined (POSIX) || defined (NEED_UNISTD_H)) && defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#ifdef SYSV_PTYS
+#include <sys/types.h>
+#include <sys/tty.h>
+#ifdef titan
+#include <sys/ttyhw.h>
+#include <sys/stream.h>
+#endif
+#ifndef NO_PTY_H
+#include <sys/pty.h>
+#endif
+#endif
+
+/* saka@pfu.fujitsu.co.JP writes:
+   FASYNC defined in this file. But, FASYNC don't working.
+   so no problem, because unrequest_sigio only need. */
+#if defined (pfa)
+#include <sys/file.h>
+#endif
+
+
+/* Special cases - inhibiting the use of certain features.  */
+
+#ifdef APOLLO
+#undef TIOCSTART
+#endif
+
+#ifdef XENIX
+#undef TIOCGETC  /* Avoid confusing some conditionals that test this.  */
+#endif
+
+#ifdef BROKEN_TIOCGETC
+#undef TIOCGETC  /* Avoid confusing some conditionals that test this.  */
+#endif
+
+/* UNIPLUS systems may have FIONREAD.  */
+#ifdef UNIPLUS
+#include <sys.ioctl.h>
+#endif
+
+/* Allow m- file to inhibit use of FIONREAD.  */
+#ifdef BROKEN_FIONREAD
+#undef FIONREAD
+#undef ASYNC
+#endif
+
+/* Interrupt input is not used if there is no FIONREAD.  */
+#ifndef FIONREAD
+#undef SIGIO
+#endif
+
+/* On TERMIOS systems, the tcmumbleattr calls take care of these
+   parameters, and it's a bad idea to use them (on AIX, it makes the
+   tty hang for a long time).  */
+#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
+#define HAVE_LTCHARS
+#endif
+
+#if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
+#define HAVE_TCHARS
+#endif
+
+
+/* Try to establish the correct character to disable terminal functions
+   in a system-independent manner.  Note that USG (at least) define
+   _POSIX_VDISABLE as 0!  */
+
+#ifdef _POSIX_VDISABLE
+#define CDISABLE _POSIX_VDISABLE
+#else /* not _POSIX_VDISABLE */
+#ifdef CDEL
+#undef CDISABLE
+#define CDISABLE CDEL
+#else /* not CDEL */
+#define CDISABLE 255
+#endif /* not CDEL */
+#endif /* not _POSIX_VDISABLE */
+
+/* Get the number of characters queued for output.  */
+
+/* GVD_OUTQSIZE(FD, int *SIZE) stores the number of characters
+   queued for output to the terminal FD in *SIZE, if FD is a tty.
+   Returns -1 if there was an error (i.e. FD is not a tty), 0
+   otherwise.  */
+#ifdef TIOCOUTQ
+#define GVD_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size)))
+#endif
+
+#ifdef HAVE_TERMIO
+#ifdef TCOUTQ
+#undef GVD_OUTQSIZE
+#define GVD_OUTQSIZE(fd, size) (ioctl ((fd), TCOUTQ, (size)))
+#endif
+#endif
+
+
+/* Manipulate a terminal's current process group.  */
+
+/* GVD_HAVE_TTY_PGRP is true if we can get and set the tty's current
+   controlling process group.
+
+   GVD_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's
+   current process group.  Return -1 if there is an error.
+
+   GVD_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's
+   current process group to *PGID.  Return -1 if there is an error.  */
+
+#ifdef HPUX
+/* HPUX tty process group stuff doesn't work, says the anonymous voice
+   from the past.  */
+#else
+#ifdef TIOCGPGRP
+#define GVD_HAVE_TTY_PGRP
+#else
+#ifdef HAVE_TERMIOS
+#define GVD_HAVE_TTY_PGRP
+#endif
+#endif
+#endif
+
+#ifdef GVD_HAVE_TTY_PGRP
+
+#if defined (HAVE_TERMIOS) && ! defined (BSD_TERMIOS)
+
+#define GVD_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd)))
+#define GVD_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid)))
+
+#else
+#ifdef TIOCSPGRP
+
+#define GVD_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid)))
+#define GVD_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid)))
+
+#endif
+#endif
+
+#else
+
+/* Just ignore this for now and hope for the best */
+#define GVD_GET_TTY_PGRP(fd, pgid) 0
+#define GVD_SET_TTY_PGRP(fd, pgif) 0
+
+#endif
+
+
+/* Manipulate a TTY's input/output processing parameters.  */
+
+/* struct gvd_tty is a structure used to hold the current tty
+   parameters.  If the terminal has several structures describing its
+   state, for example a struct tchars, a struct sgttyb, a struct
+   tchars, a struct ltchars, and a struct pagechars, struct
+   gvd_tty should contain an element for each parameter struct
+   that Gvd may change.
+
+   GVD_GET_TTY (int FD, struct gvd_tty *P) stores the parameters
+   of the tty on FD in *P.  Return zero if all's well, or -1 if we ran
+   into an error we couldn't deal with.
+
+   GVD_SET_TTY (int FD, struct gvd_tty *P, int flushp)
+   sets the parameters of the tty on FD according to the contents of
+   *P.  If flushp is non-zero, we discard queued input to be
+   written before making the change.
+   Return 0 if all went well, and -1 if anything failed.
+
+   GVD_TTY_TABS_OK (struct gvd_tty *P) is false iff the kernel
+   expands tabs to spaces upon output; in that case, there is no
+   advantage to using tabs over spaces.  */
+
+
+/* For each tty parameter structure that Gvd might want to save and restore,
+   - include an element for it in this structure, and
+   - extend the gvd_{get,set}_tty functions in sysdep.c to deal with the
+     new members.  */
+
+struct gvd_tty {
+
+/* There is always one of the following elements, so there is no need
+   for dummy get and set definitions.  */
+#ifdef HAVE_TCATTR
+  struct termios main;
+#else
+#ifdef HAVE_TERMIO
+  struct termio main;
+#else
+#ifdef VMS
+  struct sensemode main;
+#else
+#ifdef DOS_NT
+  int main;
+#else  /* not DOS_NT */
+  struct sgttyb main;
+#endif /* not DOS_NT */
+#endif
+#endif
+#endif
+
+/* If we have TERMIOS, we don't need to do this - they're taken care of
+   by the tc*attr calls.  */
+#ifndef HAVE_TERMIOS
+#ifdef HAVE_LTCHARS
+  struct ltchars ltchars;
+#endif
+
+#ifdef HAVE_TCHARS
+  struct tchars tchars;
+  int lmode;
+#endif
+#endif
+};
+
+/* Define GVD_GET_TTY and GVD_SET_TTY,
+   the macros for reading and setting parts of `struct gvd_tty'.
+
+   These got pretty unmanageable (huge macros are hard to debug), and
+   finally needed some code which couldn't be done as part of an
+   expression, so we moved them out to their own functions in sysdep.c.  */
+#define GVD_GET_TTY(fd, p)        (gvd_get_tty ((fd), (p)))
+#define GVD_SET_TTY(fd, p, waitp) (gvd_set_tty ((fd), (p), (waitp)))
+
+
+/* Define GVD_TTY_TABS_OK.  */
+
+#ifdef HAVE_TERMIOS
+
+#ifdef TABDLY
+#define GVD_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
+#else
+#define GVD_TTY_TABS_OK(p) 1
+#endif
+
+#else /* not def HAVE_TERMIOS */
+#ifdef HAVE_TERMIO
+
+#define GVD_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3)
+
+#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
+#ifdef VMS
+
+#define GVD_TTY_TABS_OK(p) (((p)->main.tt_char & TT$M_MECHTAB) != 0)
+
+#else
+
+#ifdef DOS_NT
+#define GVD_TTY_TABS_OK(p) 0
+#else /* not DOS_NT */
+#define GVD_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS)
+#endif /* not DOS_NT */
+
+#endif /* not def VMS */
+#endif /* not def HAVE_TERMIO */
+#endif /* not def HAVE_TERMIOS */
+#endif /* _SYS_TTY */