--- vte-0.12.1.orig/src/makefile.msc
+++ vte-0.12.1/src/makefile.msc
@@ -0,0 +1,79 @@
+## Use: nmake -f makefile.msc
+!IFNDEF COMPILE_ENV
+COMPILE_ENV=c:\build
+!ENDIF
+
+!INCLUDE $(COMPILE_ENV)\include\make.msc
+ROOT= $(COMPILE_ENV)\out
+################################################################
+
+INCLUDES = -FI$(TOP)\include\msvc_recommended_pragmas.h $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS) -I .
+DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS) $(INTL_CFLAGS) $(LIBGLADE_CFLAGS) $(GLIB_CFLAGS) $(LIBXML_CFLAGS) $(GTK2_CFLAGS) 
+
+LDFLAGS= /INCREMENTAL:NO $(INTL_LIBS) $(LIBICONV_LIBS) $(DIRENT_LIBS) $(INTL_LIBS) $(LIBGLADE_LIBS) $(GLIB_LIBS) $(LIBXML_LIBS) $(GTK2_LIBS) $(FONTSTUFF_LIBS) $(ATK_LIBS) $(REGEX_LIBS)
+PDBFILE=libvte.pdb
+DLLFILE=libvte.dll
+LIBFILE=libvte.lib
+
+CFLAGS = $(CFLAGS) /Fd$(PDBFILE) -DG_DISABLE_ASSERT
+all: install
+
+OUTPUTS = 			\
+	$(LIBFILE)
+	
+VTE_OBJECTS =			\
+	buffer.obj \
+	caps.obj \
+	debug.obj \
+	iso2022.obj \
+	keymap.obj \
+	marshal.obj \
+	matcher.obj \
+	pty.obj \
+	reaper.obj \
+	ring.obj \
+	table.obj \
+	trie.obj \
+	vte.obj \
+	vteaccess.obj \
+	vtebg.obj \
+	vteconv.obj \
+	vtedraw.obj \
+	vtefc.obj \
+	vteft2.obj \
+	vtegl.obj \
+	vteglyph.obj \
+	vtepango.obj \
+	vtepangox.obj \
+	vterdb.obj \
+	vteregex.obj \
+	vtergb.obj \
+	vteseq.obj \
+	vteskel.obj \
+	vtetc.obj \
+	vtetree.obj \
+	vtexft.obj 
+
+DLLOBJECTS = libzaudit.res
+		
+################ zorp-lib
+
+$(DLLFILE):  $(VTE_OBJECTS)
+	$(LINK) /dll /out:$(DLLFILE) /def:libvte.def $(VTE_OBJECTS) $(LDFLAGS)
+  
+marshal.c: marshal.h marshal.list
+	glib-genmarshal.exe --prefix=_vte_marshal --body marshal.list > marshal.c
+marshal.h: marshal.list
+	glib-genmarshal.exe --prefix=_vte_marshal --header marshal.list> marshal.h
+
+clean::
+	-del /q marshal.c marshal.h >NUL 2>&1
+
+install: $(DLLFILE)
+	if not exist $(ROOT)\bin mkdir $(ROOT)\bin
+	copy /y .\$(DLLFILE) $(ROOT)\bin >NULL
+	if not exist $(ROOT)\lib mkdir $(ROOT)\lib
+	copy /y .\$(LIBFILE) $(ROOT)\lib >NULL
+	if not exist $(ROOT)\debug mkdir $(ROOT)\debug
+	rem ugly hack to add the pdb file to the package.
+	if exist $(PDBFILE) copy /y $(PDBFILE) $(ROOT)\debug
--- vte-0.12.1.orig/src/Makefile.am
+++ vte-0.12.1/src/Makefile.am
@@ -19,7 +19,8 @@
 	unitable.JIS0201 \
 	unitable.JIS0208 \
 	unitable.JIS0212 \
-	unitable.KSX1001
+	unitable.KSX1001 \
+	makefile.msc
 
 AM_CFLAGS = @VTE_CFLAGS@ @CFLAGS@ @X_CFLAGS@ -DG_DISABLE_ASSERT
 AM_LDFLAGS = @LDFLAGS@
--- vte-0.12.1.orig/simple-patchsys.mk
+++ vte-0.12.1/simple-patchsys.mk
@@ -0,0 +1,147 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2002,2003 Colin Walters <walters@debian.org>
+# Description: A sample patch system which uses separate files in debian/patches
+#  Patch suffix is specified by DEB_PATCH_SUFFIX. Defaults to .patch.
+#
+# This program 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.
+#
+# 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.
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_rules_patchsys
+_cdbs_rules_patchsys := 1
+
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+ifeq ($(_cdbs_included_patchsys),)
+_cdbs_included_patchsys := 1
+
+_cdbs_patch_system_apply_rule := apply-patches
+_cdbs_patch_system_unapply_rule := reverse-patches
+
+DEB_PATCH_SUFFIX ?= .diff .diff.gz .diff.bz2 .patch .patch.gz .patch.bz2 
+DEB_PATCHDIRS ?= debian/patches
+close_parenthesis ?= )
+DEB_PATCHES := $(shell\
+for dir in $(DEB_PATCHDIRS) ; do \
+	for file in $$dir/* ; do \
+		for suffix in $(DEB_PATCH_SUFFIX) ; do \
+			case $$file in *$$suffix$(close_parenthesis) echo $$file ;; esac ; \
+		done ; \
+	done ; \
+done)
+
+# if we have any patches, check if some are patching config.{guess,sub,rpath}
+# and print a warning
+ifneq (, $(DEB_PATCHES))
+CDBS_BUILD_DEPENDS    := $(CDBS_BUILD_DEPENDS), patchutils
+evil_patches_that_do_nasty_things := $(shell\
+if lsdiff=`which lsdiff` ; then \
+  $$lsdiff -H $(DEB_PATCHES) \
+  | egrep "/config\.(guess|sub|rpath)$$" | tr "\n" " " ; \
+fi)
+ifneq (, $(evil_patches_that_do_nasty_things))
+$(warning ** WARNING **:  The following patches are modifiing auto-updated files.   Please exclude the following files from your patch:  $(evil_patches_that_do_nasty_things))
+endif
+endif
+
+post-patches:: apply-patches
+
+clean:: reverse-patches
+	rm -f debian/patches/*.log
+
+# The patch subsystem 
+apply-patches: pre-build debian/stamp-patched
+debian/stamp-patched: $(DEB_PATCHES)
+debian/stamp-patched reverse-patches:
+	#$(MAKE) -f debian/rules reverse-config
+	@echo "patches: $(DEB_PATCHES)"
+	@set -e ; reverse=""; patches="$(DEB_PATCHES)"; \
+	  if [ "$@" = "reverse-patches" ]; then \
+	    if [ ! -e debian/stamp-patched ]; then \
+	      echo "Not reversing not applied patches."; \
+	      exit 0; \
+	    fi; \
+	    reverse="-R"; \
+	    for patch in $$patches; do reversepatches="$$patch $$reversepatches"; done; \
+	    patches="$$reversepatches"; \
+	  fi; \
+	  for patch in $$patches; do \
+          case $$patch in \
+            *.gz) cat=zcat ;; \
+            *.bz2) cat=bzcat ;; \
+            *) cat=cat ;; \
+          esac; \
+	  level=$$(head $$patch | egrep '^#DPATCHLEVEL=' | cut -f 2 -d '='); \
+	  reverse=""; \
+	  if [ "$@" = "reverse-patches" ]; then reverse="-R"; fi; \
+	  success=""; \
+	  if [ -z "$$level" ]; then \
+	    echo -n "Trying "; if test -n "$$reverse"; then echo -n "reversed "; fi; echo -n "patch $$patch at level "; \
+	    for level in 0 1 2; do \
+	      if test -z "$$success"; then \
+	        echo -n "$$level..."; \
+		if [ "$(DEB_PATCHDIRS_READONLY)" = "yes" ] ; then \
+		  logfile="/dev/null" ; \
+		else \
+		  logfile="$$patch.level-$$level.log" ; \
+		fi ; \
+	        if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --dry-run -p$$level 1>$$logfile 2>&1; then \
+	          if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --no-backup-if-mismatch -V never -p$$level 1>$$logfile 2>&1; then \
+	            success=yes; \
+	            touch debian/stamp-patch-$$(basename $$patch); \
+	            echo "success."; \
+                  fi; \
+	        fi; \
+	      fi; \
+            done; \
+	    if test -z "$$success"; then \
+	      if test -z "$$reverse"; then \
+	        echo "failure."; \
+	        exit 1; \
+	       else \
+	         echo "failure (ignored)."; \
+               fi \
+	    fi; \
+	  else \
+	    echo -n "Trying patch $$patch at level $$level..."; \
+	        echo -n "$$level..."; \
+	    if [ "$(DEB_PATCHDIRS_READONLY)" = "yes" ] ; then \
+	      logfile="/dev/null" ; \
+	    else \
+	      logfile="$$patch.log" ; \
+	    fi ; \
+	    if $$cat $$patch | patch -d $(DEB_SRCDIR) $$reverse -E --no-backup-if-mismatch -V never -p$$level 1>$$logfile 2>&1; then \
+              touch debian/stamp-patch-$$(basename $$patch); \
+	      echo "success."; \
+	    else \
+	      echo "failure:"; \
+	      cat $$logfile; \
+	      if test -z "$$reverse"; then exit 1; fi; \
+            fi; \
+	  fi; \
+	done
+	if [ "$@" = "debian/stamp-patched" ] ; then touch debian/stamp-patched ; \
+	elif [ "$@" = "reverse-patches" ] ; then rm -f debian/stamp-patch* ; \
+	fi
+	#$(MAKE) -f debian/rules update-config
+
+endif
+
+endif
--- vte-0.12.1.orig/config.guess.cdbs-orig
+++ vte-0.12.1/config.guess.cdbs-orig
@@ -0,0 +1,1459 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-02-10'
+
+# 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.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# 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, 2002, 2003, 2004, 2005
+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
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	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.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		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
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# 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 ;;
+    amd64:OpenBSD:*:*)
+	echo x86_64-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    cats:OpenBSD:*:*)
+	echo arm-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    luna88k:OpenBSD:*:*)
+    	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-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 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mips64-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:MirBSD:*:*)
+	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# 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.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | 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;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit 0 ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	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 ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	esac ;;
+    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=`(sed 1q /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 ;;
+    # 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 ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${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 -o $dummy $dummy.c \
+	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && exit 0
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-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 -o $dummy $dummy.c && $dummy && exit 0
+		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 | sed 1q | 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])
+		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" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		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 -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    # avoid double evaluation of $set_cc_for_build
+	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	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 -o $dummy $dummy.c && $dummy && exit 0
+	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 ;;
+    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*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*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 ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	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 ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	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 ;;
+    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 ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit 0 ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	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 i586-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    amd64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	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:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit 0 ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit 0 ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	;;
+    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 ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	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.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C 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
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+	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:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+	i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	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|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	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 ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit 0 ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit 0 ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*: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 ;;
+    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 ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-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:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    NSR-?: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 ;;
+    *: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 ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit 0 ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms && exit 0 ;;
+	    I*) echo ia64-dec-vms && exit 0 ;;
+	    V*) echo vax-dec-vms && exit 0 ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	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 -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# 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:
--- vte-0.12.1.orig/makefile.msc
+++ vte-0.12.1/makefile.msc
@@ -0,0 +1,19 @@
+## Makefile for building the GLib dlls with Microsoft C
+## Use: nmake -f makefile.msc
+
+PARTS = src python termcaps
+
+all : \
+	sub-all
+	
+config_h: config.h-win32
+	copy config.h-win32 config.h
+
+sub-all: config_h
+    if not exist $(COMPILE_ENV)\dep\debug mkdir $(COMPILE_ENV)\dep\debug
+	for %d in ($(PARTS)) do (cd %d && nmake -nologo -f makefile.msc all && cd .. || exit 2)
+
+clean : sub-clean
+
+sub-clean:
+	for %d in ($(PARTS)) do (cd %d && nmake -nologo -f makefile.msc clean && cd .. || exit 2)
--- vte-0.12.1.orig/termcaps/makefile.msc
+++ vte-0.12.1/termcaps/makefile.msc
@@ -0,0 +1,18 @@
+## Use: nmake -f makefile.msc
+!IFNDEF COMPILE_ENV
+COMPILE_ENV=c:\build
+!ENDIF
+
+!INCLUDE $(COMPILE_ENV)\include\make.msc
+ROOT= $(COMPILE_ENV)\out
+################################################################
+
+clean::
+
+all:: install
+
+install: xterm
+	if not exist $(ROOT)\python mkdir $(ROOT)\python
+	if not exist $(ROOT)\python\share mkdir $(ROOT)\python\share
+	if not exist $(ROOT)\python\share\termcap mkdir $(ROOT)\python\share\termcap
+	if exist xterm copy /y xterm $(ROOT)\python\share\termcap
--- vte-0.12.1.orig/config.guess
+++ vte-0.12.1/config.guess
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2005-02-10'
+timestamp='2005-04-22'
 
 # 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
@@ -1140,6 +1140,10 @@
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
 	exit 0 ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit 0 ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
@@ -1419,7 +1423,9 @@
 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/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
--- vte-0.12.1.orig/config.sub
+++ vte-0.12.1/config.sub
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2005-02-10'
+timestamp='2005-04-22'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -231,6 +231,7 @@
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| fr30 | frv \
@@ -262,7 +263,8 @@
 	| pyramid \
 	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
 	| strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
@@ -298,7 +300,7 @@
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* \
-	| bs2000-* \
+	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
@@ -336,7 +338,8 @@
 	| romp-* | rs6000-* \
 	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
 	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
--- vte-0.12.1.orig/debian/control
+++ vte-0.12.1/debian/control
@@ -0,0 +1,67 @@
+Source: vte
+Section: libs
+Priority: optional
+Maintainer: Arnaud Patard <arnaud.patard@rtp-net.org>
+Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Akira TAGOH <tagoh@debian.org>, Andreas Rottmann <rotty@debian.org>, Andrew Lau <netsnipe@users.sourceforge.net>, Carlos Perelló Marín <carlos@pemas.net>, Ed Boraas <ed@debian.org>, Edd Dumbill <ejad@debian.org>, Emil Soleyman-Zomalan <emil@nishra.com>, Gustavo Noronha Silva <kov@debian.org>, J.H.M. Dassen (Ray) <jdassen@debian.org>, Joe Drew <drew@debian.org>, Johannes Rohr <j.rohr@comlink.org>, Jordi Mallach <jordi@debian.org>, Jose Carlos Garcia Sogo <jsogo@debian.org>, Josselin Mouette <joss@debian.org>, Marc 'HE' Brockschmidt <he@debian.org>, Ondřej Surý <ondrej@debian.org>, Rob Bradford <rob@debianplanet.org>, Robert McQueen <robot101@debian.org>, Ross Burton <ross@debian.org>, Sebastien Bacher <seb128@debian.org>, Sjoerd Simons <sjoerd@debian.org>, Takuo KITAME <kitame@debian.org>, Marc Dequènes <Duck@DuckCorp.org>
+Standards-Version: 3.6.2
+Build-Depends: cdbs, debhelper (>= 3.4.4), libgtk2.0-dev (>= 2.6), gettext, python-gtk2-dev, python-dev, libncurses5-dev, libxrender-dev, gnome-pkg-tools, gtk-doc-tools (>= 1.0), libxt-dev, libfreetype6-dev (>= 2.0.2), intltool
+
+Package: libvte4
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}, libvte-common (= ${Source-Version})
+Description: Terminal emulator widget for GTK+ 2.0 - runtime files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+
+Package: libvte-dev
+Architecture: any
+Section: libdevel
+Depends: libvte4 (= ${Source-Version}), libgtk2.0-dev (>= 2.6.0), libncurses5-dev, libxrender-dev, libxft-dev, libfreetype6-dev, libatk1.0-dev, libpango1.0-dev, libglib2.0-dev, libsm-dev, libice-dev, zlib1g-dev, libncurses5-dev | libncurses-dev, libx11-dev, libfontconfig1-dev
+Description: Terminal emulator widget for GTK+ 2.0 - development files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains development files for the VTE library.
+
+Package: libvte-common
+Architecture: all
+Section: libs
+Replaces: libvte2 (<= 0.5.1-2)
+Description: Terminal emulator widget for GTK+ 2.0 - common files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains internationalization files for the VTE library.
+
+Package: python-vte
+Architecture: any
+Section: python
+Depends: ${shlibs:Depends}, ${python:Depends}, python-gtk2
+Description: Python bindings for the VTE widget set
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains the bindings to use VTE in Python programs.
+
+Package: libvte-doc
+Architecture: all
+Section: doc
+Depends: 
+Description: Terminal emulator widget for GTK+ 2.0 - development files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains documentation files for the VTE library.
+
+
--- vte-0.12.1.orig/debian/libvte-doc.install
+++ vte-0.12.1/debian/libvte-doc.install
@@ -0,0 +1 @@
+debian/tmp/usr/share/gtk-doc
--- vte-0.12.1.orig/debian/rules
+++ vte-0.12.1/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# -*- mode: makefile; coding: utf-8 -*-
+#
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/rules/utils.mk
+include /usr/share/cdbs/1/class/gnome.mk
+include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
+
+version := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -n 1)
+
+DEB_CONFIGURE_LIBEXECDIR := \$${prefix}/lib/${version}
+DEB_FIXPERMS_EXCLUDE := gnome-pty-helper
+DEB_DH_MAKESHLIBS_ARGS_ALL = -V 'libvte4 (>= 1:0.12.1)'
+
+binary-install/python-vte::
+	dh_python
+
--- vte-0.12.1.orig/debian/watch
+++ vte-0.12.1/debian/watch
@@ -0,0 +1,4 @@
+version=2
+ftp://ftp.gnome.org/pub/GNOME/sources/vte/0.11/
+	vte-(.*)\.tar\.gz \
+	debian uupdate
--- vte-0.12.1.orig/debian/changelog
+++ vte-0.12.1/debian/changelog
@@ -0,0 +1,657 @@
+vte (1:0.12.1-0ubuntu1.zorpos3) sarge; urgency=low
+
+  * Fixed unicode character handling on Windows.
+
+ -- ZorpOS Maintainers <zorpos@balabit.com>  Thu, 30 Nov 2006 17:29:38 +0100
+
+vte (1:0.12.1-0ubuntu1.zorpos2) sarge; urgency=low
+
+  * Fixed wired-in font selection.
+
+ -- ZorpOS Maintainers <zorpos@balabit.com>  Thu, 02 Nov 2006 09:36:19 +0100
+
+vte (1:0.12.1-0ubuntu1.zorpos1) sarge; urgency=low
+
+  * Added Balabit patch patch to make it useful for ZAP.
+  * Added files for building it under windows.
+
+ -- ZorpOS Maintainers <zorpos@balabit.com>  Fri, 20 Oct 2006 18:09:52 +0200
+
+vte (1:0.12.1-0ubuntu1) dapper; urgency=low
+
+  * New upstream mrelease:
+    - Bug "Crash when pasting selection"
+    - Bug "mouse events occurring past column 95 are not passed through to 
+      terminal application"
+      New public function vte_terminal_feed_child_binary
+    - Bug "Feature request to attach VTE to existing pty"
+      New public function vte_terminal_set_pty
+    - Bug "UK pound currency symbol rendered incorrectly"
+    - Bug "Insufficient version requirement for gtk+"
+    - Bug "vim scrolling issues - emulation errors"
+    - Bug "334385 – Use intltool
+    - Bug "scrolling doesn't work inside "screen" windows"
+    - Bug "vteapp debug stuff should be conditional"
+  * debian/control.in:
+    - bumped libgtk2.0-dev requirements to >= 2.6.
+    - require intltool.
+  * debian/rules:
+    - bumped shlibs.
+  * debian/patches/20_fix_irssi_and_screen_breakage_CVS.patch:
+    - dropped, fixed upstream.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Thu, 27 Apr 2006 11:51:41 +0200
+
+vte (1:0.12.0-0ubuntu3) dapper; urgency=low
+
+  * debian/patches/20_fix_irssi_and_screen_breakage_CVS.patch:
+    - a fix for the fix.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Tue, 14 Mar 2006 09:27:31 +0100
+
+vte (1:0.12.0-0ubuntu2) dapper; urgency=low
+
+  * debian/patches/20_fix_irssi_and_screen_breakage_CVS.patch:
+    - Behdad fixed the fix harder.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Mon, 13 Mar 2006 12:51:06 +0100
+
+vte (1:0.12.0-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+    - Released with no code changes.
+  * debian/patches/20_fix_irssi_and_screen_breakage_CVS.patch:
+    - patch by Behdad Esfahbod (GNOME bug 104841) (Malone: #33739)
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Mon, 13 Mar 2006 09:59:00 +0100
+
+vte (1:0.11.21-0ubuntu1) dapper; urgency=low
+
+  * New upstream release
+     - Revert change introduced in 0.11.19 that made vte very unresponsive
+       with tall terminal windows. (bug #333776)
+     - Step up COALESCE_TIMEOUT and DISPLAY_TIMEOUT from 2ms to 10ms.
+       This is more compatible with the update timeout that we are doing
+       at 25ms, but needs testing.
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu,  9 Mar 2006 10:38:01 +0000
+
+vte (1:0.11.20-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+    - Revert patch introduced in 0.11.16 that was corrupting the Xft font 
+      cache.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Mon, 27 Feb 2006 08:20:20 +0100
+
+vte (1:0.11.19-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+    - Revert Shift+Insert to paste PRIMARY.  Use Ctrl+Shirt+Insert to
+      paste CLIPBOARD (Malone: #31354)
+    - Improvements to the update throttling handler.
+    - gnome-pty-helper minor race condition fix.
+    - Use getpwnam to correctly log multiple users with the same UID
+    - A couple minor build fixes.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Sat, 25 Feb 2006 17:25:58 +0100
+
+vte (1:0.11.18-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+  * debian/control.in:
+    - versioned Build-Dep on gtk-doc-tools.
+  * debian/patches/07_remove_doublefree.patch:
+    - dropped, included upstream.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Mon, 13 Feb 2006 09:11:57 +0100
+
+vte (1:0.11.17-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+     - Revert .pc changes from previous release (Olav Vitters)
+     - Fix bug #170032 - gnome-terminal has problems with ANSI
+       (save and restore cursor position) (Olav Vitters)
+     - Fix bug #321909 – vte does not install devhelp file
+       (Guilherme de S. Pastore)
+     - Apply patch from Kjartan Maraas to replace g_return* with
+       g_assert in static functions (Guilherme de S. Pastore)
+     - Avoid guessing the user's shell until we make sure it is
+       really necessary (Guilherme de S. Pastore)
+     - Disable asserts by default (Guilherme de S. Pastore)
+  * debian/patches/05_cursor_position.patch:
+    debian/patches/93_revert_libs.private.patch:
+   - removed, by upstream
+  
+  
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 30 Jan 2006 17:16:22 +0000
+
+vte (1:0.11.16-0ubuntu5) dapper; urgency=low
+
+  * debian/patches/91_keep_fds.patch,
+     92_python_reaper.patch:
+    - readded, got dropped earlier
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 13 Jan 2006 10:10:11 +0100
+
+vte (1:0.11.16-0ubuntu4) dapper; urgency=low
+
+  * Resynchronized with Debian (Ubuntu: #20716).
+  * Only changes towards Debian:
+    - debian/patches/20_gdk-warning.patch,
+      debian/patches/30_pkg-config-private-fields.patch:
+      - removed.
+    - debian/patches/93_revert_libs.private.patch
+      - added.
+    - debian/rules:
+      - removed python/vte.c removal.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Wed, 11 Jan 2006 20:35:38 +0100
+
+vte (1:0.11.16-0ubuntu3) dapper; urgency=low
+
+  * debian/patches/93_revert_libs.private.patch:
+    + Don't move needed libs to the private fields of the .pc file
+      Fixes Gnome BTS #322240 and Gtk#, patch from CVS
+
+ -- Sebastian Dröge <slomo@ubuntu.com>  Sat,  7 Jan 2006 02:48:49 +0100
+
+vte (1:0.11.16-0ubuntu2) dapper; urgency=low
+
+  * Rebuild to propagate libxft's change to not ship libXft.la anymore.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Fri,  6 Jan 2006 19:56:28 +0100
+
+vte (1:0.11.16-0ubuntu1) dapper; urgency=low
+
+  * New upstream release:
+    - Optimize memory used for fonts (Mike Hearn)
+    - Fix crasher with accessibility (Padraig O'Briain)
+    - Fix some warning from GDK (Michele Baldessari)
+    - Fix python build problems (Manish Sing)
+    - Fix generation of the forkpty() method for python. (Michael Vogt)
+    - Cleanups for the .pc file (Steve Langasek)
+    - Don't emit signals for every character of output. Huge performance
+      improvement with a11y enabled. Patch from Padraig O'Briain.
+  * debian/rules:
+    - removal of python/vte.c doesn't seem necessary.
+  * debian/patches/20_gdk-warning.patch,
+    debian/patches/91_python_forkpty.patch:
+    - dropped, done upstream.
+
+ -- Daniel Holbach <daniel.holbach@ubuntu.com>  Tue, 13 Dec 2005 18:08:41 +0100
+
+vte (1:0.11.15-4) unstable; urgency=low
+
+  * Build-depend on libfreetype6-dev (>= 2.0.2) to match the checks in
+    configure.in. (Closes: #340412)
+    [debian/control, debian/control.in]
+  * Use pkg-config's Libs.private and Requires.private field for libraries and
+    packages needed only for static linking instead of the Libs / Requires
+    fields; you need to build-depend on pkg-config (>= 0.18) to use these
+    fields.  Based on a patch by Steve Langasek.  (Closes: #340406)
+    [debian/patches/30_pkg-config-private-fields.patch]
+
+ -- Loic Minier <lool@dooz.org>  Wed, 23 Nov 2005 15:23:11 +0100
+
+vte (1:0.11.15-3) unstable; urgency=high
+
+  * Force regeneration of the python bindings by removing python/vte.c.
+    (Closes: #334001, #334668, #338090)
+    [debian/rules]
+
+ -- Loic Minier <lool@dooz.org>  Tue,  8 Nov 2005 22:38:50 +0100
+
+vte (1:0.11.15-2) unstable; urgency=high
+
+  * Urgency high for RC bug fix.
+  * Add libsm-dev, libice-dev, zlib1g-dev, libncurses5-dev | libncurses-dev,
+    libx11-dev, and libfontconfig1-dev deps to vte-dev, according to its .pc
+    file. (Closes: #259671) [debian/control, debian/control.in]
+
+ -- Loic Minier <lool@dooz.org>  Sun, 16 Oct 2005 22:21:33 +0200
+
+vte (1:0.11.15-1) unstable; urgency=low
+
+  [ Sebastien Bacher ]
+  * debian/control.in:
+    - use ${python:Depends}.
+  * debian/python-vte.install:
+    - don't use a specific python version.
+  * debian/rules:
+    - use dh_python.
+
+  [ Loic Minier ]
+  * New upstream releases.
+    - Fix confusion between py_palette and item in
+      _wrap_vte_terminal_set_colors(), doesn't segfault anymore in
+      vte.Terminal.set_colors(). (Closes: #319987)
+  * Add CDBS' utils.
+  * Drop obsolete patches. [debian/patches/02_path_xtra.patch,
+    debian/patches/03_path_xtra-2.patch,
+    debian/patches/11_hide_pageup_behavior.patch]
+  * Temporarily add libxt-dev build-dependency to let
+    AC_PATH_X/AC_PATH_XTRA autodetect X development files, see
+    <http://bugzilla.gnome.org/show_bug.cgi?id=314669>.
+  * Update FSF address. [debian/copyright]
+
+ -- Loic Minier <lool@dooz.org>  Sun, 11 Sep 2005 16:03:32 +0200
+
+vte (1:0.11.13-4) unstable; urgency=high
+
+  * Urgency high for testing targetted RC bugfix.
+  * Add dependencies to libvte-dev on libxft-dev, libfreetype6-dev,
+    libatk1.0-dev, libpango1.0-dev, libglib2.0-dev to conform with libvte.la's
+    dependency_libs. [debian/control, debian/control.in] (Closes: #259671)
+
+ -- Loic Minier <lool@dooz.org>  Sun, 31 Jul 2005 16:01:15 +0200
+
+vte (1:0.11.13-3) unstable; urgency=low
+
+  * Fix Gdk warnings with a patch from upstream. (Closes: #316940, #318549)
+    [debian/patches/20_gdk-warning.patch]
+  * Bump up Standards Version to 3.6.2.
+
+ -- Loic Minier <lool@dooz.org>  Thu, 21 Jul 2005 20:01:23 +0200
+
+vte (1:0.11.13-2) unstable; urgency=low
+
+  * Rebuild on an unstable box to avoid dependencies in experimental.
+
+ -- Josselin Mouette <joss@debian.org>  Sat, 30 Apr 2005 19:07:20 +0200
+
+vte (1:0.11.13-1) unstable; urgency=low
+
+  * New upstream version
+  * Added a new package that contains the documentation (Closes: #300742)
+  * debian/patches:
+    - 01_vtemodule.patch: applied
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Tue, 19 Apr 2005 23:05:02 +0200
+
+vte (1:0.11.12-1) unstable; urgency=low
+
+  * New upstream version. Lots of patches in Gnome's bugzilla have been
+    applied. 
+  * debian/patches : 
+    - Merged patches : 
+        05_performance_boost.patch
+        10_redraw_vte_screen.patch  
+        12_fix_display_corrption_in_utf8.patch
+    - Splitted 02_path_xtra.patch into to patches : 
+        02_path_xtra.patch contains the configure.in patch
+        03_path_xtra-2.patch contains the configure patch
+    - Updated 07_remove_doublefree.patch as it's partially applied
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Thu,  3 Mar 2005 23:54:07 +0100
+
+vte (1:0.11.11-6) unstable; urgency=low
+
+  * Added patches from Emil Soleyman-Zomalan <emil@nishra.com>.
+  * debian/patches:
+    - Balanced performance improvement (Closes: #197797)
+        05_performance_boost.patch
+        http://bugs.gnome.org/show_bug.cgi?id=143914
+    - Resolve double free problem
+        07_remove_doublefree.patch
+        http://bugs.gnome.org/show_bug.cgi?id=161337
+    - Set backspace behavior to utf8 (depends on utf8 locale)
+        08_set_backspace_to_utf8.patch
+        http://bugs.gnome.org/show_bug.cgi?id=158200
+    - Make vte multi-screen safe
+        09_multiscreen_safe.patch
+        http://bugs.gnome.org/show_bug.cgi?id=160782
+    - Redraw vte screen with correct background color
+        10_redraw_vte_screen.patch
+        http://bugs.gnome.org/show_bug.cgi?id=125364
+    - Hide manifestation of PageUp behavior with less (Closes: #285143)
+        11_hide_pageup_behavior.patch
+        http://bugzilla.gnome.org/show_bug.cgi?id=115149
+    - Fix utf8 display cooruption (Closes: #276316)
+        12_fix_display_corrption_in_utf8.patch
+        http://bugzilla.gnome.org/show_bug.cgi?id=154896
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Wed, 22 Dec 2004 01:32:58 +0100
+
+vte (1:0.11.11-5) unstable; urgency=low
+
+  * debian/patches:
+    - Relibtoolized 02_path_xtra.patch (Closes: #259671)
+    - Added an updated patch from http://bugs.gnome.org/show_bug.cgi?id=142640
+    to display correctly fonts (Closes: #251355)
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Thu, 12 Aug 2004 14:00:51 +0200
+
+vte (1:0.11.11-4) unstable; urgency=low
+
+  * GNOME team upload.
+  * debian/rules: add epoch to shlib declaration (closes: #253120).
+
+ -- Jordi Mallach <jordi@debian.org>  Sun, 20 Jun 2004 17:24:12 +0200
+
+vte (1:0.11.11-3) unstable; urgency=low
+
+  * Gnome Team Upload.
+  * debian/rules:
+    + shlibs version =  0.11.11.
+
+ -- Sebastien Bacher <seb128@debian.org>  Tue,  8 Jun 2004 00:55:25 +0200
+
+vte (1:0.11.11-2) unstable; urgency=low
+
+  * GNOME Team Upload.
+  * Upload in unstable.
+
+ -- Sebastien Bacher <seb128@debian.org>  Thu, 27 May 2004 00:15:35 +0200
+
+vte (1:0.11.11-1) experimental; urgency=low
+
+  * New upstream version
+    - Removes all former patches, as they're no more needed
+    - Add a patch for correcting init_vte typos.
+    - This version add more documentation in python-vte module (Closes: #225296)
+    - New build dependency on gtk-doc-tools
+  * Added a patch for using AC_PATH_XTRA with Debian's enhancements.
+  * Added a patch for supporting some save/restore cursor position console
+    sequences (Closes: 248896)
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Sun,  2 May 2004 22:37:25 +0200
+
+vte (1:0.11.10-8) unstable; urgency=low
+
+  * debian/patches:
+    - Added a patch to support the vte_terminal_fork_pty call coming from
+    upstream cvs (Closes: #241485)
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Sun, 18 Apr 2004 14:18:56 +0200
+
+vte (1:0.11.10-7) unstable; urgency=low
+
+  * The gnome-pty-helper didn't have the right permissions, so it couldn't
+  update the utmp files. (Closes: #240279)
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Tue, 30 Mar 2004 01:15:47 +0200
+
+vte (1:0.11.10-6) unstable; urgency=low
+
+  * Fixed build-dependencies (Closes: #238470)
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Wed, 17 Mar 2004 19:25:26 +0100
+
+vte (1:0.11.10-5) unstable; urgency=low
+
+  * New maintainer (Closes: #234970)
+  * Switched from debhelper to cdbs for the packaging
+
+ -- Arnaud Patard <arnaud.patard@rtp-net.org>  Sun, 29 Feb 2004 19:41:29 +0100
+
+vte (1:0.11.10-4) unstable; urgency=low
+
+  * This package suck more and more, slow, broken and upstream don't care,
+    thus orpahned.
+
+ -- Christian Marillat <marillat@debian.org>  Thu, 26 Feb 2004 21:48:39 +0100
+
+vte (1:0.11.10-3) unstable; urgency=low
+
+  * New patch 02_link.dpatch to fix broken linkage (Closes: #220108)
+
+ -- Christian Marillat <marillat@debian.org>  Sun, 30 Nov 2003 17:21:07 +0100
+
+vte (1:0.11.10-2) unstable; urgency=low
+
+  * Add patch for less artifacts (Closes: #218399)
+  * NMU aren't walcome when I've tagged this bug pending two days ago. Don't
+    touch my packages.
+
+ -- Christian Marillat <marillat@debian.org>  Mon,  3 Nov 2003 19:13:10 +0100
+
+vte (1:0.11.10-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Sun, 19 Oct 2003 11:32:07 +0200
+
+vte (1:0.10.29-6) unstable; urgency=low
+
+  * Re-apply cursor blinking patch (Closes: #186764, #211818)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 30 Sep 2003 22:50:18 +0200
+
+vte (1:0.10.29-5) unstable; urgency=low
+
+  * Add libxrender-dev in Builde-Depends and Depends for the -dev package (Closes: #208533)
+
+ -- Christian Marillat <marillat@debian.org>  Wed,  3 Sep 2003 18:19:51 +0200
+
+vte (1:0.10.29-4) unstable; urgency=low
+
+  * Fix python dependencies in python-vte (Closes: #206285)
+  * New patch to fix a bug with the blinking (Closes: #186764)
+
+ -- Christian Marillat <marillat@debian.org>  Wed, 20 Aug 2003 16:29:34 +0200
+
+vte (1:0.10.29-3) unstable; urgency=low
+
+  * debian/control Add python-gtk2-dev in build-depends
+  * python package need to depends on a versioned python-gtk2 (>= 1.99.17-2)
+  * Revert bug introduced in 0.10.28 about scrolling page (Closes: #190651, #203049)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 19 Aug 2003 20:43:43 +0200
+
+vte (1:0.10.29-2) unstable; urgency=low
+
+  * debian/rules remove an old  CC=gcc-3.2 (Closes: #196911)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 10 Jun 2003 20:33:06 +0200
+
+vte (1:0.10.29-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Mon,  9 Jun 2003 22:26:53 +0200
+
+vte (1:0.10.28-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 13 May 2003 09:07:26 +0200
+
+vte (1:0.10.27-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fix fonts size (Closes: #186705)
+
+ -- Christian Marillat <marillat@debian.org>  Mon,  5 May 2003 13:13:52 +0200
+
+vte (0.11.0-2) unstable; urgency=low
+
+  * Update section
+  * Fix crash on exit (Closes: #186593)
+
+ -- Christian Marillat <marillat@debian.org>  Fri,  4 Apr 2003 12:49:57 +0200
+
+vte (0.11.0-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Wed, 26 Mar 2003 21:26:39 +0100
+
+vte (0.10.26-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fix text wrapping (Closes: #183337)
+
+ -- Christian Marillat <marillat@debian.org>  Tue,  4 Mar 2003 21:09:31 +0100
+
+vte (0.10.25-1) unstable; urgency=low
+
+  * new upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 25 Feb 2003 01:39:37 +0100
+
+vte (0.10.23-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Fri, 21 Feb 2003 20:56:58 +0100
+
+vte (0.10.22-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fix tab focus (Closes: #180370)
+
+ -- Christian Marillat <marillat@debian.org>  Thu, 20 Feb 2003 10:17:29 +0100
+
+vte (0.10.20-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Sat, 15 Feb 2003 02:00:29 +0100
+
+vte (0.10.19-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Thu, 13 Feb 2003 10:42:34 +0100
+
+vte (0.10.17-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Mon,  3 Feb 2003 15:56:24 +0100
+
+vte (0.10.16-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Fri, 31 Jan 2003 18:06:35 +0100
+
+vte (0.10.15-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fix vim and scroll mouse (Closes: #176952)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 28 Jan 2003 10:47:06 +0100
+
+vte (0.10.14-1) unstable; urgency=low
+
+  * New upstream release.
+  * Workaround to fix undocumented xttitle escape sequence (Closes: #178066)
+  * Fix shift+arrows keys (Closes: #177745)
+  * Fix DEC graphics characters (Closes: #177977)
+
+ -- Christian Marillat <marillat@debian.org>  Fri, 24 Jan 2003 12:24:18 +0100
+
+vte (0.10.12-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Mon, 20 Jan 2003 22:54:23 +0100
+
+vte (0.10.11-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Sat, 18 Jan 2003 15:57:33 +0100
+
+vte (0.10.10-2) unstable; urgency=low
+
+  * -dev package should depends on libncurses5-dev (Closes: #176684)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 14 Jan 2003 16:52:06 +0100
+
+vte (0.10.10-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 14 Jan 2003 12:13:00 +0100
+
+vte (0.10.8-1) unstable; urgency=low
+
+  * New upstream release.
+  * Build against libxft2-dev
+  * Remove gcc-3.2 build-dependency
+  * Bump Standards-Version to 3.5.8
+
+ -- Christian Marillat <marillat@debian.org>  Wed,  8 Jan 2003 16:18:25 +0100
+
+vte (0.10.7-1) unstable; urgency=low
+
+  * new upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Thu, 12 Dec 2002 15:43:33 +0100
+
+vte (0.10.5-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Wed,  4 Dec 2002 13:19:25 +0100
+
+vte (0.10.4-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 12 Nov 2002 17:11:26 +0100
+
+vte (0.10.3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Mon, 11 Nov 2002 18:48:53 +0100
+
+vte (0.10.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Thu,  7 Nov 2002 16:09:09 +0100
+
+vte (0.10.1-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Christian Marillat <marillat@debian.org>  Tue,  5 Nov 2002 16:39:09 +0100
+
+vte (0.10-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bump the libray package to 4
+
+ -- Christian Marillat <marillat@debian.org>  Thu, 31 Oct 2002 19:58:18 +0100
+
+vte (0.9.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fix build with the python module (Closes: #164440)
+
+ -- Christian Marillat <marillat@debian.org>  Tue, 22 Oct 2002 16:15:17 +0200
+
+vte (0.9.0-2) unstable; urgency=low
+
+  * Should build-depends on gettext (Closes: #163611)
+
+ -- Christian Marillat <marillat@debian.org>  Mon,  7 Oct 2002 09:13:35 +0200
+
+vte (0.9.0-1) unstable; urgency=low
+
+  * New upstream releae.
+  * Add build-dependency to python-gtk2 and python-dev
+  * Add a python-vte package (Closes: #158588)
+  * Bump the libray package to 3
+  * Move I18N file in the -common package
+
+ -- Christian Marillat <marillat@debian.org>  Sat,  5 Oct 2002 10:38:12 +0200
+
+vte (0.5.1-2) unstable; urgency=low
+
+  * Build with gcc-3.2
+  * Update to standards version 3.5.7
+
+ -- Christian Marillat <marillat@debian.org>  Fri, 13 Sep 2002 21:38:02 +0200
+
+vte (0.5.1-1) unstable; urgency=low
+
+  * Initial Release (Closes: #153740)
+
+ -- Christian Marillat <marillat@debian.org>  Sun, 21 Jul 2002 16:30:57 +0200
+
--- vte-0.12.1.orig/debian/libvte4.install
+++ vte-0.12.1/debian/libvte4.install
@@ -0,0 +1,3 @@
+debian/tmp/usr/lib/libvte.so.*
+debian/tmp/usr/lib/vte/* usr/lib/libvte4/
+debian/tmp/usr/lib/libvte4/*
--- vte-0.12.1.orig/debian/libvte-common.install
+++ vte-0.12.1/debian/libvte-common.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/share/locale
+debian/tmp/usr/share/vte/termcap
--- vte-0.12.1.orig/debian/compat
+++ vte-0.12.1/debian/compat
@@ -0,0 +1 @@
+4
--- vte-0.12.1.orig/debian/python-vte.install
+++ vte-0.12.1/debian/python-vte.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/python*/site-packages
--- vte-0.12.1.orig/debian/libvte-dev.install
+++ vte-0.12.1/debian/libvte-dev.install
@@ -0,0 +1,5 @@
+debian/tmp/usr/include
+debian/tmp/usr/lib/pkgconfig
+debian/tmp/usr/lib/libvte.a
+debian/tmp/usr/lib/libvte.la
+debian/tmp/usr/lib/libvte.so
--- vte-0.12.1.orig/debian/control.in
+++ vte-0.12.1/debian/control.in
@@ -0,0 +1,67 @@
+Source: vte
+Section: libs
+Priority: optional
+Maintainer: Arnaud Patard <arnaud.patard@rtp-net.org>
+Uploaders: @GNOME_TEAM@, Marc Dequènes <Duck@DuckCorp.org>
+Standards-Version: 3.6.2
+Build-Depends: cdbs, debhelper (>= 3.4.4), libgtk2.0-dev (>= 2.6), gettext, python-gtk2-dev, python-dev, libncurses5-dev, libxrender-dev, gnome-pkg-tools, gtk-doc-tools (>= 1.0), libxt-dev, libfreetype6-dev (>= 2.0.2), intltool
+
+Package: libvte4
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}, libvte-common (= ${Source-Version})
+Description: Terminal emulator widget for GTK+ 2.0 - runtime files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+
+Package: libvte-dev
+Architecture: any
+Section: libdevel
+Depends: libvte4 (= ${Source-Version}), libgtk2.0-dev (>= 2.6.0), libncurses5-dev, libxrender-dev, libxft-dev, libfreetype6-dev, libatk1.0-dev, libpango1.0-dev, libglib2.0-dev, libsm-dev, libice-dev, zlib1g-dev, libncurses5-dev | libncurses-dev, libx11-dev, libfontconfig1-dev
+Description: Terminal emulator widget for GTK+ 2.0 - development files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains development files for the VTE library.
+
+Package: libvte-common
+Architecture: all
+Section: libs
+Replaces: libvte2 (<= 0.5.1-2)
+Description: Terminal emulator widget for GTK+ 2.0 - common files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains internationalization files for the VTE library.
+
+Package: python-vte
+Architecture: any
+Section: python
+Depends: ${shlibs:Depends}, ${python:Depends}, python-gtk2
+Description: Python bindings for the VTE widget set
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains the bindings to use VTE in Python programs.
+
+Package: libvte-doc
+Architecture: all
+Section: doc
+Depends: 
+Description: Terminal emulator widget for GTK+ 2.0 - development files
+ The VTE library inserts terminal capability strings into a trie, and then
+ uses it to determine if data received from a pseudo-terminal is a control
+ sequence or just random data. The sample program "interpret" illustrates
+ more or less what the widget sees after it filters incoming data.
+ .
+ This package contains documentation files for the VTE library.
+
+
--- vte-0.12.1.orig/debian/patches/04_dsp_non_alias.patch
+++ vte-0.12.1/debian/patches/04_dsp_non_alias.patch
@@ -0,0 +1,12 @@
+diff -urN vte-0.11.11.orig/src/vtefc.c vte-0.11.11/src/vtefc.c
+--- vte-0.11.11.orig/src/vtefc.c	2004-05-11 09:03:59.000000000 +0000
++++ vte-0.11.11/src/vtefc.c	2004-05-11 09:05:48.000000000 +0000
+@@ -465,7 +465,7 @@
+ 			tmp = FcFontRenderPrepare(NULL,
+ 						  pattern,
+ 						  fontset->fonts[i]);
+-			_vte_fc_defaults_from_gtk(widget, tmp, antialias);
++			FcConfigSubstitute (NULL, tmp, FcMatchPattern);
+ 			_vte_fc_set_antialias(tmp, antialias);
+ 			save = FcPatternDuplicate(tmp);
+ 			FcPatternDestroy(tmp);
--- vte-0.12.1.orig/debian/patches/98_zzzad.patch
+++ vte-0.12.1/debian/patches/98_zzzad.patch
@@ -0,0 +1,4228 @@
+diff -Nur vte-0.12.1/config.h-win32 vte-0.12.1.new/config.h-win32
+--- vte-0.12.1/config.h-win32	1970-01-01 01:00:00.000000000 +0100
++++ vte-0.12.1.new/config.h-win32	2006-10-20 19:22:48.644413180 +0200
+@@ -0,0 +1,292 @@
++/* config.h.  Generated by configure.  */
++/* config.h.in.  Generated from configure.in by autoheader.  */
++
++/* The location where arch-independent package-specific data can be found. */
++#define DATADIR "/usr/local/share"
++
++/* always defined to indicate that i18n is enabled */
++/* #undef ENABLE_NLS */
++
++/* Disable deprecated GDK features. */
++/* #undef GDK_DISABLE_DEPRECATED */
++
++/* Force use of GDK's multihead-safe APIs. */
++#define GDK_MULTIHEAD_SAFE 1
++
++/* Disable deprecated gdk-pixbuf features. */
++/* #undef GDK_PIXBUF_DISABLE_DEPRECATED */
++
++/* Package translatable messages domain name. */
++#define GETTEXT_PACKAGE "vte"
++
++/* Disable deprecated GTK+ features. */
++/* #undef GTK_DISABLE_DEPRECATED */
++
++/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
++/* #undef GWINSZ_IN_SYS_IOCTL */
++
++/* Disable deprecated GLib features. */
++/* #undef G_DISABLE_DEPRECATED */
++
++/* Define to 1 if you have the `bind_textdomain_codeset' function. */
++/* #undef HAVE_BIND_TEXTDOMAIN_CODESET */
++
++/* Define to 1 if you have the `cfmakeraw' function. */
++/* #undef HAVE_CFMAKERAW */
++
++/* Define if you have curses.h and libcurses */
++#define HAVE_CURSES 1
++
++/* Define to 1 if you have the `dcgettext' function. */
++/* #undef HAVE_DCGETTEXT */
++
++/* Define to 1 if you have the declaration of `bind_textdomain_codeset', and
++   to 0 if you don't. */
++#define HAVE_DECL_BIND_TEXTDOMAIN_CODESET 0
++
++/* Define to 1 if you have the declaration of `FT_LOAD_NO_HINTING', and to 0
++   if you don't. */
++#define HAVE_DECL_FT_LOAD_NO_HINTING 1
++
++/* Define if your freetype2 build declares FT_PIXEL_MODE_GRAY. */
++#define HAVE_DECL_FT_PIXEL_MODE_GRAY 1
++
++/* Define to 1 if you have the declaration of `FT_PIXEL_MODE_GRAY2', and to 0
++   if you don't. */
++#define HAVE_DECL_FT_PIXEL_MODE_GRAY2 1
++
++/* Define to 1 if you have the declaration of `FT_PIXEL_MODE_GRAY4', and to 0
++   if you don't. */
++#define HAVE_DECL_FT_PIXEL_MODE_GRAY4 1
++
++/* Define to 1 if you have the declaration of `FT_PIXEL_MODE_LCD', and to 0 if
++   you don't. */
++#define HAVE_DECL_FT_PIXEL_MODE_LCD 1
++
++/* Define if your freetype2 build declares FT_PIXEL_MODE_MONO. */
++#define HAVE_DECL_FT_PIXEL_MODE_MONO 1
++
++/* Define to 1 if you have the declaration of `FT_RENDER_MODE_LIGHT', and to 0
++   if you don't. */
++#define HAVE_DECL_FT_RENDER_MODE_LIGHT 1
++
++/* Define if your freetype2 installation defines FT_RENDER_MODE_MONO. */
++#define HAVE_DECL_FT_RENDER_MODE_MONO 1
++
++/* Define to 1 if you have the declaration of `FT_RENDER_MODE_NORMAL', and to
++   0 if you don't. */
++#define HAVE_DECL_FT_RENDER_MODE_NORMAL 1
++
++/* Define if your freetype2 build declares ft_pixel_mode_grays. */
++#define HAVE_DECL_ft_pixel_mode_grays 1
++
++/* Define if your freetype2 build declares ft_pixel_mode_mono. */
++#define HAVE_DECL_ft_pixel_mode_mono 1
++
++/* Define if your freetype2 installation defines ft_render_mode_mono. */
++#define HAVE_DECL_ft_render_mode_mono 1
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++/* #undef HAVE_DLFCN_H */
++
++/* Define to 1 if you have the <ft2build.h> header file. */
++#define HAVE_FT2BUILD_H 1
++
++/* Define to 1 if you have the `getpgid' function. */
++/* #undef HAVE_GETPGID */
++
++/* Define to 1 if you have the `getpt' function. */
++/* #undef HAVE_GETPT */
++
++/* Define if the GNU gettext() function is already present or preinstalled. */
++/* #undef HAVE_GETTEXT */
++
++/* Whether we have GL and glX. */
++/* #undef HAVE_GL */
++
++/* Define to 1 if you have the <GL/glx.h> header file. */
++/* #undef HAVE_GL_GLX_H */
++
++/* Define to 1 if you have the `grantpt' function. */
++/* #undef HAVE_GRANTPT */
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++/* #undef HAVE_INTTYPES_H */
++
++/* Define if your <locale.h> file defines LC_MESSAGES. */
++/* #undef HAVE_LC_MESSAGES */
++
++/* Define to 1 if you have the <locale.h> header file. */
++#define HAVE_LOCALE_H 1
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define HAVE_MEMORY_H 1
++
++/* Define if you have ncurses.h and libncurses */
++/* #undef HAVE_NCURSES */
++
++/* Whether we have PangoX */
++/* #undef HAVE_PANGOX */
++
++/* Define to 1 if you have the `ptsname' function. */
++/* #undef HAVE_PTSNAME */
++
++/* Define to 1 if you have the `ptsname_r' function. */
++/* #undef HAVE_PTSNAME_R */
++
++/* Define if you have the recvmsg function. */
++/* #undef HAVE_RECVMSG */
++
++/* Define if you have the socket function. */
++/* #undef HAVE_SOCKET */
++
++/* Define if you have the socketpair function. */
++/* #undef HAVE_SOCKETPAIR */
++
++/* Define to 1 if you have the <stdint.h> header file. */
++/* #undef HAVE_STDINT_H */
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#define HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++/* #undef HAVE_STRINGS_H */
++
++/* Define to 1 if you have the <string.h> header file. */
++#define HAVE_STRING_H 1
++
++/* Define to 1 if you have the <stropts.h> header file. */
++/* #undef HAVE_STROPTS_H */
++
++/* Define to 1 if you have the <sys/select.h> header file. */
++/* #undef HAVE_SYS_SELECT_H */
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/termios.h> header file. */
++/* #undef HAVE_SYS_TERMIOS_H */
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#define HAVE_SYS_TYPES_H 1
++
++/* Define to 1 if you have the <sys/un.h> header file. */
++/* #undef HAVE_SYS_UN_H */
++
++/* Define if you have termcap.h and libtermcap */
++/* #undef HAVE_TERMCAP */
++
++/* Define to 1 if you have the <termios.h> header file. */
++/* #undef HAVE_TERMIOS_H */
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the `unlockpt' function. */
++/* #undef HAVE_UNLOCKPT */
++
++/* Define to 1 if you have the <wchar.h> header file. */
++#define HAVE_WCHAR_H 1
++
++/* Define to 1 if the system has the type `wint_t'. */
++#define HAVE_WINT_T 1
++
++/* Whether we have Xft2 */
++/* #undef HAVE_XFT2 */
++
++/* The location where package-specific helpers can be found. */
++#define LIBEXECDIR "/usr/local/libexec"
++
++/* The location where locale data can be found. */
++#define LOCALEDIR "/usr/local/share/locale"
++
++/* Package name. */
++#define PACKAGE "vte"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=vte"
++
++/* Define to the full name of this package. */
++#define PACKAGE_NAME "vte"
++
++/* Define to the full name and version of this package. */
++#define PACKAGE_STRING "vte 0.12.2"
++
++/* Define to the one symbol short name of this package. */
++#define PACKAGE_TARNAME "vte"
++
++/* Define to the version of this package. */
++#define PACKAGE_VERSION "0.12.2"
++
++/* Disable deprecated Pango features. */
++/* #undef PANGO_DISABLE_DEPRECATED */
++
++/* The location where package-specific helpers can be found. */
++#define PKGLIBDIR "/usr/local/lib/vte"
++
++/* Define to 1 if you have the ANSI C header files. */
++/* #undef STDC_HEADERS */
++
++/* Version number of package */
++#define VERSION "0.12.2"
++
++/* Enable debugging messages. */
++/* #undef VTE_DEBUG */
++
++/* The default terminal type to be emulated. */
++#define VTE_DEFAULT_EMULATION "xterm"
++
++/* A number which can never be a valid source ID. */
++#define VTE_INVALID_SOURCE -1
++
++/* Define if you intend to use gnome-pty-helper. */
++#define VTE_USE_GNOME_PTY_HELPER 1
++
++/* Maximum number of bytes used per UTF-8 character. */
++#define VTE_UTF8_BPC 6
++
++/* Define to 1 if the X Window System is missing or not being used. */
++#define X_DISPLAY_MISSING 1
++
++/* Use all glibc features. */
++/* #undef _GNU_SOURCE */
++
++/* Needed to get declarations for msg_control and msg_controllen on Solaris */
++#define _XOPEN_SOURCE 1
++
++/* Needed to get declarations for msg_control and msg_controllen on Solaris */
++#define _XOPEN_SOURCE_EXTENDED 1
++
++/* Needed to get declarations for msg_control and msg_controllen on Solaris */
++#define __EXTENSIONS__ 1
++
++/* POSIX HACK */
++#ifndef LINE_MAX
++#  define LINE_MAX 2048
++#endif
++// Windows defines the equivalent SSIZE_T in the platform SDK
++// as the signed equivalent of size_t which is defined as long
++// on WIN32 and long long/__int64 on WIN64
++#if defined (_WIN64)
++#  define ssize_t __int64
++#elif defined (_WIN32)
++#  define ssize_t long
++#endif
++#if defined (_WIN32)
++#  include <windows.h>
++#  include <winsock2.h>
++#  include <malloc.h>
++#  include <io.h>
++#  include <sys/stat.h>
++#  include <time.h>
++#  define close _close
++#  define open _open
++#  define snprintf _snprintf
++#  define sleep(x) Sleep(x * 1000)
++#endif
++
++#ifndef howmany
++# define howmany(x, y)  (((x) + ((y) - 1)) / (y))
++#endif
++
++typedef int pid_t;
+diff -Nur vte-0.12.1/python/vte.defs vte-0.12.1.new/python/vte.defs
+--- vte-0.12.1/python/vte.defs	2006-10-20 19:22:48.242484030 +0200
++++ vte-0.12.1.new/python/vte.defs	2006-10-20 19:23:13.690998113 +0200
+@@ -407,7 +407,7 @@
+ (define-method get_font
+   (of-object "VteTerminal")
+   (c-name "vte_terminal_get_font")
+-  (return-type "const-PangoFontDescription*")
++  (return-type "PangoFontDescription*")
+ )
+ 
+ (define-method get_using_xft
+@@ -702,3 +702,52 @@
+   (c-name "vte_reaper_get")
+   (return-type "VteReaper")
+ )
++
++(define-method get_state
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_get_state")
++  (return-type "const-char*")
++)
++
++(define-method get_rawtext
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_get_rawtext")
++  (return-type "const-char*")
++)
++ 
++(define-method set_sync
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_set_sync")
++  (parameters
++    '("gboolean" "sync")
++  )
++  (return-type "none")
++)
++
++(define-method set_state
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_set_state")
++  (parameters
++    '("const-guchar*" "rows")
++  )
++  (return-type "none")
++)
++
++(define-method select_by_rawtext_pos
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_select_by_rawtext_pos")
++  (return-type "none")
++  (parameters
++    '("glong"  "frompos")
++    '("glong"  "topos")
++  )
++)
++
++(define-method screenshot
++  (of-object "VteTerminal")
++  (c-name "vte_terminal_screenshot")
++  (return-type "none")
++  (parameters
++    '("GObject"  "pixmap")
++  )
++)
+diff -Nur vte-0.12.1/python/vte.override vte-0.12.1.new/python/vte.override
+--- vte-0.12.1/python/vte.override	2006-10-20 19:22:48.242484030 +0200
++++ vte-0.12.1.new/python/vte.override	2006-10-20 19:22:57.178908769 +0200
+@@ -191,7 +191,7 @@
+ 				  NULL };
+ 	PyObject *py_envv = NULL,
+ 		 *loglastlog = NULL, *logutmp = NULL, *logwtmp = NULL;
+-	int i, n_args, n_envs;
++	int i, n_envs;
+ 	pid_t pid;
+ 
+ 	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OsOOO:forkpty",
+@@ -363,7 +363,7 @@
+ 
+     if (attrs) {
+ 	py_attrs = PyTuple_New(attrs->len);
+-	for (count = 0; count < attrs->len; count++) {
++	for (count = 0; (size_t)count < attrs->len; count++) {
+ 	    VteCharAttributes *cht;
+ 	    PyObject *py_char_attr;
+ 	    PyObject *py_gdkcolor;
+@@ -460,7 +460,7 @@
+ 
+     if (attrs) {
+ 	py_attrs = PyTuple_New(attrs->len);
+-	for (count = 0; count < attrs->len; count++) {
++	for (count = 0; (size_t)count < attrs->len; count++) {
+ 	    VteCharAttributes *cht;
+ 	    PyObject *py_char_attr;
+ 	    PyObject *py_gdkcolor;
+@@ -543,7 +543,7 @@
+     static char *kwlist[] = { "column", "row", NULL };
+     gchar *ret;
+     glong column, row;
+-    int *tag;
++    int tag;
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ll:VteTerminal.match_check", kwlist, &column, &row))
+         return NULL;
+@@ -557,3 +557,40 @@
+     return Py_None;
+ }
+ %%
++override vte_terminal_get_state kwargs
++static PyObject *
++_wrap_vte_terminal_get_state(PyGObject *self)
++{
++    const gchar *ret;
++    PyObject *tmp;
++    int len = 0;
++
++    ret = vte_terminal_get_state(VTE_TERMINAL(self->obj), &len);
++    if (ret)
++    {
++        tmp = PyString_FromStringAndSize(ret, len);
++        g_free((gpointer)ret);
++        return(tmp);
++    }
++    Py_INCREF(Py_None);
++    return Py_None;
++}
++%%
++override vte_terminal_get_rawtext kwargs
++static PyObject *
++_wrap_vte_terminal_get_rawtext(PyGObject *self)
++{
++    const gchar *ret;
++    PyObject *tmp;
++    int len = 0;
++
++    ret = vte_terminal_get_rawtext(VTE_TERMINAL(self->obj), &len);
++    if (ret)
++    {
++        tmp = PyUnicode_FromUnicode((const Py_UNICODE*)ret, len/sizeof(gunichar));
++        g_free((gpointer)ret);
++        return(tmp);
++    }
++    Py_INCREF(Py_None);
++    return Py_None;
++}
+diff -Nur vte-0.12.1/src/Makefile.am vte-0.12.1.new/src/Makefile.am
+--- vte-0.12.1/src/Makefile.am	2006-10-20 19:22:41.954592000 +0200
++++ vte-0.12.1.new/src/Makefile.am	2006-10-20 19:22:48.644413180 +0200
+@@ -98,7 +98,7 @@
+ # Libtool shared library versioning stuffs.
+ # REVISION gets incremented whenever the source code changes without adding
+ # an API or ABI change.
+-VERSION_REVISION=0
++VERSION_REVISION=1
+ # CURRENT must be incremented when an API or ABI change (addition or removal)
+ # is made, and REVISION must be reset to 0 when this happens.
+ VERSION_CURRENT=9
+@@ -204,7 +204,7 @@
+ nativeecho_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DNATIVEECHO_MAIN
+ nativeecho_SOURCES = \
+ 	nativeecho.c
+-nativeecho_LDADD = @LDFLAGS@ @LIBS@
++nativeecho_LDADD = @LDFLAGS@ @LIBS@ @GLIB_LIBS@
+ 
+ ring_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DRING_MAIN
+ ring_SOURCES = \
+@@ -313,7 +313,7 @@
+ 
+ xticker_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@
+ xticker_SOURCES = xticker.c
+-xticker_LDADD = @LIBS@ @GLIB_LIBS@
++xticker_LDADD = @LDFLAGS@ @LIBS@ @GLIB_LIBS@
+ 
+ vteseq-table.h: vteseq-gen.c vteseq-list.h
+ 	$(MAKE) vteseq-gen
+diff -Nur vte-0.12.1/src/buffer.c vte-0.12.1.new/src/buffer.c
+--- vte-0.12.1/src/buffer.c	2002-12-14 01:40:53.000000000 +0100
++++ vte-0.12.1.new/src/buffer.c	2006-10-20 19:22:48.645413004 +0200
+@@ -18,7 +18,9 @@
+  *
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: buffer.c,v 1.4 2002/12/14 00:40:53 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <glib.h>
+diff -Nur vte-0.12.1/src/buffer.h vte-0.12.1.new/src/buffer.h
+--- vte-0.12.1/src/buffer.h	2002-12-14 01:40:53.000000000 +0100
++++ vte-0.12.1.new/src/buffer.h	2006-10-20 19:22:48.645413004 +0200
+@@ -23,7 +23,9 @@
+ #ifndef vte_buffer_h_included
+ #define vte_buffer_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: buffer.h,v 1.4 2002/12/14 00:40:53 nalin Exp $"
++#endif
+ 
+ #include <sys/types.h>
+ 
+diff -Nur vte-0.12.1/src/caps.c vte-0.12.1.new/src/caps.c
+--- vte-0.12.1/src/caps.c	2006-01-14 14:10:33.000000000 +0100
++++ vte-0.12.1.new/src/caps.c	2006-10-20 19:22:48.645413004 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: caps.c,v 1.24 2006/01/14 13:10:33 ovitters Exp $"
++#endif
+ #include "../config.h"
+ #include <stdlib.h>
+ #include <glib.h>
+diff -Nur vte-0.12.1/src/caps.h vte-0.12.1.new/src/caps.h
+--- vte-0.12.1/src/caps.h	2002-10-14 23:07:56.000000000 +0200
++++ vte-0.12.1.new/src/caps.h	2006-10-20 19:22:48.645413004 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_caps_h_included
+ #define vte_caps_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: caps.h,v 1.10 2002/10/14 21:07:56 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/debug.c vte-0.12.1.new/src/debug.c
+--- vte-0.12.1/src/debug.c	2006-02-03 14:27:26.000000000 +0100
++++ vte-0.12.1.new/src/debug.c	2006-10-20 19:22:48.646412828 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: debug.c,v 1.14 2006/02/03 13:27:26 behdad Exp $"
++#endif
+ #include "../config.h"
+ #include <glib.h>
+ #include <stdio.h>
+diff -Nur vte-0.12.1/src/debug.h vte-0.12.1.new/src/debug.h
+--- vte-0.12.1/src/debug.h	2006-02-03 14:27:26.000000000 +0100
++++ vte-0.12.1.new/src/debug.h	2006-10-20 19:22:48.646412828 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_debug_h_included
+ #define vte_debug_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: debug.h,v 1.16 2006/02/03 13:27:26 behdad Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/dumpkeys.c vte-0.12.1.new/src/dumpkeys.c
+--- vte-0.12.1/src/dumpkeys.c	2005-02-15 09:49:23.000000000 +0100
++++ vte-0.12.1.new/src/dumpkeys.c	2006-10-20 19:22:48.646412828 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: dumpkeys.c,v 1.8 2005/02/15 08:49:23 kmaraas Exp $"
++#endif
+ #include "../config.h"
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+diff -Nur vte-0.12.1/src/interpret.c vte-0.12.1.new/src/interpret.c
+--- vte-0.12.1/src/interpret.c	2005-03-14 15:43:47.000000000 +0100
++++ vte-0.12.1.new/src/interpret.c	2006-10-20 19:22:48.646412828 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: interpret.c,v 1.22 2005/03/14 14:43:47 kmaraas Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <assert.h>
+diff -Nur vte-0.12.1/src/iso2022.c vte-0.12.1.new/src/iso2022.c
+--- vte-0.12.1/src/iso2022.c	2006-03-15 12:02:59.000000000 +0100
++++ vte-0.12.1.new/src/iso2022.c	2006-10-20 19:22:48.647412652 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: iso2022.c,v 1.54 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <errno.h>
+@@ -862,8 +864,7 @@
+ static char *
+ _vte_iso2022_find_nextctl(const char *p, size_t length)
+ {
+-	char *ret;
+-	int i;
++	size_t i;
+ 
+ 	if (length == 0) {
+ 		return NULL;
+@@ -894,7 +895,8 @@
+ _vte_iso2022_sequence_length(const unsigned char *nextctl, gsize length)
+ {
+ 	const unsigned char *valids = NULL;
+-	long sequence_length = -1, i;
++	long sequence_length = -1;
++        gsize i;
+ 
+ 	switch (nextctl[0]) {
+ 	case '\n':
+@@ -1147,13 +1149,14 @@
+ 		       char **inbuf, gsize *inbytes,
+ 		       gunichar **outbuf, gsize *outbytes)
+ {
+-	int i, width;
++	int width;
+ 	gpointer p;
+ 	gunichar c, *outptr;
+ 	char *inptr;
+ 	gulong acc, or_mask, and_mask;
+ 	GTree *map;
+-	gint bytes_per_char, force_width, current;
++	gint force_width, current;
++        gsize i, bytes_per_char;
+ 
+ 	/* Check if it's an 8-bit escape.  If it is, take a note of which map
+ 	 * it's for, and if it isn't, fail. */
+@@ -1238,7 +1241,8 @@
+ 	gchar *inbuf, *buf;
+ 	gunichar *outbuf;
+ 	gsize inbytes, outbytes;
+-	int i, width;
++	int width;
++        gsize i;
+ 	gulong acc, or_mask, and_mask;
+ 	gunichar c;
+ 	gpointer p;
+@@ -1424,7 +1428,7 @@
+ 		GArray *gunichars)
+ {
+ 	gunichar c;
+-	int i;
++	gsize i;
+ 	if (length >= 1) {
+ 		switch (ctl[0]) {
+ 		case '\r':  /* CR */
+@@ -1721,7 +1725,7 @@
+ 	GArray *blocks;
+ 	struct _vte_iso2022_block *block = NULL;
+ 	gboolean preserve_last = FALSE;
+-	int i, initial;
++	gsize i, initial;
+ 
+ 	blocks = g_array_new(TRUE, TRUE, sizeof(struct _vte_iso2022_block));
+ 
+diff -Nur vte-0.12.1/src/iso2022.h vte-0.12.1.new/src/iso2022.h
+--- vte-0.12.1/src/iso2022.h	2003-04-18 02:14:54.000000000 +0200
++++ vte-0.12.1.new/src/iso2022.h	2006-10-20 19:22:48.647412652 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_iso2022_h_included
+ #define vte_iso2022_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: iso2022.h,v 1.12 2003/04/18 00:14:54 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ #include <glib-object.h>
+diff -Nur vte-0.12.1/src/iso8859mode.c vte-0.12.1.new/src/iso8859mode.c
+--- vte-0.12.1/src/iso8859mode.c	2003-06-27 18:27:19.000000000 +0200
++++ vte-0.12.1.new/src/iso8859mode.c	2006-10-20 19:22:48.648412475 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: iso8859mode.c,v 1.3 2003/06/27 16:27:19 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <stdio.h>
+ #define ESC "\033"
+diff -Nur vte-0.12.1/src/keymap.c vte-0.12.1.new/src/keymap.c
+--- vte-0.12.1/src/keymap.c	2006-02-02 04:43:16.000000000 +0100
++++ vte-0.12.1.new/src/keymap.c	2006-10-20 19:22:48.649412299 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: keymap.c,v 1.30 2006/02/02 03:43:16 behdad Exp $"
++#endif
+ #include "../config.h"
+ #include <stdlib.h>
+ #include <stdarg.h>
+@@ -29,6 +31,10 @@
+ #include "debug.h"
+ #include "keymap.h"
+ #include "vtetc.h"
++#ifdef _WIN32
++#undef HAVE_NCURSES
++#undef HAVE_CURSES
++#endif
+ #ifdef HAVE_NCURSES
+ #include <ncurses.h>
+ #include <term.h>
+@@ -930,7 +936,10 @@
+ 	enum _vte_cursor_mode cursor_mode;
+ 	enum _vte_keypad_mode keypad_mode;
+ 	enum _vte_fkey_mode fkey_mode;
+-	char *cap, *tmp;
++	char *cap;
++#if defined(HAVE_CURSES) || defined(HAVE_TERMCAP)
++	char *tmp;
++#endif
+ 	const char *termcap_special = NULL;
+ #if defined(HAVE_CURSES) || defined(HAVE_TERMCAP)
+ 	char ncurses_buffer[4096];
+@@ -1384,7 +1393,7 @@
+ 			/* Stuff a semicolon and the modifier in right before
+ 			 * that last character. */
+ 			nnormal[offset + 2] = nnormal[offset];
+-			nnormal[offset + 1] = modifier + '0';
++			nnormal[offset + 1] = (char)(modifier + '0');
+ 			nnormal[offset + 0] = ';';
+ 			*normal_length += 2;
+ 		} else {
+@@ -1400,7 +1409,7 @@
+ 			/* Stuff the modifier in right before that last
+ 			 * character, matching what people expect. */
+ 			nnormal[offset + 1] = nnormal[offset];
+-			nnormal[offset + 0] = modifier + '0';
++			nnormal[offset + 0] = (char)(modifier + '0');
+ 			*normal_length += 1;
+ #endif
+ 		}
+diff -Nur vte-0.12.1/src/keymap.h vte-0.12.1.new/src/keymap.h
+--- vte-0.12.1/src/keymap.h	2003-05-19 22:18:45.000000000 +0200
++++ vte-0.12.1.new/src/keymap.h	2006-10-20 19:22:48.649412299 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_keymap_h_included
+ #define vte_keymap_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: keymap.h,v 1.6 2003/05/19 20:18:45 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ #include <gdk/gdk.h>
+diff -Nur vte-0.12.1/src/libvte.def vte-0.12.1.new/src/libvte.def
+--- vte-0.12.1/src/libvte.def	1970-01-01 01:00:00.000000000 +0100
++++ vte-0.12.1.new/src/libvte.def	2006-10-20 19:22:48.649412299 +0200
+@@ -0,0 +1,258 @@
++LIBRARY LIBVTE
++
++EXPORTS
++_vte_buffer_append
++_vte_buffer_append_buffer
++_vte_buffer_append_buffer_contents
++_vte_buffer_append_gstring
++_vte_buffer_append_guint16
++_vte_buffer_append_guint32
++_vte_buffer_clear
++_vte_buffer_consume
++_vte_buffer_free
++_vte_buffer_length
++_vte_buffer_new
++_vte_buffer_new_with_data
++_vte_buffer_peek_buffer
++_vte_buffer_peek_gstring
++_vte_buffer_peek_guint16
++_vte_buffer_peek_guint32
++_vte_buffer_prepend
++_vte_buffer_read_buffer
++_vte_buffer_read_gstring
++_vte_buffer_read_guint16
++_vte_buffer_read_guint32
++_vte_buffer_set_minimum_size
++_vte_capability_init
++_vte_conv
++_vte_conv_close
++_vte_conv_cu
++_vte_conv_open
++_vte_conv_uc
++_vte_conv_uu
++_vte_debug_on
++_vte_debug_parse_string
++_vte_draw_char
++_vte_draw_clear
++_vte_draw_draw_rectangle
++_vte_draw_end
++_vte_draw_fill_rectangle
++_vte_draw_free
++_vte_draw_get_char_width
++_vte_draw_get_colormap
++_vte_draw_get_text_ascent
++_vte_draw_get_text_height
++_vte_draw_get_text_width
++_vte_draw_get_using_fontconfig
++_vte_draw_get_visual
++_vte_draw_new
++_vte_draw_requires_repaint
++_vte_draw_set_background_color
++_vte_draw_set_background_image
++_vte_draw_set_scroll
++_vte_draw_set_text_font
++_vte_draw_start
++_vte_draw_text
++_vte_fc_connect_settings_changes
++_vte_fc_connect_settings_changes
++_vte_fc_disconnect_settings_changes
++_vte_fc_patterns_from_pango_font_desc
++_vte_glyph_cache_free
++_vte_glyph_cache_has_char
++_vte_glyph_cache_new
++_vte_glyph_cache_set_font_description
++_vte_glyph_draw
++_vte_glyph_draw_string
++_vte_glyph_free
++_vte_glyph_get
++_vte_glyph_get_uncached
++_vte_invalidate_all
++_vte_invalidate_cells
++_vte_invalidate_cursor_once
++_vte_iso2022_get_encoded_width
++_vte_iso2022_process
++_vte_iso2022_process_single
++_vte_iso2022_state_free
++_vte_iso2022_state_get_codeset
++_vte_iso2022_state_new
++_vte_iso2022_state_set_codeset
++_vte_iso2022_unichar_width
++_vte_keymap_key_add_key_modifiers
++_vte_keymap_key_is_modifier
++_vte_keymap_map
++_vte_marshal_VOID__INT_INT
++_vte_marshal_VOID__OBJECT_OBJECT
++_vte_marshal_VOID__STRING_UINT
++_vte_marshal_VOID__UINT_UINT
++_vte_matcher_free
++_vte_matcher_free_params_array
++_vte_matcher_match
++_vte_matcher_new
++_vte_matcher_print
++_vte_new_row_data
++_vte_new_row_data_sized
++_vte_rdb_get_antialias
++_vte_rdb_get_dpi
++_vte_rdb_get_hinting
++_vte_rdb_get_hintstyle
++_vte_rdb_get_rgba
++_vte_regex_compile
++_vte_regex_exec
++_vte_regex_free
++_vte_rgb_buffer_clear
++_vte_rgb_buffer_free
++_vte_rgb_buffer_new
++_vte_rgb_buffer_resize
++_vte_rgb_draw_color
++_vte_rgb_draw_color_rgb
++_vte_rgb_draw_on_drawable
++_vte_rgb_draw_pixbuf
++_vte_ring_append
++_vte_ring_free
++_vte_ring_insert
++_vte_ring_insert_preserve
++_vte_ring_new
++_vte_ring_new_with_delta
++_vte_ring_remove
++_vte_sequence_get_handler
++_vte_sequence_handler_bl
++_vte_sequence_handler_sf
++_vte_table_add
++_vte_table_free
++_vte_table_match
++_vte_table_new
++_vte_table_print
++_vte_termcap_find_boolean
++_vte_termcap_find_numeric
++_vte_termcap_find_string
++_vte_termcap_find_string_length
++_vte_termcap_free
++_vte_termcap_new
++_vte_termcap_strip
++_vte_terminal_accessible_ref
++_vte_terminal_adjust_adjustments
++_vte_terminal_clear_tabstop
++_vte_terminal_emit_contents_changed
++_vte_terminal_emit_status_line_changed
++_vte_terminal_emit_text_deleted
++_vte_terminal_emit_text_inserted
++_vte_terminal_ensure_cursor
++_vte_terminal_get_end_selection
++_vte_terminal_get_selection
++_vte_terminal_get_start_selection
++_vte_terminal_get_tabstop
++_vte_terminal_insert_char
++_vte_terminal_match_contents_clear
++_vte_terminal_remove_selection
++_vte_terminal_scroll_region
++_vte_terminal_select_text
++_vte_terminal_set_default_attributes
++_vte_terminal_set_pointer_visible
++_vte_terminal_set_tabstop
++_vte_terminal_update_insert_delta
++_vte_tree_destroy
++_vte_tree_insert
++_vte_tree_lookup
++_vte_tree_new
++_vte_trie_add
++_vte_trie_free
++_vte_trie_match
++_vte_trie_new
++_vte_trie_print
++vte_bg_get_for_screen
++vte_bg_get_pixbuf
++vte_bg_get_pixmap
++vte_bg_get_type
++vte_terminal_accessible_factory_get_type
++vte_terminal_accessible_factory_new
++vte_terminal_accessible_get_type
++vte_terminal_accessible_new
++vte_terminal_anti_alias_get_type
++vte_terminal_copy_clipboard
++vte_terminal_copy_primary
++vte_terminal_erase_binding_get_type
++vte_terminal_feed
++vte_terminal_feed_child
++vte_terminal_feed_child_binary
++vte_terminal_fork_command
++vte_terminal_forkpty
++vte_terminal_get_adjustment
++vte_terminal_get_allow_bold
++vte_terminal_get_audible_bell
++vte_terminal_get_char_ascent
++vte_terminal_get_char_descent
++vte_terminal_get_char_height
++vte_terminal_get_char_width
++vte_terminal_get_column_count
++vte_terminal_get_cursor_position
++vte_terminal_get_default_emulation
++vte_terminal_get_emulation
++vte_terminal_get_encoding
++vte_terminal_get_font
++vte_terminal_get_has_selection
++vte_terminal_get_icon_title
++vte_terminal_get_mouse_autohide
++vte_terminal_get_padding
++vte_terminal_get_rawtext
++vte_terminal_get_row_count
++vte_terminal_get_state
++vte_terminal_get_status_line
++vte_terminal_get_text
++vte_terminal_get_text_include_trailing_spaces
++vte_terminal_get_text_range
++vte_terminal_get_type
++vte_terminal_get_using_xft
++vte_terminal_get_visible_bell
++vte_terminal_get_window_title
++vte_terminal_im_append_menuitems
++vte_terminal_is_word_char
++vte_terminal_match_add
++vte_terminal_match_check
++vte_terminal_match_clear_all
++vte_terminal_match_remove
++vte_terminal_match_set_cursor
++vte_terminal_match_set_cursor_type
++vte_terminal_new
++vte_terminal_paste_clipboard
++vte_terminal_paste_primary
++vte_terminal_reset
++vte_terminal_screenshot
++vte_terminal_set_allow_bold
++vte_terminal_set_audible_bell
++vte_terminal_set_background_image
++vte_terminal_set_background_image_file
++vte_terminal_set_background_saturation
++vte_terminal_set_background_tint_color
++vte_terminal_set_background_transparent
++vte_terminal_set_backspace_binding
++vte_terminal_set_color_background
++vte_terminal_set_color_bold
++vte_terminal_set_color_cursor
++vte_terminal_set_color_dim
++vte_terminal_set_color_foreground
++vte_terminal_set_color_highlight
++vte_terminal_set_colors
++vte_terminal_set_cursor_blinks
++vte_terminal_set_default_colors
++vte_terminal_set_delete_binding
++vte_terminal_set_emulation
++vte_terminal_set_encoding
++vte_terminal_set_font
++vte_terminal_set_font_from_string
++vte_terminal_set_font_from_string_full
++vte_terminal_set_font_full
++vte_terminal_set_mouse_autohide
++vte_terminal_set_pty
++vte_terminal_set_scroll_background
++vte_terminal_set_scroll_on_keystroke
++vte_terminal_set_scroll_on_output
++vte_terminal_set_scrollback_lines
++vte_terminal_set_size
++vte_terminal_set_state
++vte_terminal_set_visible_bell
++vte_terminal_set_word_chars
++vte_terminal_set_sync
++vte_terminal_select_by_rawtext_pos
++vte_reaper_get_type
++vte_reaper_get
++
+diff -Nur vte-0.12.1/src/marshal.c vte-0.12.1.new/src/marshal.c
+--- vte-0.12.1/src/marshal.c	2006-03-31 02:34:48.000000000 +0200
++++ vte-0.12.1.new/src/marshal.c	1970-01-01 01:00:00.000000000 +0100
+@@ -1,203 +0,0 @@
+-
+-#include	<glib-object.h>
+-
+-
+-#ifdef G_ENABLE_DEBUG
+-#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
+-#define g_marshal_value_peek_char(v)     g_value_get_char (v)
+-#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
+-#define g_marshal_value_peek_int(v)      g_value_get_int (v)
+-#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
+-#define g_marshal_value_peek_long(v)     g_value_get_long (v)
+-#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
+-#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
+-#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
+-#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
+-#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
+-#define g_marshal_value_peek_float(v)    g_value_get_float (v)
+-#define g_marshal_value_peek_double(v)   g_value_get_double (v)
+-#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
+-#define g_marshal_value_peek_param(v)    g_value_get_param (v)
+-#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
+-#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
+-#define g_marshal_value_peek_object(v)   g_value_get_object (v)
+-#else /* !G_ENABLE_DEBUG */
+-/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+- *          Do not access GValues directly in your code. Instead, use the
+- *          g_value_get_*() functions
+- */
+-#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
+-#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
+-#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
+-#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
+-#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
+-#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
+-#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
+-#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
+-#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
+-#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
+-#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
+-#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
+-#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
+-#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
+-#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
+-#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
+-#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
+-#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
+-#endif /* !G_ENABLE_DEBUG */
+-
+-
+-/* VOID:VOID (marshal.list:1) */
+-
+-/* VOID:STRING (marshal.list:2) */
+-
+-/* VOID:STRING,UINT (marshal.list:3) */
+-void
+-_vte_marshal_VOID__STRING_UINT (GClosure     *closure,
+-                                GValue       *return_value,
+-                                guint         n_param_values,
+-                                const GValue *param_values,
+-                                gpointer      invocation_hint,
+-                                gpointer      marshal_data)
+-{
+-  typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer     data1,
+-                                                  gpointer     arg_1,
+-                                                  guint        arg_2,
+-                                                  gpointer     data2);
+-  register GMarshalFunc_VOID__STRING_UINT callback;
+-  register GCClosure *cc = (GCClosure*) closure;
+-  register gpointer data1, data2;
+-
+-  g_return_if_fail (n_param_values == 3);
+-
+-  if (G_CCLOSURE_SWAP_DATA (closure))
+-    {
+-      data1 = closure->data;
+-      data2 = g_value_peek_pointer (param_values + 0);
+-    }
+-  else
+-    {
+-      data1 = g_value_peek_pointer (param_values + 0);
+-      data2 = closure->data;
+-    }
+-  callback = (GMarshalFunc_VOID__STRING_UINT) (marshal_data ? marshal_data : cc->callback);
+-
+-  callback (data1,
+-            g_marshal_value_peek_string (param_values + 1),
+-            g_marshal_value_peek_uint (param_values + 2),
+-            data2);
+-}
+-
+-/* VOID:INT (marshal.list:4) */
+-
+-/* VOID:INT,INT (marshal.list:5) */
+-void
+-_vte_marshal_VOID__INT_INT (GClosure     *closure,
+-                            GValue       *return_value,
+-                            guint         n_param_values,
+-                            const GValue *param_values,
+-                            gpointer      invocation_hint,
+-                            gpointer      marshal_data)
+-{
+-  typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer     data1,
+-                                              gint         arg_1,
+-                                              gint         arg_2,
+-                                              gpointer     data2);
+-  register GMarshalFunc_VOID__INT_INT callback;
+-  register GCClosure *cc = (GCClosure*) closure;
+-  register gpointer data1, data2;
+-
+-  g_return_if_fail (n_param_values == 3);
+-
+-  if (G_CCLOSURE_SWAP_DATA (closure))
+-    {
+-      data1 = closure->data;
+-      data2 = g_value_peek_pointer (param_values + 0);
+-    }
+-  else
+-    {
+-      data1 = g_value_peek_pointer (param_values + 0);
+-      data2 = closure->data;
+-    }
+-  callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback);
+-
+-  callback (data1,
+-            g_marshal_value_peek_int (param_values + 1),
+-            g_marshal_value_peek_int (param_values + 2),
+-            data2);
+-}
+-
+-/* VOID:UINT,UINT (marshal.list:6) */
+-void
+-_vte_marshal_VOID__UINT_UINT (GClosure     *closure,
+-                              GValue       *return_value,
+-                              guint         n_param_values,
+-                              const GValue *param_values,
+-                              gpointer      invocation_hint,
+-                              gpointer      marshal_data)
+-{
+-  typedef void (*GMarshalFunc_VOID__UINT_UINT) (gpointer     data1,
+-                                                guint        arg_1,
+-                                                guint        arg_2,
+-                                                gpointer     data2);
+-  register GMarshalFunc_VOID__UINT_UINT callback;
+-  register GCClosure *cc = (GCClosure*) closure;
+-  register gpointer data1, data2;
+-
+-  g_return_if_fail (n_param_values == 3);
+-
+-  if (G_CCLOSURE_SWAP_DATA (closure))
+-    {
+-      data1 = closure->data;
+-      data2 = g_value_peek_pointer (param_values + 0);
+-    }
+-  else
+-    {
+-      data1 = g_value_peek_pointer (param_values + 0);
+-      data2 = closure->data;
+-    }
+-  callback = (GMarshalFunc_VOID__UINT_UINT) (marshal_data ? marshal_data : cc->callback);
+-
+-  callback (data1,
+-            g_marshal_value_peek_uint (param_values + 1),
+-            g_marshal_value_peek_uint (param_values + 2),
+-            data2);
+-}
+-
+-/* VOID:OBJECT,OBJECT (marshal.list:7) */
+-void
+-_vte_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
+-                                  GValue       *return_value,
+-                                  guint         n_param_values,
+-                                  const GValue *param_values,
+-                                  gpointer      invocation_hint,
+-                                  gpointer      marshal_data)
+-{
+-  typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer     data1,
+-                                                    gpointer     arg_1,
+-                                                    gpointer     arg_2,
+-                                                    gpointer     data2);
+-  register GMarshalFunc_VOID__OBJECT_OBJECT callback;
+-  register GCClosure *cc = (GCClosure*) closure;
+-  register gpointer data1, data2;
+-
+-  g_return_if_fail (n_param_values == 3);
+-
+-  if (G_CCLOSURE_SWAP_DATA (closure))
+-    {
+-      data1 = closure->data;
+-      data2 = g_value_peek_pointer (param_values + 0);
+-    }
+-  else
+-    {
+-      data1 = g_value_peek_pointer (param_values + 0);
+-      data2 = closure->data;
+-    }
+-  callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
+-
+-  callback (data1,
+-            g_marshal_value_peek_object (param_values + 1),
+-            g_marshal_value_peek_object (param_values + 2),
+-            data2);
+-}
+-
+diff -Nur vte-0.12.1/src/marshal.h vte-0.12.1.new/src/marshal.h
+--- vte-0.12.1/src/marshal.h	2006-03-31 02:34:48.000000000 +0200
++++ vte-0.12.1.new/src/marshal.h	1970-01-01 01:00:00.000000000 +0100
+@@ -1,53 +0,0 @@
+-
+-#ifndef ___vte_marshal_MARSHAL_H__
+-#define ___vte_marshal_MARSHAL_H__
+-
+-#include	<glib-object.h>
+-
+-G_BEGIN_DECLS
+-
+-/* VOID:VOID (marshal.list:1) */
+-#define _vte_marshal_VOID__VOID	g_cclosure_marshal_VOID__VOID
+-
+-/* VOID:STRING (marshal.list:2) */
+-#define _vte_marshal_VOID__STRING	g_cclosure_marshal_VOID__STRING
+-
+-/* VOID:STRING,UINT (marshal.list:3) */
+-extern void _vte_marshal_VOID__STRING_UINT (GClosure     *closure,
+-                                            GValue       *return_value,
+-                                            guint         n_param_values,
+-                                            const GValue *param_values,
+-                                            gpointer      invocation_hint,
+-                                            gpointer      marshal_data);
+-
+-/* VOID:INT (marshal.list:4) */
+-#define _vte_marshal_VOID__INT	g_cclosure_marshal_VOID__INT
+-
+-/* VOID:INT,INT (marshal.list:5) */
+-extern void _vte_marshal_VOID__INT_INT (GClosure     *closure,
+-                                        GValue       *return_value,
+-                                        guint         n_param_values,
+-                                        const GValue *param_values,
+-                                        gpointer      invocation_hint,
+-                                        gpointer      marshal_data);
+-
+-/* VOID:UINT,UINT (marshal.list:6) */
+-extern void _vte_marshal_VOID__UINT_UINT (GClosure     *closure,
+-                                          GValue       *return_value,
+-                                          guint         n_param_values,
+-                                          const GValue *param_values,
+-                                          gpointer      invocation_hint,
+-                                          gpointer      marshal_data);
+-
+-/* VOID:OBJECT,OBJECT (marshal.list:7) */
+-extern void _vte_marshal_VOID__OBJECT_OBJECT (GClosure     *closure,
+-                                              GValue       *return_value,
+-                                              guint         n_param_values,
+-                                              const GValue *param_values,
+-                                              gpointer      invocation_hint,
+-                                              gpointer      marshal_data);
+-
+-G_END_DECLS
+-
+-#endif /* ___vte_marshal_MARSHAL_H__ */
+-
+diff -Nur vte-0.12.1/src/matcher.c vte-0.12.1.new/src/matcher.c
+--- vte-0.12.1/src/matcher.c	2006-02-03 14:27:26.000000000 +0100
++++ vte-0.12.1.new/src/matcher.c	2006-10-20 19:22:48.650412123 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: matcher.c,v 1.7 2006/02/03 13:27:26 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ #include <sys/types.h>
+diff -Nur vte-0.12.1/src/matcher.h vte-0.12.1.new/src/matcher.h
+--- vte-0.12.1/src/matcher.h	2005-03-14 15:43:47.000000000 +0100
++++ vte-0.12.1.new/src/matcher.h	2006-10-20 19:22:48.650412123 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_matcher_h_included
+ #define vte_matcher_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: matcher.h,v 1.6 2005/03/14 14:43:47 kmaraas Exp $"
++#endif
+ 
+ #include <glib-object.h>
+ #include "vtetc.h"
+diff -Nur vte-0.12.1/src/mev.c vte-0.12.1.new/src/mev.c
+--- vte-0.12.1/src/mev.c	2004-04-30 03:16:53.000000000 +0200
++++ vte-0.12.1.new/src/mev.c	2006-10-20 19:22:48.651411947 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: mev.c,v 1.6 2004/04/30 01:16:53 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #ifdef HAVE_SYS_TERMIOS_H
+diff -Nur vte-0.12.1/src/nativeecho.c vte-0.12.1.new/src/nativeecho.c
+--- vte-0.12.1/src/nativeecho.c	2003-06-27 18:27:19.000000000 +0200
++++ vte-0.12.1.new/src/nativeecho.c	2006-10-20 19:22:48.651411947 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: nativeecho.c,v 1.4 2003/06/27 16:27:19 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <limits.h>
+ #include <stdio.h>
+diff -Nur vte-0.12.1/src/pty.c vte-0.12.1.new/src/pty.c
+--- vte-0.12.1/src/pty.c	2006-10-20 19:22:48.218488260 +0200
++++ vte-0.12.1.new/src/pty.c	2006-10-20 19:22:48.652411770 +0200
+@@ -16,16 +16,22 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: pty.c,v 1.50 2004/05/01 07:12:51 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
++#ifndef _WIN32
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
++#endif
+ #ifdef HAVE_SYS_TERMIOS_H
+ #include <sys/termios.h>
+ #endif
++#ifndef _WIN32
+ #include <sys/uio.h>
+ #include <sys/wait.h>
++#endif
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+@@ -76,6 +82,7 @@
+ static void
+ _vte_pty_reset_signal_handlers(void)
+ {
++#ifndef _WIN32
+ 	signal(SIGHUP,  SIG_DFL);
+ 	signal(SIGINT,  SIG_DFL);
+ 	signal(SIGILL,  SIG_DFL);
+@@ -149,6 +156,7 @@
+ #ifdef SIGUNUSED
+ 	signal(SIGUNUSED, SIG_DFL);
+ #endif
++#endif
+ }
+ 
+ #ifdef HAVE_SOCKETPAIR
+@@ -277,6 +285,7 @@
+ 		    char **env_add, const char *command, char **argv,
+ 		    const char *directory)
+ {
++#ifndef _WIN32
+ 	int i;
+ 	char c;
+ 	char **args, *arg;
+@@ -391,7 +400,7 @@
+ 		_exit(0);
+ 		g_assert_not_reached();
+ 	}
+-
++#endif
+ 	return 0;
+ }
+ 
+@@ -399,10 +408,11 @@
+ _vte_pty_keep_fd(char **env_add)
+ {
+    int i, res = -1;
++   const gchar *needle="VTE_PTY_KEEP_FD=";
++
+    if(env_add == NULL)
+       return res;
+ 
+-   const gchar *needle="VTE_PTY_KEEP_FD=";
+    for(i=0; env_add[i] != NULL; i++) {
+       gchar *s = strstr(env_add[i],needle);
+       if(s != NULL) {
+@@ -422,6 +432,7 @@
+ 			  const char *directory,
+ 			  int columns, int rows, pid_t *child)
+ {
++#ifndef _WIN32
+ 	int fd, i;
+ 	char c;
+ 	int ready_a[2], ready_b[2];
+@@ -515,6 +526,7 @@
+ 		break;
+ 	}
+ 	g_assert_not_reached();
++#endif
+ 	return -1;
+ }
+ 
+@@ -526,6 +538,7 @@
+ 			const char *directory,
+ 			int columns, int rows, pid_t *child)
+ {
++#ifndef _WIN32
+ 	int i;
+ 	char *tty;
+ 	char c;
+@@ -627,6 +640,7 @@
+ 		return 0;
+ 	}
+ 	g_assert_not_reached();
++#endif
+ 	return -1;
+ }
+ 
+@@ -644,8 +658,9 @@
+ int
+ _vte_pty_set_size(int master, int columns, int rows)
+ {
++	int ret = -1;
++#ifndef _WIN32
+ 	struct winsize size;
+-	int ret;
+ 	memset(&size, 0, sizeof(size));
+ 	size.ws_row = rows ? rows : 24;
+ 	size.ws_col = columns ? columns : 80;
+@@ -664,6 +679,7 @@
+ 		}
+ 	}
+ #endif
++#endif
+ 	return ret;
+ }
+ 
+@@ -680,8 +696,9 @@
+ int
+ _vte_pty_get_size(int master, int *columns, int *rows)
+ {
++	int ret = -1;
++#ifndef _WIN32
+ 	struct winsize size;
+-	int ret;
+ 	memset(&size, 0, sizeof(size));
+ 	ret = ioctl(master, TIOCGWINSZ, &size);
+ 	if (ret == 0) {
+@@ -705,6 +722,7 @@
+ 		}
+ #endif
+ 	}
++#endif
+ 	return ret;
+ }
+ 
+@@ -762,7 +780,9 @@
+ static int
+ _vte_pty_getpt(void)
+ {
+-	int fd, flags;
++	int fd = -1;
++#ifndef _WIN32
++	int flags;
+ #ifdef HAVE_GETPT
+ 	/* Call the system's function for allocating a pty. */
+ 	fd = getpt();
+@@ -777,6 +797,7 @@
+ 	flags = fcntl(fd, F_GETFL);
+ 	flags &= ~(O_NONBLOCK);
+ 	fcntl(fd, F_SETFL, flags);
++#endif
+ 	return fd;
+ }
+ 
+@@ -910,6 +931,7 @@
+ static void
+ _vte_pty_stop_helper(void)
+ {
++#ifndef _WIN32
+ 	if (_vte_pty_helper_started) {
+ 		g_tree_destroy(_vte_pty_helper_map);
+ 		_vte_pty_helper_map = NULL;
+@@ -919,6 +941,7 @@
+ 		_vte_pty_helper_pid = -1;
+ 		_vte_pty_helper_started = FALSE;
+ 	}
++#endif
+ }
+ 
+ static gint
+@@ -930,6 +953,7 @@
+ static gboolean
+ _vte_pty_start_helper(void)
+ {
++#ifndef _WIN32
+ 	int i, tmp[2], tunnel;
+ 	/* Sanity check. */
+ 	if (access(LIBEXECDIR "/gnome-pty-helper", X_OK) != 0) {
+@@ -980,6 +1004,7 @@
+ 	close(tunnel);
+ 	_vte_pty_helper_map = g_tree_new(_vte_direct_compare);
+ 	atexit(_vte_pty_stop_helper);
++#endif
+ 	return TRUE;
+ }
+ 
+@@ -1035,9 +1060,10 @@
+ 		}
+ #ifdef VTE_DEBUG
+ 		if (_vte_debug_on(VTE_DEBUG_PTY)) {
+-			fprintf(stderr, "Tag = %p.\n", tag);
++			printf( "Tag = %p.\n", tag);
+ 		}
+ #endif
++#ifdef HAVE_RECVMSG
+ 		/* Receive the master and slave ptys. */
+ 		_vte_pty_read_ptypair(_vte_pty_helper_tunnel,
+ 				      &parentfd, &childfd);
+@@ -1047,9 +1073,10 @@
+ 			close(childfd);
+ 			return -1;
+ 		}
++#endif
+ #ifdef VTE_DEBUG
+ 		if (_vte_debug_on(VTE_DEBUG_PTY)) {
+-			fprintf(stderr, "Got master pty %d and slave pty %d.\n",
++			printf( "Got master pty %d and slave pty %d.\n",
+ 				parentfd, childfd);
+ 		}
+ #endif
+@@ -1270,3 +1297,4 @@
+ 	return 0;
+ }
+ #endif
++
+diff -Nur vte-0.12.1/src/pty.h vte-0.12.1.new/src/pty.h
+--- vte-0.12.1/src/pty.h	2004-04-20 07:37:50.000000000 +0200
++++ vte-0.12.1.new/src/pty.h	2006-10-20 19:22:48.652411770 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_pty_h_included
+ #define vte_pty_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: pty.h,v 1.10 2004/04/20 05:37:50 nalin Exp $"
++#endif
+ 
+ #include <sys/types.h>
+ 
+diff -Nur vte-0.12.1/src/reaper.c vte-0.12.1.new/src/reaper.c
+--- vte-0.12.1/src/reaper.c	2006-03-15 12:02:59.000000000 +0100
++++ vte-0.12.1.new/src/reaper.c	2006-10-20 19:22:48.653411594 +0200
+@@ -16,10 +16,14 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: reaper.c,v 1.14 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
++#ifndef _WIN32
+ #include <sys/wait.h>
++#endif
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -46,6 +50,7 @@
+ static void
+ vte_reaper_signal_handler(int signum)
+ {
++#ifndef _WIN32
+ 	struct reaper_info info;
+ 	int status;
+ 
+@@ -66,12 +71,14 @@
+ 			}
+ 		}
+ 	}
++#endif
+ }
+ 
+ static gboolean
+ vte_reaper_emit_signal(GIOChannel *channel, GIOCondition condition,
+ 		       gpointer data)
+ {
++#ifndef _WIN32
+ 	struct reaper_info info;
+ 	if (condition != G_IO_IN) {
+ 		return FALSE;
+@@ -86,6 +93,7 @@
+ 		g_signal_emit_by_name(data, "child-exited",
+ 				      info.pid, info.status);
+ 	}
++#endif
+ 	return TRUE;
+ }
+ 
+@@ -139,6 +147,7 @@
+ static void
+ vte_reaper_init(VteReaper *reaper, gpointer *klass)
+ {
++#ifndef _WIN32
+ 	struct sigaction action;
+ 	int ret;
+ 
+@@ -172,13 +181,15 @@
+ 	action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+ 	sigaction(SIGCHLD, &action, NULL);
+ 	if (_vte_debug_on(VTE_DEBUG_SIGNALS)) {
+-		fprintf(stderr, "Hooked SIGCHLD signal in reaper.\n");
++		printf( "Hooked SIGCHLD signal in reaper.\n");
+ 	}
++#endif
+ }
+ 
+ static void
+ vte_reaper_finalize(GObject *reaper)
+ {
++#ifndef _WIN32
+ 	GObjectClass *object_class;
+ 	struct sigaction action, old_action;
+ 
+@@ -210,6 +221,7 @@
+ 		(G_OBJECT_CLASS(object_class))->finalize(reaper);
+ 	}
+ 	singleton_reaper = NULL;
++#endif
+ }
+ 
+ static void
+diff -Nur vte-0.12.1/src/reaper.h vte-0.12.1.new/src/reaper.h
+--- vte-0.12.1/src/reaper.h	2004-05-02 08:43:01.000000000 +0200
++++ vte-0.12.1.new/src/reaper.h	2006-10-20 19:22:48.653411594 +0200
+@@ -19,9 +19,11 @@
+ #ifndef vte_reaper_h_included
+ #define vte_reaper_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: reaper.h,v 1.5 2004/05/02 06:43:01 nalin Exp $"
+ 
+ #include <sys/wait.h>
++#endif
+ #include <signal.h>
+ #include <glib.h>
+ #include <glib-object.h>
+diff -Nur vte-0.12.1/src/reaper.loT vte-0.12.1.new/src/reaper.loT
+--- vte-0.12.1/src/reaper.loT	1970-01-01 01:00:00.000000000 +0100
++++ vte-0.12.1.new/src/reaper.loT	2006-10-20 19:22:48.653411594 +0200
+@@ -0,0 +1,7 @@
++# reaper.lo - a libtool object file
++# Generated by ltmain.sh - GNU libtool 1.5.16 (1.1220.2.235 2005/04/25 18:13:26)
++#
++# Please DO NOT delete this file!
++# It is necessary for linking the library.
++
++# Name of the PIC object.
+diff -Nur vte-0.12.1/src/reflect.c vte-0.12.1.new/src/reflect.c
+--- vte-0.12.1/src/reflect.c	2004-04-20 07:08:42.000000000 +0200
++++ vte-0.12.1.new/src/reflect.c	2006-10-20 19:22:48.653411594 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: reflect.c,v 1.13 2004/04/20 05:08:42 nalin Exp $"
++#endif 
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <stdio.h>
+diff -Nur vte-0.12.1/src/ring.c vte-0.12.1.new/src/ring.c
+--- vte-0.12.1/src/ring.c	2006-01-15 22:09:40.000000000 +0100
++++ vte-0.12.1.new/src/ring.c	2006-10-20 19:22:48.654411418 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: ring.c,v 1.20 2006/01/15 21:09:40 gpastore Exp $"
++#endif
+ #include "../config.h"
+ #include <stdio.h>
+ #include <string.h>
+diff -Nur vte-0.12.1/src/ring.h vte-0.12.1.new/src/ring.h
+--- vte-0.12.1/src/ring.h	2003-01-14 07:33:14.000000000 +0100
++++ vte-0.12.1.new/src/ring.h	2006-10-20 19:22:48.654411418 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_ring_h_included
+ #define vte_ring_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: ring.h,v 1.13 2003/01/14 06:33:14 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/slowcat.c vte-0.12.1.new/src/slowcat.c
+--- vte-0.12.1/src/slowcat.c	2004-04-27 22:48:17.000000000 +0200
++++ vte-0.12.1.new/src/slowcat.c	2006-10-20 19:22:48.654411418 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: slowcat.c,v 1.4 2004/04/27 20:48:17 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/time.h>
+ #include <sys/types.h>
+diff -Nur vte-0.12.1/src/table.c vte-0.12.1.new/src/table.c
+--- vte-0.12.1/src/table.c	2005-04-29 22:17:41.000000000 +0200
++++ vte-0.12.1.new/src/table.c	2006-10-20 19:22:48.655411242 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: table.c,v 1.18 2005/04/29 20:17:41 kmaraas Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <assert.h>
+diff -Nur vte-0.12.1/src/table.h vte-0.12.1.new/src/table.h
+--- vte-0.12.1/src/table.h	2003-05-06 01:23:46.000000000 +0200
++++ vte-0.12.1.new/src/table.h	2006-10-20 19:22:48.655411242 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_table_h_included
+ #define vte_table_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: table.h,v 1.7 2003/05/05 23:23:46 nalin Exp $"
++#endif
+ 
+ #include <glib-object.h>
+ 
+diff -Nur vte-0.12.1/src/trie.c vte-0.12.1.new/src/trie.c
+--- vte-0.12.1/src/trie.c	2006-01-30 13:23:49.000000000 +0100
++++ vte-0.12.1.new/src/trie.c	2006-10-20 19:22:48.655411242 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: trie.c,v 1.36 2006/01/30 12:23:49 gpastore Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <assert.h>
+@@ -288,7 +290,7 @@
+ static int
+ unichar_sncmp(const gunichar *a, const gunichar *b, size_t length)
+ {
+-	int i;
++	size_t i;
+ 	for (i = 0; i < length; i++) {
+ 		if (a[i] != b[i]) {
+ 			return a[i] - b[i];
+@@ -304,8 +306,7 @@
+ 			  struct char_class_data *data, GValueArray *array)
+ {
+ 	gunichar *ret = NULL;
+-	size_t len;
+-	int i;
++	size_t len, i;
+ 	GValue value;
+ 
+ 	len = unichar_snlen(s, length);
+@@ -578,7 +579,7 @@
+ 				/* Move past characters which might match this
+ 				 * part of the string... */
+ 				while (cclass->multiple &&
+-				       ((prospect - pattern) < length) &&
++				       ((size_t)(prospect - pattern) < length) &&
+ 				       cclass->check(prospect[0], data)) {
+ 					prospect++;
+ 				}
+@@ -682,7 +683,7 @@
+ 	const gunichar *dummyconsumed;
+ 	gpointer ptr;
+ 	gboolean greedy = FALSE;
+-	int i;
++	size_t i;
+ 
+ 	valuearray = g_value_array_new(0);
+ 	if (quark == NULL) {
+diff -Nur vte-0.12.1/src/trie.h vte-0.12.1.new/src/trie.h
+--- vte-0.12.1/src/trie.h	2002-12-10 01:08:32.000000000 +0100
++++ vte-0.12.1.new/src/trie.h	2006-10-20 19:22:48.655411242 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_trie_h_included
+ #define vte_trie_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: trie.h,v 1.10 2002/12/10 00:08:32 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ #include <glib-object.h>
+diff -Nur vte-0.12.1/src/utf8echo.c vte-0.12.1.new/src/utf8echo.c
+--- vte-0.12.1/src/utf8echo.c	2003-06-27 18:27:19.000000000 +0200
++++ vte-0.12.1.new/src/utf8echo.c	2006-10-20 19:22:48.656411065 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: utf8echo.c,v 1.14 2003/06/27 16:27:19 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <glib.h>
+ #include <limits.h>
+diff -Nur vte-0.12.1/src/utf8mode.c vte-0.12.1.new/src/utf8mode.c
+--- vte-0.12.1/src/utf8mode.c	2003-06-27 18:27:19.000000000 +0200
++++ vte-0.12.1.new/src/utf8mode.c	2006-10-20 19:22:48.656411065 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: utf8mode.c,v 1.3 2003/06/27 16:27:19 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <stdio.h>
+ #define ESC "\033"
+diff -Nur vte-0.12.1/src/vte-private.h vte-0.12.1.new/src/vte-private.h
+--- vte-0.12.1/src/vte-private.h	2006-03-08 21:31:13.000000000 +0100
++++ vte-0.12.1.new/src/vte-private.h	2006-10-20 19:22:48.656411065 +0200
+@@ -19,18 +19,25 @@
+ #ifndef vte_vte_private_h_included
+ #define vte_vte_private_h_included
+ 
++#ifndef _WIN32
+ #include <sys/ioctl.h>
+-#include <sys/types.h>
+ #include <sys/param.h>
++#else
++#include <WinIoCtl.h>
++#endif
++#include <sys/types.h>
+ #include <sys/stat.h>
+ #ifdef HAVE_SYS_TERMIOS_H
+ #include <sys/termios.h>
+ #endif
++#ifndef _WIN32
+ #include <sys/time.h>
++#include <pwd.h>
++#endif
++#include <time.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <math.h>
+-#include <pwd.h>
+ #include <signal.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -51,7 +58,9 @@
+ 
+ G_BEGIN_DECLS
+ 
++#ifndef _WIN32
+ #ident "$Id: vte-private.h,v 1.4 2006/03/08 20:31:13 behdad Exp $"
++#endif
+ 
+ #define VTE_PAD_WIDTH			1
+ #define VTE_TAB_WIDTH			8
+@@ -258,6 +267,7 @@
+ 	gboolean text_modified_flag;
+ 	glong text_inserted_count;
+ 	glong text_deleted_count;
++	gboolean sync_mode;
+ 
+ 	/* Scrolling options. */
+ 	gboolean scroll_background;
+@@ -381,9 +391,11 @@
+ #include <libintl.h>
+ #define _(String) dgettext(PACKAGE, String)
+ #else
++#ifndef _WIN32
+ #define _(String) String
+ #define bindtextdomain(package,dir)
+ #endif
++#endif
+ 
+ G_END_DECLS
+ 
+diff -Nur vte-0.12.1/src/vte.c vte-0.12.1.new/src/vte.c
+--- vte-0.12.1/src/vte.c	2006-10-20 19:22:48.194492490 +0200
++++ vte-0.12.1.new/src/vte.c	2006-10-20 19:22:48.662410008 +0200
+@@ -16,10 +16,13 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
+-#ident "$Id: vte.c,v 1.446.2.4 2006/04/21 06:32:04 behdad Exp $"
++#ifndef _WIN32
++#ident "$Id: vte.c,v 1.446.2.5 2006/04/27 01:08:33 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
++#include <fcntl.h>
+ #include "vte.h"
+ #include "vte-private.h"
+ 
+@@ -53,6 +56,15 @@
+ typedef gunichar wint_t;
+ #endif
+ 
++#ifdef _WIN32
++/* Windows compatibility layer. hopefully. */
++struct timezone {
++    int  tz_minuteswest; /* minutes W of Greenwich */
++    int  tz_dsttime;     /* type of dst correction - not used */
++};
++
++#endif
++
+ static void vte_terminal_set_termcap(VteTerminal *terminal, const char *path,
+ 				     gboolean reset);
+ static void vte_terminal_paste(VteTerminal *terminal, GdkAtom board);
+@@ -99,6 +111,326 @@
+ 
+ static gpointer parent_class;
+ 
++char *vte_terminal_get_state(VteTerminal *terminal, int *len);
++void vte_terminal_set_state(VteTerminal *terminal, char *rows);
++char *vte_terminal_get_rawtext(VteTerminal *terminal, int *len);
++static void vte_terminal_emit_selection_changed(VteTerminal *terminal);
++static gboolean need_processing (VteTerminal *terminal);
++
++static void vte_terminal_paint(GtkWidget *widget, GdkRectangle *area);
++
++
++void
++vte_terminal_screenshot (VteTerminal *terminal, GObject *px)
++{
++  GdkPixmap *pixmap = (GdkPixmap*)px;
++  GdkWindow *tmp_window;
++  GdkRectangle area;
++
++  area = terminal->widget.allocation;
++
++  tmp_window = terminal->widget.window;
++  terminal->pvt->draw->widget->window = pixmap;
++  vte_terminal_paint((GtkWidget *) terminal, &area);
++  terminal->widget.window = tmp_window;
++}
++
++char *
++vte_terminal_get_state(VteTerminal *terminal, int *len)
++{
++        VteRowData *rowdata;
++        struct _VteTerminalPrivate *pvt;
++        VteScreen *screen;
++        int i, k, size, pos = 0, blocksize = 0, bs = 16384;
++        long x, y;
++        // Az elso 4 byte a cursor X pozicioja
++        // A kovetkezo 4 byte a cursor Y pozicioja
++        // A kovetkezo 4 byte a tartalmazott sorok szama
++        // Utana jonnek a sorok, aminek az elso 4 byte-ja a sorban levo elemek szamat tartalmazza,
++        // majd pedig jonnek a karakterek, amik egy-egy 8 byte-os strukturaban vannak. A struktura
++        // elso 4 byte-ja maga az UNICODE karakter.
++        char *data = NULL;
++
++        g_assert(VTE_IS_TERMINAL(terminal));
++
++        pvt = terminal->pvt;
++        screen = terminal->pvt->screen;
++        size = screen->row_data->length;
++        blocksize = bs;
++        data = g_malloc(blocksize);
++
++        // screen->cursor_current
++        x = screen->cursor_current.col;
++        y = screen->cursor_current.row - screen->row_data->delta;
++        memcpy(data + pos, &x, sizeof(x));
++        pos += sizeof(x);
++        memcpy(data + pos, &y, sizeof(y));
++        pos += sizeof(y);
++
++        // screen->cursor_saved
++        x = screen->cursor_saved.col;
++        y = screen->cursor_saved.row - screen->row_data->delta;
++        memcpy(data + pos, &x, sizeof(x));
++        pos += sizeof(x);
++        memcpy(data + pos, &y, sizeof(y));
++        pos += sizeof(y);
++        
++        // pvt->keypad_mode
++        memcpy(data + pos, &(pvt->keypad_mode), sizeof(pvt->keypad_mode));
++        pos += sizeof(pvt->keypad_mode);
++
++        // pvt->cursor_mode
++        memcpy(data + pos, &(pvt->cursor_mode), sizeof(pvt->cursor_mode));
++        pos += sizeof(pvt->cursor_mode);
++
++        // pvt->cursor_visible
++        memcpy(data + pos, &(pvt->cursor_visible), sizeof(pvt->cursor_visible));
++        pos += sizeof(pvt->cursor_visible);
++
++        // pvt->flags
++        memcpy(data + pos, &(pvt->flags), sizeof(pvt->flags));
++        pos += sizeof(pvt->flags);
++        
++        // screen->reverse_mode
++        memcpy(data + pos, &(screen->reverse_mode), sizeof(screen->reverse_mode));
++        pos += sizeof(screen->reverse_mode);
++
++        // screen->origin_mode
++        memcpy(data + pos, &(screen->origin_mode), sizeof(screen->origin_mode));
++        pos += sizeof(screen->origin_mode);
++
++        // screen->sendrecv_mode
++        memcpy(data + pos, &(screen->sendrecv_mode), sizeof(screen->sendrecv_mode));
++        pos += sizeof(screen->sendrecv_mode);
++        
++        // screen->insert_mode
++        memcpy(data + pos, &(screen->insert_mode), sizeof(screen->insert_mode));
++        pos += sizeof(screen->insert_mode);
++
++        // screen->linefeed_mode
++        memcpy(data + pos, &(screen->linefeed_mode), sizeof(screen->linefeed_mode));
++        pos += sizeof(screen->linefeed_mode);
++
++        // screen->color_defaults
++        memcpy(data + pos, &(screen->color_defaults), sizeof(screen->color_defaults));
++        pos += sizeof(screen->color_defaults);
++
++        // size
++        memcpy(data + pos, &size, sizeof(size));
++        pos += sizeof(size);
++
++        for (i=0; i<screen->row_data->length; i++)
++        {
++                k = screen->row_data->delta + i;
++                if (_vte_ring_contains(screen->row_data, k)) 
++                {
++                        rowdata = _vte_ring_index(screen->row_data, VteRowData *, k);
++                        while ((size_t)(blocksize - pos) < sizeof(rowdata->cells->len) + (sizeof(struct vte_charcell) * rowdata->cells->len))
++                        {
++                            blocksize += bs;
++                            data = g_realloc(data, blocksize);
++                        }
++                        memcpy(data+pos, &(rowdata->cells->len), sizeof(rowdata->cells->len));
++                        pos += sizeof(rowdata->cells->len);
++                        memcpy(data+pos, rowdata->cells->data, sizeof(struct vte_charcell) * rowdata->cells->len);
++                        pos += (sizeof(struct vte_charcell) * rowdata->cells->len);
++                }
++        }
++        *len = pos;
++        return data;
++}
++
++void
++vte_terminal_set_state(VteTerminal *terminal, char *rows)
++{
++        struct _VteTerminalPrivate *pvt;
++        VteScreen *screen;
++        int i, size;
++        long x, y, pos;
++        VteRowData *vterow = NULL;
++        GArray *cells;
++
++                                        
++        size = 0;
++        pos = 0;
++        g_assert(VTE_IS_TERMINAL(terminal));
++        vte_terminal_reset(terminal, TRUE, TRUE);
++        pvt = terminal->pvt;
++        screen = terminal->pvt->screen;
++        
++        if (rows == NULL)
++        {
++            return;
++        }
++        
++
++        // screen->cursor_current
++        x = *(long*)(rows+pos);
++        screen->cursor_current.col = *(long*)(rows+pos);
++        pos += sizeof(screen->cursor_current.col);
++        y = *(long*)(rows+pos);
++        screen->cursor_current.row = *(long*)(rows+pos);
++        pos += sizeof(screen->cursor_current.row);
++
++        // screen->cursor_saved
++        x = *(long*)(rows+pos);
++        screen->cursor_saved.col = *(long*)(rows+pos);
++        pos += sizeof(screen->cursor_saved.col);
++        y = *(long*)(rows+pos);
++        screen->cursor_saved.row = *(long*)(rows+pos);
++        pos += sizeof(screen->cursor_saved.row);
++        
++        // pvt->keypad_mode
++        pvt->keypad_mode = *(int*)(rows+pos);
++        pos += sizeof(pvt->keypad_mode);
++
++        // pvt->cursor_mode
++        pvt->cursor_mode = *(int*)(rows+pos);
++        pos += sizeof(pvt->cursor_mode);
++
++        // pvt->cursor_visible
++        pvt->cursor_visible = *(gboolean*)(rows+pos);
++        pos += sizeof(pvt->cursor_visible);
++
++        // pvt->flags
++        pvt->flags = *(struct vte_terminal_flags*)(rows+pos);
++        pos += sizeof(pvt->flags);
++        
++        // screen->reverse_mode
++        screen->reverse_mode = *(gboolean*)(rows+pos);
++        pos += sizeof(screen->reverse_mode);
++
++        // screen->origin_mode
++        screen->origin_mode = *(gboolean*)(rows+pos);
++        pos += sizeof(screen->origin_mode);
++
++        // screen->sendrecv_mode
++        screen->sendrecv_mode = *(gboolean*)(rows+pos);
++        pos += sizeof(screen->sendrecv_mode);
++        
++        // screen->insert_mode
++        screen->insert_mode = *(gboolean*)(rows+pos);
++        pos += sizeof(screen->insert_mode);
++
++        // screen->linefeed_mode
++        screen->linefeed_mode = *(gboolean*)(rows+pos);
++        pos += sizeof(screen->linefeed_mode);
++
++        // screen->color_defaults
++        screen->color_defaults = *(struct vte_charcell*)(rows+pos);
++        pos += sizeof(screen->color_defaults);
++
++        // size
++        size = *(int*)(rows+pos);
++        pos += sizeof(size);
++        
++        for (i=0; i < size; i++)
++        {
++            cells = g_array_sized_new(FALSE, FALSE, sizeof(struct vte_charcell), *(int*)(rows+pos));
++            cells->len = *(int*)(rows+pos);
++            pos += sizeof(size);
++            if (cells && (cells->len > 0))
++            {
++                memcpy(cells->data, rows+pos, sizeof(struct vte_charcell) * cells->len);
++                pos += (cells->len * sizeof(struct vte_charcell));
++                vterow = g_malloc0(sizeof(VteRowData));
++                vterow->soft_wrapped = 0;
++                vterow->cells = cells;
++                _vte_ring_append(screen->row_data, vterow);
++            }
++        }
++        
++        screen->scroll_delta = (size - terminal->row_count) > 0 ? size - terminal->row_count : 0;
++        screen->insert_delta = size - 1;
++        
++        _vte_terminal_update_insert_delta(terminal);
++        _vte_invalidate_cursor_once(terminal, FALSE);
++        _vte_invalidate_all(terminal);
++}
++
++char *
++vte_terminal_get_rawtext(VteTerminal *terminal, int *len)
++{
++        VteRowData *rowdata;
++        VteScreen *screen;
++        int i, k, size, pos = 0, blocksize = 0, bs = 16384;
++        size_t j;
++        char *data = NULL;
++        gunichar c;
++
++        g_assert(VTE_IS_TERMINAL(terminal));
++
++        screen = terminal->pvt->screen;
++        size = 0;
++        blocksize = bs;
++        data = g_malloc(blocksize);
++        for (i=0; i<screen->row_data->length; i++)
++        {
++                k = screen->row_data->delta + i;
++                if (_vte_ring_contains(screen->row_data, k)) 
++                {
++                        rowdata = _vte_ring_index(screen->row_data, VteRowData *, k);
++                        while ((size_t)(blocksize - pos) < sizeof(gunichar) * rowdata->cells->len)
++                        {
++                            blocksize += bs;
++                            data = g_realloc(data, blocksize);
++                        }
++                        for (j=0; j<rowdata->cells->len; j++)
++                        {
++                            c = g_array_index(rowdata->cells, struct vte_charcell, j).c;
++                            memcpy(data+pos, &c, sizeof(c));
++                            pos += sizeof(c);
++                            (*len)++;
++                        }
++                }
++        }
++        (*len) *= sizeof(gunichar);
++        return data;
++}
++
++void 
++vte_terminal_select_by_rawtext_pos(VteTerminal *terminal, glong frompos, glong topos)
++{
++        VteRowData *rowdata;
++        VteScreen *screen;
++        glong i, k, pos = -1;
++        size_t j;
++
++        g_assert(VTE_IS_TERMINAL(terminal));
++
++        screen = terminal->pvt->screen;
++
++        for (i=0; i<screen->row_data->length; i++)
++        {
++                k = screen->row_data->delta + i;
++                if (_vte_ring_contains(screen->row_data, k)) 
++                {
++                        rowdata = _vte_ring_index(screen->row_data, VteRowData *, k);
++                        for (j=0; j<rowdata->cells->len; j++)
++                        {
++                                pos++;
++                                if ((pos >= frompos) && (pos <= topos))
++                                {
++                                        g_array_index(rowdata->cells, struct vte_charcell, j).reverse = 1;
++                                        g_array_index(rowdata->cells, struct vte_charcell, j).fore ^= 0xF;
++//                                        g_array_index(rowdata->cells, struct vte_charcell, j).back ^= 0xF;
++                                }
++                                else if (pos > topos)
++                                {
++                                    break;
++                                }
++                        }
++                }
++        }  
++}
++
++
++void
++vte_terminal_set_sync(VteTerminal *terminal, gboolean sync)
++{
++	terminal->pvt->sync_mode = sync;
++}
++
+ /* Free a no-longer-used row data array. */
+ static void
+ vte_free_row_data(gpointer freeing, gpointer data)
+@@ -396,7 +728,7 @@
+ 	screen = terminal->pvt->screen;
+ 	if (_vte_ring_contains(screen->row_data, row)) {
+ 		rowdata = _vte_ring_index(screen->row_data, VteRowData *, row);
+-		if (rowdata->cells->len > col) {
++		if (rowdata->cells->len > (size_t)col) {
+ 			ret = &g_array_index(rowdata->cells,
+ 					     struct vte_charcell,
+ 					     col);
+@@ -914,7 +1246,7 @@
+ vte_terminal_match_clear_all(VteTerminal *terminal)
+ {
+ 	struct vte_match_regex *regex;
+-	int i;
++	size_t i;
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ 	for (i = 0; i < terminal->pvt->match_regexes->len; i++) {
+ 		regex = &g_array_index(terminal->pvt->match_regexes,
+@@ -950,7 +1282,7 @@
+ {
+ 	struct vte_match_regex *regex;
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+-	if (terminal->pvt->match_regexes->len > tag) {
++	if (terminal->pvt->match_regexes->len > (size_t)tag) {
+ 		/* The tag is an index, so find the corresponding struct. */
+ 		regex = &g_array_index(terminal->pvt->match_regexes,
+ 				       struct vte_match_regex,
+@@ -1007,7 +1339,7 @@
+ vte_terminal_match_add(VteTerminal *terminal, const char *match)
+ {
+ 	struct vte_match_regex new_regex, *regex;
+-	int ret;
++	size_t ret;
+ 	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), -1);
+ 	g_return_val_if_fail(match != NULL, -1);
+ 	g_return_val_if_fail(strlen(match) > 0, -1);
+@@ -1062,7 +1394,7 @@
+ {
+ 	struct vte_match_regex *regex;
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+-	g_return_if_fail(tag < terminal->pvt->match_regexes->len);
++	g_return_if_fail((size_t)tag < terminal->pvt->match_regexes->len);
+ 	regex = &g_array_index(terminal->pvt->match_regexes,
+ 			       struct vte_match_regex,
+ 			       tag);
+@@ -1104,7 +1436,8 @@
+ 				  long column, glong row,
+ 				  int *tag, int *start, int *end)
+ {
+-	int i, j, ret, offset;
++	int j, ret, offset;
++        size_t i;
+ 	struct vte_match_regex *regex = NULL;
+ 	struct _VteCharAttributes *attr = NULL;
+ 	gssize coffset;
+@@ -1511,10 +1844,10 @@
+ 	}
+ #endif
+ 	/* Calculate the ideal position where we want to be before clamping. */
+-	destination = floor(gtk_adjustment_get_value(terminal->adjustment));
++	destination = (glong)floor(gtk_adjustment_get_value(terminal->adjustment));
+ 	destination += (pages * terminal->row_count);
+ 	/* Can't scroll past data we have. */
+-	destination = CLAMP(destination,
++	destination = (glong)CLAMP(destination,
+ 			    terminal->adjustment->lower,
+ 			    terminal->adjustment->upper - terminal->row_count);
+ 	/* Tell the scrollbar to adjust itself. */
+@@ -1695,8 +2028,8 @@
+ 			      VteRowData *,
+ 			      screen->cursor_current.row);
+ 	g_assert(row != NULL);
+-	if ((row->cells->len <= screen->cursor_current.col) &&
+-	    (row->cells->len < terminal->column_count)) {
++	if ((row->cells->len <= (size_t)screen->cursor_current.col) &&
++	    (row->cells->len < (size_t)terminal->column_count)) {
+ 		/* Set up defaults we'll use when adding new cells. */
+ 		if (current) {
+ 			/* Add new cells until we have one here. */
+@@ -1765,7 +2098,7 @@
+ 			cursor = terminal->pvt->mouse_mousing_cursor;
+ 		} else
+ 		if ((terminal->pvt->match_previous > -1) &&
+-		    (terminal->pvt->match_previous < terminal->pvt->match_regexes->len)) {
++		    ((size_t)terminal->pvt->match_previous < terminal->pvt->match_regexes->len)) {
+ 			regex = &g_array_index(terminal->pvt->match_regexes,
+ 					       struct vte_match_regex,
+ 					       terminal->pvt->match_previous);
+@@ -1885,12 +2218,12 @@
+ 			r, g, b);
+ 	}
+ #endif
+-	bold->red = CLAMP(r, 0, 0xffff);
+-	bold->green = CLAMP(g, 0, 0xffff);
+-	bold->blue = CLAMP(b, 0, 0xffff);
++	bold->red = (guint16)CLAMP(r, 0, 0xffff);
++	bold->green = (guint16)CLAMP(g, 0, 0xffff);
++	bold->blue = (guint16)CLAMP(b, 0, 0xffff);
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_MISC)) {
+-		fprintf(stderr, "= (%04x,%04x,%04x).\n",
++		printf( "= (%04x,%04x,%04x).\n",
+ 			bold->red, bold->green, bold->blue);
+ 	}
+ #endif
+@@ -2274,7 +2607,7 @@
+ 		col = screen->cursor_current.col;
+ 
+ 		/* Make sure we have enough columns in this row. */
+-		if (row->cells->len <= col) {
++		if (row->cells->len <= (size_t)col) {
+ 			/* Add enough cells to fill out the row to at least out
+ 			 * to (and including) the insertion point. */
+ 			if (paint_cells) {
+@@ -2343,7 +2676,7 @@
+ 		/* Make sure we're not getting random stuff past the right
+ 		 * edge of the screen at this point, because the user can't
+ 		 * see it. */
+-		if (row->cells->len > terminal->column_count) {
++		if (row->cells->len > (size_t)terminal->column_count) {
+ 			g_array_set_size(row->cells, terminal->column_count);
+ 		}
+ 	}
+@@ -2677,8 +3010,10 @@
+ 		terminal->pvt->pty_reaper = reaper;
+ 
+ 		/* Set the pty to be non-blocking. */
++#ifndef _WIN32
+ 		i = fcntl(terminal->pvt->pty_master, F_GETFL);
+ 		fcntl(terminal->pvt->pty_master, F_SETFL, i | O_NONBLOCK);
++#endif
+ 
+ 		/* Set the PTY size. */
+ 		vte_terminal_set_size(terminal,
+@@ -2734,8 +3069,8 @@
+ 	/* Make the user's shell the default command. */
+ 	if (command == NULL) {
+ 		if (terminal->pvt->shell == NULL) {
++#ifndef _WIN32
+ 			struct passwd *pwd;
+-
+ 			pwd = getpwuid(getuid());
+ 			if (pwd != NULL) {
+ 				terminal->pvt->shell = pwd->pw_shell;
+@@ -2747,6 +3082,7 @@
+ 				}
+ #endif
+ 			}
++#endif
+ 		}
+ 		if (terminal->pvt->shell == NULL) {
+ 			if (getenv ("SHELL")) {
+@@ -3363,7 +3699,14 @@
+ 		_vte_buffer_append(terminal->pvt->incoming, data, length);
+ 	}
+ 
+-	vte_terminal_start_processing (terminal);
++	if (terminal->pvt->sync_mode) {
++		if (need_processing (terminal))	{
++			vte_terminal_process_incoming(terminal);
++		}
++	}
++	else {
++		vte_terminal_start_processing (terminal);
++	}
+ }
+ 
+ /* Send locally-encoded characters to the child. */
+@@ -3571,7 +3914,7 @@
+ 	/* Tell observers that we're sending this to the child. */
+ 	if (length > 0) {
+ 		vte_terminal_emit_commit(terminal,
+-					 data, length);
++					 (char*)data, length);
+ 	}
+ 
+ 	/* If there's a place for it to go, add the data to the
+@@ -3794,9 +4137,10 @@
+ 	gssize normal_length = 0;
+ 	int i;
+ 	const char *special = NULL;
++#ifndef _WIN32
+ 	struct termios tio;
+-	struct timeval tv;
+-	struct timezone tz;
++#endif
++	GTimeVal tv;
+ 	gboolean scrolled = FALSE, steal = FALSE, modifier = FALSE, handled,
+ 		 suppress_meta_esc = FALSE;
+ 	guint keyval = 0;
+@@ -3844,10 +4188,9 @@
+ 		}
+ 
+ 		/* Log the time of the last keypress. */
+-		if (gettimeofday(&tv, &tz) == 0) {
+-			terminal->pvt->last_keypress_time =
++		g_get_current_time(&tv);
++		terminal->pvt->last_keypress_time =
+ 				(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+-		}
+ 
+ 		/* Determine if this is just a modifier key. */
+ 		modifier = _vte_keymap_key_is_modifier(keyval);
+@@ -3950,6 +4293,7 @@
+ 			/* Use the tty's erase character. */
+ 			case VTE_ERASE_AUTO:
+ 			default:
++#ifndef _WIN32
+ 				if (terminal->pvt->pty_master != -1) {
+ 					if (tcgetattr(terminal->pvt->pty_master,
+ 						      &tio) != -1) {
+@@ -3958,6 +4302,7 @@
+ 						normal_length = 1;
+ 					}
+ 				}
++#endif
+ 				suppress_meta_esc = FALSE;
+ 				break;
+ 			}
+@@ -4196,7 +4541,7 @@
+ gboolean
+ vte_terminal_is_word_char(VteTerminal *terminal, gunichar c)
+ {
+-	int i;
++	size_t i;
+ 	VteWordCharRange *range;
+ 	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+ 	/* If we have no array, or it's empty, assume the defaults. */
+@@ -4431,9 +4776,9 @@
+ 	}
+ 
+ 	/* Encode the cursor coordinates. */
+-	cx = 32 + CLAMP(1 + (x / terminal->char_width),
++	cx = 32 + (unsigned char)CLAMP(1 + (x / terminal->char_width),
+ 			1, terminal->column_count);
+-	cy = 32 + CLAMP(1 + (y / terminal->char_height),
++	cy = 32 + (unsigned char)CLAMP(1 + (y / terminal->char_height),
+ 			1, terminal->row_count);;
+ 
+ 	/* Send event direct to the child, this is binary not text data */
+@@ -4557,9 +4902,9 @@
+ 	}
+ 
+ 	/* Encode the cursor coordinates. */
+-	cx = 32 + CLAMP(1 + ((event->x - VTE_PAD_WIDTH) / terminal->char_width),
++	cx = 32 + (unsigned char)CLAMP(1 + ((event->x - VTE_PAD_WIDTH) / terminal->char_width),
+ 			1, terminal->column_count);
+-	cy = 32 + CLAMP(1 + ((event->y - VTE_PAD_WIDTH) / terminal->char_height),
++	cy = 32 + (unsigned char)CLAMP(1 + ((event->y - VTE_PAD_WIDTH) / terminal->char_height),
+ 			1, terminal->row_count);;
+ 
+ 	/* Send event direct to the child, this is binary not text data */
+@@ -4618,8 +4963,8 @@
+ 	screen = terminal->pvt->screen;
+ 	delta = screen->scroll_delta;
+ 	match = vte_terminal_match_check_internal(terminal,
+-						  floor(x) / width,
+-						  floor(y) / height + delta,
++						  (long)(floor(x) / width),
++						  (long)(floor(y) / height + delta),
+ 						  NULL,
+ 						  &start,
+ 						  &end);
+@@ -4902,9 +5247,7 @@
+ 				if (vte_line_is_wrappable(terminal, row) &&
+ 				    wrap) {
+ 					string = g_string_append_c(string,
+-								   pcell ?
+-								   pcell->c :
+-								   ' ');
++								   (gchar)(pcell ? pcell->c : ' '));
+ 				} else {
+ 					string = g_string_append_c(string,
+ 								   '\n');
+@@ -5154,8 +5497,8 @@
+ 
+ 	/* Convert the event coordinates to cell coordinates. */
+ 	delta = terminal->pvt->screen->scroll_delta;
+-	cellx = (event->x - VTE_PAD_WIDTH) / terminal->char_width;
+-	celly = (event->y - VTE_PAD_WIDTH) / terminal->char_height + delta;
++	cellx = (long)((event->x - VTE_PAD_WIDTH) / terminal->char_width);
++	celly = (long)((event->y - VTE_PAD_WIDTH) / terminal->char_height + delta);
+ 
+ 	/* Record that we have the selection, and where it started. */
+ 	terminal->pvt->has_selection = TRUE;
+@@ -5217,7 +5560,8 @@
+ {
+ 	VteScreen *screen;
+ 	VteRowData *rowdata;
+-	long delta, height, width, last_nonspace, i, j;
++	long delta, height, width, last_nonspace, j;
++        size_t i;
+ 	struct vte_charcell *cell;
+ 	struct selection_event_coords *origin, *last, *start, *end;
+ 	struct selection_cell_coords old_start, old_end, *sc, *ec, tc;
+@@ -5300,10 +5644,10 @@
+ #endif
+ 
+ 	/* Recalculate the selection area in terms of cell positions. */
+-	terminal->pvt->selection_start.x = MAX(0, start->x / width);
+-	terminal->pvt->selection_start.y = MAX(0, start->y / height);
+-	terminal->pvt->selection_end.x = MAX(0, end->x / width);
+-	terminal->pvt->selection_end.y = MAX(0, end->y / height);
++	terminal->pvt->selection_start.x = (long)MAX(0, start->x / width);
++	terminal->pvt->selection_start.y = (long)MAX(0, start->y / height);
++	terminal->pvt->selection_end.x = (long)MAX(0, end->x / width);
++	terminal->pvt->selection_end.y = (long)MAX(0, end->y / height);
+ 
+ 	/* Re-sort using cell coordinates to catch round-offs that make two
+ 	 * coordinates "the same". */
+@@ -5342,7 +5686,7 @@
+ 		 * startpoint up to the beginning of the next line
+ 		 * unless that would move the startpoint after the end
+ 		 * point, or we're in select-by-line mode. */
+-		if ((sc->x > i) &&
++		if (((size_t)sc->x > i) &&
+ 		    (terminal->pvt->selection_type != selection_type_line)) {
+ 			if (sc->y < ec->y) {
+ 				sc->x = 0;
+@@ -5377,9 +5721,9 @@
+ 		i = last_nonspace + 1;
+ 		/* If the end point is to its right, then extend the
+ 		 * endpoint as far right as we can expect. */
+-		if (ec->x >= i) {
+-			ec->x = MAX(ec->x,
+-				    MAX(terminal->column_count - 1,
++		if ((size_t)ec->x >= i) {
++			ec->x = MAX((size_t)ec->x,
++				    MAX((size_t)terminal->column_count - 1,
+ 					rowdata->cells->len));
+ 		}
+ 	} else {
+@@ -5449,7 +5793,7 @@
+ 			for (i = (j == ec->y) ?
+ 				 ec->x :
+ 				 0;
+-			     i < terminal->column_count - 1;
++			     i < (size_t)terminal->column_count - 1;
+ 			     i++) {
+ 				if (vte_uniform_class(terminal,
+ 						      j,
+@@ -5461,7 +5805,7 @@
+ 					break;
+ 				}
+ 			}
+-			if (i < terminal->column_count - 1) {
++			if (i < (size_t)terminal->column_count - 1) {
+ 				/* We hit a stopping point, so stop. */
+ 				break;
+ 			} else {
+@@ -5499,7 +5843,7 @@
+ 			rowdata = _vte_ring_index(screen->row_data,
+ 						  VteRowData *, ec->y);
+ 			if (rowdata != NULL) {
+-				ec->x = MAX(ec->x, rowdata->cells->len);
++				ec->x = MAX((size_t)ec->x, rowdata->cells->len);
+ 			}
+ 		}
+ 		break;
+@@ -5598,7 +5942,7 @@
+ 	if (terminal->pvt->mouse_last_y < 0) {
+ 		if (terminal->adjustment) {
+ 			/* Try to scroll up by one line. */
+-			adj = CLAMP(terminal->adjustment->value - 1,
++			adj = (glong)CLAMP(terminal->adjustment->value - 1,
+ 				    terminal->adjustment->lower,
+ 				    terminal->adjustment->upper -
+ 				    terminal->row_count);
+@@ -5615,7 +5959,7 @@
+ 	    terminal->row_count * terminal->char_height) {
+ 		if (terminal->adjustment) {
+ 			/* Try to scroll up by one line. */
+-			adj = CLAMP(terminal->adjustment->value + 1,
++			adj = (glong)CLAMP(terminal->adjustment->value + 1,
+ 				    terminal->adjustment->lower,
+ 				    terminal->adjustment->upper -
+ 				    terminal->row_count);
+@@ -5799,8 +6143,8 @@
+ 	}
+ 
+ 	/* Convert the event coordinates to cell coordinates. */
+-	cellx = (event->x - VTE_PAD_WIDTH) / width;
+-	celly = (event->y - VTE_PAD_WIDTH) / height + delta;
++	cellx = (glong)((event->x - VTE_PAD_WIDTH) / width);
++	celly = (glong)((event->y - VTE_PAD_WIDTH) / height + delta);
+ 
+ 	switch (event->type) {
+ 	case GDK_BUTTON_PRESS:
+@@ -6302,7 +6646,7 @@
+  * Returns: a #PangoFontDescription describing the font the terminal is
+  * currently using to render text.
+  */
+-const PangoFontDescription *
++PangoFontDescription *
+ vte_terminal_get_font(VteTerminal *terminal)
+ {
+ 	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+@@ -6340,7 +6684,6 @@
+ void
+ vte_terminal_set_size(VteTerminal *terminal, glong columns, glong rows)
+ {
+-	struct winsize size;
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_MISC)) {
+@@ -6348,7 +6691,9 @@
+ 			columns, rows);
+ 	}
+ #endif
++#ifndef G_OS_WIN32
+ 	if (terminal->pvt->pty_master != -1) {
++		struct winsize size;
+ 		memset(&size, 0, sizeof(size));
+ 		size.ws_row = rows;
+ 		size.ws_col = columns;
+@@ -6357,7 +6702,9 @@
+ 			g_warning(_("Error setting PTY size: %s."),
+ 				    strerror(errno));
+ 		}
+-	} else {
++	} else 
++#endif
++	{
+ 		terminal->row_count = rows;
+ 		terminal->column_count = columns;
+ 	}
+@@ -6387,7 +6734,7 @@
+ 	gdk_window_freeze_updates(widget->window);
+ 
+ 	/* Read the new adjustment value and save the difference. */
+-	adj = floor(gtk_adjustment_get_value(terminal->adjustment));
++	adj = (glong)floor(gtk_adjustment_get_value(terminal->adjustment));
+ 	dy = adj - screen->scroll_delta;
+ 	screen->scroll_delta = adj;
+ 	if (dy != 0) {
+@@ -6474,7 +6821,7 @@
+ 	if (terminal->pvt->matcher != NULL) {
+ 		_vte_matcher_free(terminal->pvt->matcher);
+ 	}
+-	terminal->pvt->matcher = _vte_matcher_new(emulation, terminal->pvt->termcap);
++	terminal->pvt->matcher = _vte_matcher_new((char*)emulation, terminal->pvt->termcap);
+ 
+ 	/* Read emulation flags. */
+ 	terminal->pvt->flags.am = _vte_termcap_find_boolean(terminal->pvt->termcap,
+@@ -6545,19 +6892,30 @@
+ vte_terminal_set_termcap(VteTerminal *terminal, const char *path,
+ 			 gboolean reset)
+ {
+-	struct stat st;
+ 	char *wpath;
+ 	GQuark q = 0;
+ 
+ 	if (path == NULL) {
+-		wpath = g_strdup_printf(DATADIR "/" PACKAGE "/termcap/%s",
+-					terminal->pvt->emulation ?
+-					terminal->pvt->emulation :
+-					vte_terminal_get_default_emulation(terminal));
++#ifdef G_OS_WIN32
++                wpath = g_strdup_printf("%s\\%s",
++                                        g_win32_get_package_installation_subdirectory("vte", "vte", "share\\termcap"),
++                                        terminal->pvt->emulation ?
++                                        terminal->pvt->emulation :
++                                        vte_terminal_get_default_emulation(terminal));
++#else
++                wpath = g_strdup_printf("%s/%s",
++                                        DATADIR "/" PACKAGE "/termcap",
++                                        terminal->pvt->emulation ?
++                                        terminal->pvt->emulation :
++                                        vte_terminal_get_default_emulation(terminal));
++
++		struct stat st;
+ 		if (stat(wpath, &st) != 0) {
++			
+ 			g_free(wpath);
+ 			wpath = g_strdup("/etc/termcap");
+ 		}
++#endif
+ 		q = g_quark_from_string(wpath);
+ 		g_free(wpath);
+ 	} else {
+@@ -6574,10 +6932,10 @@
+ 	if (terminal->pvt->termcap) {
+ 		_vte_termcap_free(terminal->pvt->termcap);
+ 	}
+-	terminal->pvt->termcap = _vte_termcap_new(terminal->pvt->termcap_path);
++	terminal->pvt->termcap = _vte_termcap_new((char*)terminal->pvt->termcap_path);
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_MISC)) {
+-		fprintf(stderr, "\n");
++		printf( "\n");
+ 	}
+ #endif
+ 	if (reset) {
+@@ -6638,7 +6996,6 @@
+ {
+ 	GtkSettings *settings;
+ 	GObjectClass *klass;
+-	gpointer func;
+ 
+ 	gtk_widget_ensure_style(GTK_WIDGET(terminal));
+ 	settings = gtk_widget_get_settings(GTK_WIDGET(terminal));
+@@ -6656,22 +7013,21 @@
+ 	 * to the Xft settings. */
+ 	if (terminal->pvt->connected_settings == NULL) {
+ 		terminal->pvt->connected_settings = settings;
+-		func = (gpointer) vte_terminal_fc_settings_changed;
+ 		g_signal_connect(G_OBJECT(settings),
+ 				"notify::gtk-xft-antialias",
+-				G_CALLBACK(func), terminal);
++				G_CALLBACK(vte_terminal_fc_settings_changed), terminal);
+ 		g_signal_connect(G_OBJECT(settings),
+ 				"notify::gtk-xft-hinting",
+-				G_CALLBACK(func), terminal);
++				G_CALLBACK(vte_terminal_fc_settings_changed), terminal);
+ 		g_signal_connect(G_OBJECT(settings),
+ 				"notify::gtk-xft-hintstyle",
+-				G_CALLBACK(func), terminal);
++				G_CALLBACK(vte_terminal_fc_settings_changed), terminal);
+ 		g_signal_connect(G_OBJECT(settings),
+ 				"notify::gtk-xft-rgba",
+-				G_CALLBACK(func), terminal);
++				G_CALLBACK(vte_terminal_fc_settings_changed), terminal);
+ 		g_signal_connect(G_OBJECT(settings),
+ 				"notify::gtk-xft-dpi",
+-				G_CALLBACK(func), terminal);
++				G_CALLBACK(vte_terminal_fc_settings_changed), terminal);
+ 	}
+ }
+ 
+@@ -6710,8 +7066,7 @@
+ 	VteTerminalPrivate *pvt;
+ 	GtkWidget *widget;
+ 	GtkAdjustment *adjustment;
+-	struct timezone tz;
+-	struct timeval tv;
++	GTimeVal tv;
+ 
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+@@ -6806,6 +7161,7 @@
+ 	pvt->allow_bold = TRUE;
+ 	pvt->nrc_mode = TRUE;
+ 	vte_terminal_set_default_tabstops(terminal);
++	pvt->sync_mode = FALSE;
+ 
+ 	/* Scrolling options. */
+ 	pvt->scroll_on_keystroke = TRUE;
+@@ -6818,11 +7174,8 @@
+ 	pvt->cursor_blink_timeout = 1000;
+ 
+ 	/* Input options. */
+-	if (gettimeofday(&tv, &tz) == 0) {
++	g_get_current_time(&tv);
+ 		pvt->last_keypress_time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+-	} else {
+-		pvt->last_keypress_time = 0;
+-	}
+ 
+ 	/* Matching data. */
+ 	pvt->match_regexes = g_array_new(FALSE, TRUE,
+@@ -6844,7 +7197,7 @@
+ 	pvt->bg_tint_color.red = 0;
+ 	pvt->bg_tint_color.green = 0;
+ 	pvt->bg_tint_color.blue = 0;
+-	pvt->bg_saturation = 0.4 * VTE_SATURATION_MAX;
++	pvt->bg_saturation = (long)(0.4 * VTE_SATURATION_MAX);
+ 
+ 	/* Assume we're visible unless we're told otherwise. */
+ 	pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED;
+@@ -6870,6 +7223,7 @@
+ vte_terminal_size_request(GtkWidget *widget, GtkRequisition *requisition)
+ {
+ 	VteTerminal *terminal;
++  VteBg       *bg;
+ 
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+@@ -7056,9 +7410,11 @@
+ #else
+ 	bg = vte_bg_get_for_screen(NULL);
+ #endif
+-	g_signal_handlers_disconnect_by_func(G_OBJECT(bg),
++	if ( bg ) {
++		g_signal_handlers_disconnect_by_func(G_OBJECT(bg),
+ 					     root_pixmap_changed_cb,
+ 					     widget);
++	}
+ 
+ 	/* Deallocate the cursors. */
+ 	terminal->pvt->mouse_cursor_visible = FALSE;
+@@ -7099,6 +7455,9 @@
+ 
+ 	/* Remove the GDK window. */
+ 	if (widget->window != NULL) {
++		/* detach style */
++		gtk_style_detach(widget->style);
++
+ 	        gdk_window_set_user_data(widget->window, NULL);
+ 		gdk_window_destroy(widget->window);
+ 		widget->window = NULL;
+@@ -7135,7 +7494,7 @@
+ 	GtkWidgetClass *widget_class;
+ 	GtkClipboard *clipboard;
+ 	struct vte_match_regex *regex;
+-	int i;
++	size_t i;
+ 
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+@@ -7304,6 +7663,7 @@
+ 
+ 	/* Stop the child and stop watching for input from the child. */
+ 	if (terminal->pvt->pty_pid != -1) {
++#ifndef _WIN32
+ #ifdef HAVE_GETPGID
+ 		pid_t pgrp;
+ 		pgrp = getpgid(terminal->pvt->pty_pid);
+@@ -7312,6 +7672,7 @@
+ 		}
+ #endif
+ 		kill(terminal->pvt->pty_pid, SIGHUP);
++#endif
+ 	}
+ 	terminal->pvt->pty_pid = -1;
+ 	_vte_terminal_disconnect_pty_read(terminal);
+@@ -7524,13 +7885,17 @@
+ #else
+ 	bg = vte_bg_get_for_screen(NULL);
+ #endif
+-	g_signal_connect(G_OBJECT(bg),
++	if ( bg ) {
++		g_signal_connect(G_OBJECT(bg),
+ 			 "root-pixmap-changed",
+ 			 G_CALLBACK(root_pixmap_changed_cb),
+ 			 terminal);
++	}
+ 
+ 	/* Set up the background, *now*. */
+ 	vte_terminal_background_update(terminal);
++ 	
++ 	gtk_style_attach(widget->style, widget->window);
+ 
+ 	g_object_unref(G_OBJECT(bitmap));
+ }
+@@ -8756,7 +9121,8 @@
+ _vte_terminal_apply_pango_attr(VteTerminal *terminal, PangoAttribute *attr,
+ 			       struct vte_charcell *cells, gsize n_cells)
+ {
+-	int i, ival;
++	int ival;
++        gsize i;
+ 	PangoAttrInt *attrint;
+ 	PangoAttrColor *attrcolor;
+ 
+@@ -8826,7 +9192,7 @@
+ 	PangoAttribute *attr;
+ 	PangoAttrIterator *attriter;
+ 	GSList *list, *listiter;
+-	int i;
++	gsize i;
+ 
+ 	for (i = 0; i < n_cells; i++) {
+ 		cells[i] = terminal->pvt->screen->fill_defaults;
+@@ -8906,8 +9272,7 @@
+ static gboolean
+ vte_terminal_get_blink_state(VteTerminal *terminal)
+ {
+-	struct timezone tz;
+-	struct timeval tv;
++	GTimeVal tv;
+ 	gint blink_cycle = 1000;
+ 	GtkSettings *settings;
+ 	time_t daytime;
+@@ -8916,23 +9281,20 @@
+ 
+ 	/* Determine if blinking text should be shown. */
+ 	if (terminal->pvt->cursor_blinks) {
+-		if (gettimeofday(&tv, &tz) == 0) {
+-			widget = GTK_WIDGET(terminal);
+-			settings = gtk_widget_get_settings(widget);
+-			if (G_IS_OBJECT(settings)) {
+-				g_object_get(G_OBJECT(settings),
+-					     "gtk-cursor-blink-time",
+-					     &blink_cycle, NULL);
+-			}
+-			daytime = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+-			if (daytime >= terminal->pvt->last_keypress_time) {
+-				daytime -= terminal->pvt->last_keypress_time;
+-			}
+-			daytime = daytime % blink_cycle;
+-			blink = daytime < (blink_cycle / 2);
+-		} else {
+-			blink = TRUE;
++		g_get_current_time(&tv);
++		widget = GTK_WIDGET(terminal);
++		settings = gtk_widget_get_settings(widget);
++		if (G_IS_OBJECT(settings)) {
++			g_object_get(G_OBJECT(settings),
++					 "gtk-cursor-blink-time",
++					 &blink_cycle, NULL);
++		}
++		daytime = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
++		if (daytime >= terminal->pvt->last_keypress_time) {
++			daytime -= terminal->pvt->last_keypress_time;
+ 		}
++		daytime = daytime % blink_cycle;
++		blink = daytime < (blink_cycle / 2);
+ 	} else {
+ 		blink = TRUE;
+ 	}
+@@ -10354,7 +10716,7 @@
+ vte_terminal_set_background_saturation(VteTerminal *terminal, double saturation)
+ {
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+-	terminal->pvt->bg_saturation = CLAMP(saturation * VTE_SATURATION_MAX,
++	terminal->pvt->bg_saturation = (long)CLAMP(saturation * VTE_SATURATION_MAX,
+ 					     0, VTE_SATURATION_MAX);
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_MISC)) {
+@@ -10654,7 +11016,7 @@
+ 	char *ibuf, *ibufptr, *obuf, *obufptr;
+ 	gsize ilen, olen;
+ 	VteWordCharRange range;
+-	int i;
++	gsize i;
+ 
+ 	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+ 	/* Allocate a new range array. */
+@@ -11160,6 +11522,7 @@
+ void
+ vte_terminal_set_pty(VteTerminal *terminal, int pty_master)
+ {
++#ifndef _WIN32
+        GtkWidget *widget;
+        int i;
+ 
+@@ -11186,6 +11549,7 @@
+ 
+        /* Open channels to write output to. */
+        _vte_terminal_connect_pty_write(terminal);
++#endif
+ }
+ 
+ /* We need this bit of glue to ensure that accessible objects will always
+diff -Nur vte-0.12.1/src/vte.h vte-0.12.1.new/src/vte.h
+--- vte-0.12.1/src/vte.h	2006-04-20 13:18:55.000000000 +0200
++++ vte-0.12.1.new/src/vte.h	2006-10-20 19:22:48.663409832 +0200
+@@ -19,12 +19,17 @@
+ #ifndef vte_vte_h_included
+ #define vte_vte_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vte.h,v 1.78.4.2 2006/04/20 11:18:55 behdad Exp $"
++#endif
+ 
++#include "../config.h"
+ #include <sys/types.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifdef NO_XLIB
+ #include <X11/Xlib.h>
++#endif
+ #include <glib.h>
+ #include <pango/pango.h>
+ #include <gtk/gtk.h>
+@@ -203,6 +208,7 @@
+ 
+ /* You can get by with just these two functions. */
+ GtkWidget *vte_terminal_new(void);
++
+ pid_t vte_terminal_fork_command(VteTerminal *terminal,
+ 				const char *command, char **argv,
+ 				char **envv, const char *directory,
+@@ -223,6 +229,11 @@
+ void vte_terminal_feed_child(VteTerminal *terminal, const char *text, glong length);
+ void vte_terminal_feed_child_binary(VteTerminal *terminal, const char *data, glong length);
+ 
++char *vte_terminal_get_state(VteTerminal *terminal, int *len);
++void vte_terminal_set_state(VteTerminal *terminal, char *rows);
++char *vte_terminal_get_rawtext(VteTerminal *terminal, int *len);
++void vte_terminal_screenshot (VteTerminal *terminal, GObject *pixmap);
++
+ /* Copy currently-selected text to the clipboard, or from the clipboard to
+  * the terminal. */
+ void vte_terminal_copy_clipboard(VteTerminal *terminal);
+@@ -295,7 +306,7 @@
+ void vte_terminal_set_font_from_string_full(VteTerminal *terminal,
+ 					    const char *name,
+ 					    VteTerminalAntiAlias antialias);
+-const PangoFontDescription *vte_terminal_get_font(VteTerminal *terminal);
++PangoFontDescription *vte_terminal_get_font(VteTerminal *terminal);
+ gboolean vte_terminal_get_using_xft(VteTerminal *terminal);
+ void vte_terminal_set_allow_bold(VteTerminal *terminal, gboolean allow_bold);
+ gboolean vte_terminal_get_allow_bold(VteTerminal *terminal);
+@@ -406,6 +417,9 @@
+ const char *vte_terminal_get_window_title(VteTerminal *terminal);
+ const char *vte_terminal_get_icon_title(VteTerminal *terminal);
+ 
++void vte_terminal_set_sync(VteTerminal *terminal, gboolean sync);
++void vte_terminal_select_by_rawtext_pos(VteTerminal *terminal, glong frompos, glong topos);
++
+ G_END_DECLS
+ 
+ #endif
+diff -Nur vte-0.12.1/src/vteaccess.c vte-0.12.1.new/src/vteaccess.c
+--- vte-0.12.1/src/vteaccess.c	2006-03-15 12:02:59.000000000 +0100
++++ vte-0.12.1.new/src/vteaccess.c	2006-10-20 19:22:48.664409656 +0200
+@@ -19,7 +19,9 @@
+ /* VTE accessibility object.  Based heavily on inspection of libzvt's
+  * accessibility code. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteaccess.c,v 1.48 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+@@ -107,7 +109,7 @@
+ 	gint linebreak;
+ 	gint next_linebreak;
+ 
+-	if (y >= priv->snapshot_linebreaks->len)
++	if ((size_t)y >= priv->snapshot_linebreaks->len)
+ 		y = priv->snapshot_linebreaks->len -1;
+ 
+ 	linebreak = g_array_index (priv->snapshot_linebreaks, int, y);
+@@ -133,7 +135,7 @@
+ 
+ 	cur_x = -1;
+ 	cur_y = -1;
+-	for (i = 0; i < priv->snapshot_linebreaks->len; i++) {
++	for (i = 0; (size_t)i < priv->snapshot_linebreaks->len; i++) {
+ 		linebreak = g_array_index (priv->snapshot_linebreaks, int, i);
+ 		if (offset < linebreak) {
+ 			cur_x = offset - cur_offset;
+@@ -145,7 +147,7 @@
+ 		}
+ 	}
+ 	if (i == priv->snapshot_linebreaks->len) {
+-		if (offset <= priv->snapshot_characters->len) {
++		if ((size_t)offset <= priv->snapshot_characters->len) {
+ 			cur_x = offset - cur_offset;
+ 			cur_y = i - 1;
+ 		}
+@@ -355,7 +357,7 @@
+ 		/* Get the offsets to the beginnings of each character. */
+ 		i = 0;
+ 		next = priv->snapshot_text->str;
+-		while (i < priv->snapshot_attributes->len) {
++		while ((size_t)i < priv->snapshot_attributes->len) {
+ 			g_array_append_val(priv->snapshot_characters, i);
+ 			next = g_utf8_next_char(next);
+ 			if (next == NULL) {
+@@ -365,7 +367,7 @@
+ 			}
+ 		}
+ 		/* Find offsets for the beginning of lines. */
+-		for (i = 0, row = 0; i < priv->snapshot_characters->len; i++) {
++		for (i = 0, row = 0; (size_t)i < priv->snapshot_characters->len; i++) {
+ 			/* Get the attributes for the current cell. */
+ 			offset = g_array_index(priv->snapshot_characters,
+ 					       int, i);
+@@ -405,7 +407,7 @@
+ 
+ 	/* Get the offsets to the beginnings of each line. */
+ 	caret = -1;
+-	for (i = 0; i < priv->snapshot_characters->len; i++) {
++	for (i = 0; (size_t)i < priv->snapshot_characters->len; i++) {
+ 		/* Get the attributes for the current cell. */
+ 		offset = g_array_index(priv->snapshot_characters,
+ 				       int, i);
+@@ -568,7 +570,7 @@
+ 	if ((howmuch < 0) && (howmuch > -terminal->row_count)) {
+ 		howmuch = -howmuch;
+ 		/* Find the first byte that scrolled off. */
+-		for (i = 0; i < priv->snapshot_attributes->len; i++) {
++		for (i = 0; (size_t)i < priv->snapshot_attributes->len; i++) {
+ 			attr = g_array_index(priv->snapshot_attributes,
+ 					     struct _VteCharAttributes,
+ 					     i);
+@@ -576,7 +578,7 @@
+ 				break;
+ 			}
+ 		}
+-		if (i < priv->snapshot_attributes->len) {
++		if ((size_t)i < priv->snapshot_attributes->len) {
+ 			/* The rest of the string was deleted -- make a note. */
+ 			emit_text_changed_delete(G_OBJECT(data),
+ 						 priv->snapshot_text->str,
+@@ -606,7 +608,7 @@
+ 	 * from the top. */
+ 	if ((howmuch > 0) && (howmuch < terminal->row_count)) {
+ 		/* Find the first byte that wasn't scrolled off the top. */
+-		for (i = 0; i < priv->snapshot_attributes->len; i++) {
++		for (i = 0; (size_t)i < priv->snapshot_attributes->len; i++) {
+ 			attr = g_array_index(priv->snapshot_attributes,
+ 					     struct _VteCharAttributes,
+ 					     i);
+@@ -944,13 +946,13 @@
+ 
+ 	/* If the requested area is after all of the text, just return an
+ 	 * empty string. */
+-	if (start_offset >= priv->snapshot_characters->len) {
++	if ((size_t)start_offset >= priv->snapshot_characters->len) {
+ 		return g_strdup("");
+ 	}
+ 
+ 	/* Map the offsets to, er, offsets. */
+ 	start = g_array_index(priv->snapshot_characters, int, start_offset);
+-	if ((end_offset == -1) || (end_offset >= priv->snapshot_characters->len) ) {
++	if ((end_offset == -1) || ((size_t)end_offset >= priv->snapshot_characters->len) ) {
+ 		/* Get everything up to the end of the buffer. */
+ 		end = priv->snapshot_text->len;
+ 	} else {
+@@ -1016,7 +1018,7 @@
+ 			 * position, the one before it, or the one after it. */
+ 			offset += direction;
+ 			*start_offset = MAX(offset, 0);
+-			*end_offset = MIN(offset + 1,
++			*end_offset = MIN((size_t)offset + 1,
+ 					  priv->snapshot_attributes->len);
+ 			break;
+ 		case ATK_TEXT_BOUNDARY_WORD_START:
+@@ -1059,7 +1061,7 @@
+ 			 * non-word character, then the next word character
+ 			 * after that. */
+ 			if (direction == direction_next) {
+-				while (offset < priv->snapshot_characters->len) {
++				while ((size_t)offset < priv->snapshot_characters->len) {
+ 					next = vte_terminal_accessible_get_character_at_offset(text, offset);
+ 					if (vte_terminal_is_word_char(terminal, next)) {
+ 						offset++;
+@@ -1067,7 +1069,7 @@
+ 						break;
+ 					}
+ 				}
+-				while (offset < priv->snapshot_characters->len) {
++				while ((size_t)offset < priv->snapshot_characters->len) {
+ 					next = vte_terminal_accessible_get_character_at_offset(text, offset);
+ 					if (!vte_terminal_is_word_char(terminal, next)) {
+ 						offset++;
+@@ -1078,7 +1080,7 @@
+ 				*start_offset = offset;
+ 			}
+ 			/* Now find the end of this word. */
+-			while (offset < priv->snapshot_characters->len) {
++			while ((size_t)offset < priv->snapshot_characters->len) {
+ 				current = vte_terminal_accessible_get_character_at_offset(text, offset);
+ 				if (vte_terminal_is_word_char(terminal, current)) {
+ 					offset++;
+@@ -1096,7 +1098,7 @@
+ 			 * line we're looking for. */
+ 			line = 0;
+ 			for (line = 0;
+-			     line < priv->snapshot_linebreaks->len;
++			     (size_t)line < priv->snapshot_linebreaks->len;
+ 			     line++) {
+ 				if (g_array_index(priv->snapshot_linebreaks,
+ 						  int, line) > offset) {
+@@ -1112,13 +1114,13 @@
+ #endif
+ 			/* Perturb the line number to handle before/at/after. */
+ 			line += direction;
+-			line = CLAMP(line,
++			line = CLAMP((size_t)line,
+ 				     0, priv->snapshot_linebreaks->len - 1);
+ 			/* Read the offsets for this line. */
+ 			*start_offset = g_array_index(priv->snapshot_linebreaks,
+ 						      int, line);
+ 			line++;
+-			line = CLAMP(line,
++			line = CLAMP((size_t)line,
+ 				     0, priv->snapshot_linebreaks->len - 1);
+ 			*end_offset = g_array_index(priv->snapshot_linebreaks,
+ 						    int, line);
+@@ -1136,8 +1138,8 @@
+ 			*start_offset = *end_offset = 0;
+ 			break;
+ 	}
+-	*start_offset = MIN(*start_offset, priv->snapshot_characters->len - 1);
+-	*end_offset = CLAMP(*end_offset, *start_offset,
++	*start_offset = MIN((size_t)*start_offset, priv->snapshot_characters->len - 1);
++	*end_offset = CLAMP((size_t)*end_offset, (size_t)*start_offset,
+ 			    priv->snapshot_characters->len);
+ 	return vte_terminal_accessible_get_text(text,
+ 						*start_offset,
+@@ -1299,7 +1301,7 @@
+ 		}
+ 	}
+ 	*end_offset = priv->snapshot_attributes->len - 1;
+-	for (i = offset + 1; i < priv->snapshot_attributes->len; i++) {
++	for (i = offset + 1; (size_t)i < priv->snapshot_attributes->len; i++) {
+ 		cur_attr = g_array_index (priv->snapshot_attributes,
+ 				      struct _VteCharAttributes,
+ 				      i);
+@@ -1856,8 +1858,8 @@
+ 
+ 		/* Find the size of the parent type's objects. */
+ 		g_type_query(parent_accessible_type, &type_info);
+-		terminal_accessible_info.class_size = type_info.class_size;
+-		terminal_accessible_info.instance_size = type_info.instance_size;
++		terminal_accessible_info.class_size = (guint16)type_info.class_size;
++		terminal_accessible_info.instance_size = (guint16)type_info.instance_size;
+ 		/* Register the class with the GObject type system. */
+ 		terminal_accessible_type = g_type_register_static(parent_accessible_type,
+ 								  "VteTerminalAccessible",
+diff -Nur vte-0.12.1/src/vteaccess.h vte-0.12.1.new/src/vteaccess.h
+--- vte-0.12.1/src/vteaccess.h	2003-04-24 05:03:51.000000000 +0200
++++ vte-0.12.1.new/src/vteaccess.h	2006-10-20 19:22:48.665409479 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_vteaccess_h_included
+ #define vte_vteaccess_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vteaccess.h,v 1.6 2003/04/24 03:03:51 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ #include <gtk/gtk.h>
+diff -Nur vte-0.12.1/src/vteapp.c vte-0.12.1.new/src/vteapp.c
+--- vte-0.12.1/src/vteapp.c	2006-03-15 12:02:59.000000000 +0100
++++ vte-0.12.1.new/src/vteapp.c	2006-10-20 19:22:48.665409479 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteapp.c,v 1.77 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtebg.c vte-0.12.1.new/src/vtebg.c
+--- vte-0.12.1/src/vtebg.c	2006-10-20 19:22:48.189493371 +0200
++++ vte-0.12.1.new/src/vtebg.c	2006-10-20 19:22:48.666409303 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtebg.c,v 1.11 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ #include "../config.h"
+ #include <stdio.h>
+ #include <string.h>
+@@ -162,6 +164,7 @@
+ static GdkFilterReturn
+ vte_bg_root_filter(GdkXEvent *native, GdkEvent *event, gpointer data)
+ {
++#ifndef X_DISPLAY_MISSING
+ 	XEvent *xevent = (XEvent*) native;
+ 	VteBg *bg;
+ 	GdkPixmap *pixmap;
+@@ -178,6 +181,7 @@
+ 	default:
+ 		break;
+ 	}
++#endif;
+ 	return GDK_FILTER_CONTINUE;
+ }
+ 
+@@ -253,10 +257,11 @@
+ VteBg *
+ vte_bg_get_for_screen(gpointer screen)
+ {
++	VteBg       *bg = NULL;
++
++#ifndef X_DISPLAY_MISSING
+ 	GdkEventMask events;
+ 	GdkWindow   *window;
+-	VteBg       *bg;
+-
+ #if GTK_CHECK_VERSION(2,2,0)
+ 	bg = g_object_get_data(G_OBJECT(screen), "vte-bg");
+ 	if (G_UNLIKELY(bg == NULL)) {
+@@ -289,7 +294,8 @@
+ 		events |= GDK_PROPERTY_CHANGE_MASK;
+ 		gdk_window_set_events(window, events);
+ 		gdk_window_add_filter(window, vte_bg_root_filter, bg);
+-	}
++  	}
++#endif
+ #endif
+ 
+ 	return bg;
+@@ -324,9 +330,9 @@
+ 	/* Zero saturation -> exactly match the tinting color. */
+ 	if (saturation == 0) {
+ 		for (i = 0; i < 256; i++) {
+-			red[i] = color->red >> 8;
+-			green[i] = color->green >> 8;
+-			blue[i] = color->blue >> 8;
++			red[i] = (guchar)(color->red >> 8);
++			green[i] = (guchar)(color->green >> 8);
++			blue[i] = (guchar)(color->blue >> 8);
+ 		}
+ 		return;
+ 	}
+@@ -339,13 +345,13 @@
+ 	}
+ 	/* 0-100% saturation -> weighted average */
+ 	for (i = 0; i < 256; i++) {
+-		red[i] = CLAMP(((1.0 - saturation) * (color->red >> 8)) +
++		red[i] = (guchar)CLAMP(((1.0 - saturation) * (color->red >> 8)) +
+ 			       (saturation * i),
+ 			       0, 255);
+-		green[i] = CLAMP(((1.0 - saturation) * (color->green >> 8)) +
++		green[i] = (guchar)CLAMP(((1.0 - saturation) * (color->green >> 8)) +
+ 				 (saturation * i),
+ 				 0, 255);
+-		blue[i] = CLAMP(((1.0 - saturation) * (color->blue >> 8)) +
++		blue[i] = (guchar)CLAMP(((1.0 - saturation) * (color->blue >> 8)) +
+ 				(saturation * i),
+ 				0, 255);
+ 	}
+@@ -600,7 +606,9 @@
+ {
+ 	struct VteBgCacheItem *item;
+ 	GObject *cached;
++#ifndef X_DISPLAY_MISSING
+ 	GdkColormap *rcolormap;
++#endif
+ 	GdkPixmap *pixmap;
+ 	GdkBitmap *mask;
+ 	GdkPixbuf *pixbuf;
+@@ -629,6 +637,7 @@
+ 	pixmap = NULL;
+ 	file = NULL;
+ 
++#ifndef X_DISPLAY_MISSING
+ 	switch (source_type) {
+ 	case VTE_BG_SOURCE_ROOT:
+ 		if (GDK_IS_PIXMAP(bg->root_pixmap)) {
+@@ -683,6 +692,7 @@
+ 		g_assert_not_reached();
+ 		break;
+ 	}
++#endif
+ 
+ 	item->source_pixbuf = source_pixbuf;
+ 	if (G_IS_OBJECT(item->source_pixbuf)) {
+@@ -732,7 +742,9 @@
+ 	struct VteBgCacheItem *item;
+ 	GObject *cached;
+ 	GdkPixbuf *pixbuf;
++#ifndef X_DISPLAY_MISSING
+ 	GdkColormap *rcolormap;
++#endif
+ 	char *file;
+ 
+ 	if (source_type == VTE_BG_SOURCE_NONE) {
+@@ -757,6 +769,7 @@
+ 	pixbuf = NULL;
+ 	file = NULL;
+ 
++#ifndef X_DISPLAY_MISSING
+ 	switch (source_type) {
+ 	case VTE_BG_SOURCE_ROOT:
+ 		if (GDK_IS_PIXMAP(bg->root_pixmap)) {
+@@ -811,6 +824,7 @@
+ 		g_assert_not_reached();
+ 		break;
+ 	}
++#endif
+ 
+ 	item->source_pixbuf = pixbuf;
+ 	item->source_file = file;
+diff -Nur vte-0.12.1/src/vtebg.h vte-0.12.1.new/src/vtebg.h
+--- vte-0.12.1/src/vtebg.h	2006-10-20 19:22:48.189493371 +0200
++++ vte-0.12.1.new/src/vtebg.h	2006-10-20 19:22:48.666409303 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtebg.h,v 1.4 2003/05/19 22:48:58 nalin Exp $"
++#endif
+ 
+ #ifndef vte_vtebg_included
+ #define vte_vtebg_included
+diff -Nur vte-0.12.1/src/vteconv.c vte-0.12.1.new/src/vteconv.c
+--- vte-0.12.1/src/vteconv.c	2003-09-11 22:45:03.000000000 +0200
++++ vte-0.12.1.new/src/vteconv.c	2006-10-20 19:22:48.667409127 +0200
+@@ -18,7 +18,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteconv.c,v 1.5 2003/09/11 20:45:03 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ #include <sys/types.h>
+diff -Nur vte-0.12.1/src/vteconv.h vte-0.12.1.new/src/vteconv.h
+--- vte-0.12.1/src/vteconv.h	2003-09-11 22:45:03.000000000 +0200
++++ vte-0.12.1.new/src/vteconv.h	2006-10-20 19:22:48.667409127 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_vteconv_h_included
+ #define vte_vteconv_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vteconv.h,v 1.2 2003/09/11 20:45:03 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/vtedraw.c vte-0.12.1.new/src/vtedraw.c
+--- vte-0.12.1/src/vtedraw.c	2006-02-03 14:27:27.000000000 +0100
++++ vte-0.12.1.new/src/vtedraw.c	2006-10-20 19:22:48.667409127 +0200
+@@ -18,7 +18,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtedraw.c,v 1.17 2006/02/03 13:27:27 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtedraw.h vte-0.12.1.new/src/vtedraw.h
+--- vte-0.12.1/src/vtedraw.h	2004-04-20 07:16:56.000000000 +0200
++++ vte-0.12.1.new/src/vtedraw.h	2006-10-20 19:22:48.667409127 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_vtedraw_h_included
+ #define vte_vtedraw_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vtedraw.h,v 1.9 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include <glib.h>
+ #include <gtk/gtk.h>
+diff -Nur vte-0.12.1/src/vtefc.c vte-0.12.1.new/src/vtefc.c
+--- vte-0.12.1/src/vtefc.c	2006-10-20 19:22:48.132503417 +0200
++++ vte-0.12.1.new/src/vtefc.c	2006-10-20 19:22:48.668408951 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtefc.c,v 1.15 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+@@ -497,7 +501,11 @@
+ }
+ 
+ void
++#ifdef MEGSEM_NEKEM_VAN_IGAZAM
+ _vte_fc_connect_settings_changes(GtkWidget *widget, GCallback *changed_cb)
++#else
++_vte_fc_connect_settings_changes(GtkWidget *widget, GCallback changed_cb)
++#endif
+ {
+ 	GtkSettings *settings;
+ 	GObjectClass *klass;
+diff -Nur vte-0.12.1/src/vtefc.h vte-0.12.1.new/src/vtefc.h
+--- vte-0.12.1/src/vtefc.h	2004-04-20 07:16:56.000000000 +0200
++++ vte-0.12.1.new/src/vtefc.h	2006-10-20 19:22:48.668408951 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_vtefc_h_included
+ #define vte_vtefc_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vtefc.h,v 1.4 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include <fontconfig/fontconfig.h>
+ #include <pango/pango.h>
+@@ -40,7 +42,11 @@
+ 				      _vte_fc_defaults_cb defaults_cb,
+ 				      gpointer defaults_data);
+ 
++#ifdef MEGSEM_NEKEM_VAN_IGAZAM
+ void _vte_fc_connect_settings_changes(GtkWidget *widget, GCallback *changed_cb);
++#else
++void _vte_fc_connect_settings_changes(GtkWidget *widget, GCallback changed_cb);
++#endif
+ void _vte_fc_disconnect_settings_changes(GtkWidget *widget,
+ 					 GCallback *changed_cb);
+ 
+diff -Nur vte-0.12.1/src/vteft2.c vte-0.12.1.new/src/vteft2.c
+--- vte-0.12.1/src/vteft2.c	2006-10-20 19:22:48.194492490 +0200
++++ vte-0.12.1.new/src/vteft2.c	2006-10-20 19:22:48.668408951 +0200
+@@ -16,11 +16,15 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteft2.c,v 1.11 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
++#ifndef _WIN32
+ #include <sys/param.h>
++#endif
+ #include <string.h>
+ #include <gtk/gtk.h>
+ #include <glib.h>
+@@ -176,7 +180,7 @@
+ 
+ 	data = (struct _vte_ft2_data*) draw->impl_data;
+ 
+-	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get_for_screen(screen),
++ 	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get_for_screen(screen),
+ 				     type, pixbuf, file,
+ 				     color, saturation);
+ 	if (GDK_IS_PIXBUF(data->pixbuf)) {
+@@ -293,7 +297,7 @@
+ 
+ 	data = (struct _vte_ft2_data*) draw->impl_data;
+ 
+-	for (i = 0; i < n_requests; i++) {
++	for (i = 0; (size_t)i < n_requests; i++) {
+ 		_vte_glyph_draw(data->cache, requests[i].c, color,
+ 				requests[i].x, requests[i].y,
+ 				requests[i].columns,
+diff -Nur vte-0.12.1/src/vteft2.h vte-0.12.1.new/src/vteft2.h
+--- vte-0.12.1/src/vteft2.h	2003-05-06 01:27:13.000000000 +0200
++++ vte-0.12.1.new/src/vteft2.h	2006-10-20 19:22:48.669408774 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteft2.h,v 1.2 2003/05/05 23:27:13 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
+diff -Nur vte-0.12.1/src/vtegl.c vte-0.12.1.new/src/vtegl.c
+--- vte-0.12.1/src/vtegl.c	2006-10-20 19:22:48.195492314 +0200
++++ vte-0.12.1.new/src/vtegl.c	2006-10-20 19:22:48.669408774 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtegl.c,v 1.15 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtegl.h vte-0.12.1.new/src/vtegl.h
+--- vte-0.12.1/src/vtegl.h	2003-05-06 01:23:46.000000000 +0200
++++ vte-0.12.1.new/src/vtegl.h	2006-10-20 19:22:48.669408774 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtegl.h,v 1.2 2003/05/05 23:23:46 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
+diff -Nur vte-0.12.1/src/vteglyph.c vte-0.12.1.new/src/vteglyph.c
+--- vte-0.12.1/src/vteglyph.c	2004-04-20 07:16:56.000000000 +0200
++++ vte-0.12.1.new/src/vteglyph.c	2006-10-20 19:22:48.670408598 +0200
+@@ -16,11 +16,15 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteglyph.c,v 1.14 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
++#ifndef _WIN32
+ #include <sys/param.h>
++#endif
+ #include <math.h>
+ #include <gdk/gdk.h>
+ #include <glib.h>
+@@ -98,7 +102,7 @@
+ 
+ 	/* Destroy the patterns. */
+ 	if (cache->patterns != NULL) {
+-		for (i = 0; i < cache->patterns->len; i++) {
++		for (i = 0; (size_t)i < cache->patterns->len; i++) {
+ 			FcPatternDestroy(g_array_index(cache->patterns,
+ 						       FcPattern*,
+ 						       i));
+@@ -189,7 +193,7 @@
+ 	cache->ft_render_flags = 0;
+ 
+ 	/* Open the all of the faces to which the patterns resolve. */
+-	for (i = 0; i < cache->patterns->len; i++) {
++	for (i = 0; (size_t)i < cache->patterns->len; i++) {
+ 		pattern = g_array_index(cache->patterns, FcPattern*, i);
+ 		j = 0;
+ 		while (FcPatternGetString(pattern, FC_FILE, j,
+@@ -210,8 +214,8 @@
+ 				FcPatternGetDouble(pattern, FC_DPI, 0, &dpi);
+ 				size = 12;
+ 				FcPatternGetDouble(pattern, FC_SIZE, 0, &size);
+-				FT_Set_Char_Size(face, 0, floor(size * 64.0),
+-						 floor(dpi), floor(dpi));
++				FT_Set_Char_Size(face, 0, (FT_F26Dot6)floor(size * 64.0),
++						 (FT_UInt)floor(dpi), (FT_UInt)floor(dpi));
+ 				cache->faces = g_list_append(cache->faces,
+ 							     face);
+ 			} else {
+@@ -537,20 +541,20 @@
+ #endif
+ #endif
+ 			ioffset += (x / 8);
+-			t = (face->glyph->bitmap.buffer[ioffset] << (x % 8));
++			t = (guchar)((face->glyph->bitmap.buffer[ioffset] << (x % 8)));
+ 			r = g = b = (t >> 7) ? 0xff : 0;
+ 			break;
+ #if HAVE_DECL_FT_PIXEL_MODE_GRAY2
+ 		case FT_PIXEL_MODE_GRAY2:
+ 			ioffset += (x / 4);
+-			t = (face->glyph->bitmap.buffer[ioffset] << ((x % 4) * 2));
++			t = (guchar)((face->glyph->bitmap.buffer[ioffset] << ((x % 4) * 2)));
+ 			r = g = b = CLAMP((t >> 6) * 0x55, 0, 0xff);
+ 			break;
+ #endif
+ #if HAVE_DECL_FT_PIXEL_MODE_GRAY4
+ 		case FT_PIXEL_MODE_GRAY4:
+ 			ioffset += (x / 2);
+-			t = (face->glyph->bitmap.buffer[ioffset] << ((x % 2) * 4)) & 7;
++			t = (guchar)((face->glyph->bitmap.buffer[ioffset] << ((x % 2) * 4)) & 7);
+ 			r = g = b = CLAMP((t >> 4) * 0x25, 0, 0xff);
+ 			break;
+ #endif
+@@ -710,11 +714,11 @@
+ 			case 0:
+ 				break;
+ 			case 0xff:
+-				pixels[ooffset + 0] = r;
++				pixels[ooffset + 0] = (guchar)r;
+ 				break;
+ 			default:
+ 				pixels[ooffset + 0] +=
+-					(((r - pixels[ooffset + 0]) * ar) >> 8);
++					(guchar)(((r - pixels[ooffset + 0]) * ar) >> 8);
+ 				break;
+ 			}
+ 
+@@ -722,11 +726,11 @@
+ 			case 0:
+ 				break;
+ 			case 0xff:
+-				pixels[ooffset + 1] = g;
++				pixels[ooffset + 1] = (guchar)g;
+ 				break;
+ 			default:
+ 				pixels[ooffset + 1] +=
+-					(((g - pixels[ooffset + 1]) * ag) >> 8);
++					(guchar)(((g - pixels[ooffset + 1]) * ag) >> 8);
+ 				break;
+ 			}
+ 
+@@ -734,11 +738,11 @@
+ 			case 0:
+ 				break;
+ 			case 0xff:
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 2] = (guchar)b;
+ 				break;
+ 			default:
+ 				pixels[ooffset + 2] +=
+-					(((b - pixels[ooffset + 2]) * ab) >> 8);
++					(guchar)(((b - pixels[ooffset + 2]) * ab) >> 8);
+ 				break;
+ 			}
+ 
+@@ -755,38 +759,38 @@
+ 			    (strikethrough < cache->height)) {
+ 				ooffset = (y + strikethrough) * buffer->stride +
+ 					  (x + col) * 3;
+-				pixels[ooffset + 0] = r;
+-				pixels[ooffset + 1] = g;
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 0] = (guchar)r;
++				pixels[ooffset + 1] = (guchar)g;
++				pixels[ooffset + 2] = (guchar)b;
+ 			}
+ 			if ((flags & vte_glyph_underline) &&
+ 			    (underline >= 0) &&
+ 			    (underline < cache->height)) {
+ 				ooffset = (y + underline) * buffer->stride +
+ 					  (x + col) * 3;
+-				pixels[ooffset + 0] = r;
+-				pixels[ooffset + 1] = g;
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 0] = (guchar)r;
++				pixels[ooffset + 1] = (guchar)g;
++				pixels[ooffset + 2] = (guchar)b;
+ 			}
+ 			if ((flags & vte_glyph_underline2) &&
+ 			    (underline2 >= 0) &&
+ 			    (underline2 < cache->height)) {
+ 				ooffset = (y + underline2) * buffer->stride +
+ 					  (x + col) * 3;
+-				pixels[ooffset + 0] = r;
+-				pixels[ooffset + 1] = g;
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 0] = (guchar)r;
++				pixels[ooffset + 1] = (guchar)g;
++				pixels[ooffset + 2] = (guchar)b;
+ 			}
+ 			if (flags & vte_glyph_boxed) {
+ 				ooffset = y * buffer->stride + (x + col) * 3;
+-				pixels[ooffset + 0] = r;
+-				pixels[ooffset + 1] = g;
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 0] = (guchar)r;
++				pixels[ooffset + 1] = (guchar)g;
++				pixels[ooffset + 2] = (guchar)b;
+ 				ooffset = (y + cache->height - 1) * buffer->stride +
+ 					  (x + col) * 3;
+-				pixels[ooffset + 0] = r;
+-				pixels[ooffset + 1] = g;
+-				pixels[ooffset + 2] = b;
++				pixels[ooffset + 0] = (guchar)r;
++				pixels[ooffset + 1] = (guchar)g;
++				pixels[ooffset + 2] = (guchar)b;
+ 			}
+ 		}
+ 	}
+diff -Nur vte-0.12.1/src/vteglyph.h vte-0.12.1.new/src/vteglyph.h
+--- vte-0.12.1/src/vteglyph.h	2004-04-20 07:16:56.000000000 +0200
++++ vte-0.12.1.new/src/vteglyph.h	2006-10-20 19:22:48.670408598 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_vteglyph_h_included
+ #define vte_vteglyph_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vteglyph.h,v 1.7 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include <gtk/gtk.h>
+ #include "vtefc.h"
+diff -Nur vte-0.12.1/src/vteint.h vte-0.12.1.new/src/vteint.h
+--- vte-0.12.1/src/vteint.h	2005-08-10 15:29:12.000000000 +0200
++++ vte-0.12.1.new/src/vteint.h	2006-10-20 19:22:48.670408598 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_vteint_h_included
+ #define vte_vteint_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vteint.h,v 1.2 2005/08/10 13:29:12 kmaraas Exp $"
++#endif
+ 
+ #include "vte.h"
+ 
+diff -Nur vte-0.12.1/src/vtepango.c vte-0.12.1.new/src/vtepango.c
+--- vte-0.12.1/src/vtepango.c	2006-10-20 19:22:48.195492314 +0200
++++ vte-0.12.1.new/src/vtepango.c	2006-10-20 19:22:48.671408422 +0200
+@@ -16,11 +16,15 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtepango.c,v 1.17 2005/07/25 08:49:42 kmaraas Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
++#ifndef _WIN32
+ #include <sys/param.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -403,7 +407,7 @@
+ 			   &wcolor);
+ 	gdk_gc_set_foreground(data->gc, &wcolor);
+ 
+-	for (i = 0; i < n_requests; i++) {
++	for (i = 0; (size_t)i < n_requests; i++) {
+ 		length = g_unichar_to_utf8(requests[i].c, buf);
+ 		pango_layout_set_text(data->layout, buf, length);
+ 		gdk_draw_layout(draw->widget->window, data->gc,
+diff -Nur vte-0.12.1/src/vtepango.h vte-0.12.1.new/src/vtepango.h
+--- vte-0.12.1/src/vtepango.h	2003-05-06 01:27:13.000000000 +0200
++++ vte-0.12.1.new/src/vtepango.h	2006-10-20 19:22:48.671408422 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtepango.h,v 1.2 2003/05/05 23:27:13 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
+diff -Nur vte-0.12.1/src/vtepangox.c vte-0.12.1.new/src/vtepangox.c
+--- vte-0.12.1/src/vtepangox.c	2006-10-20 19:22:48.195492314 +0200
++++ vte-0.12.1.new/src/vtepangox.c	2006-10-20 19:22:48.671408422 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtepangox.c,v 1.14 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtepangox.h vte-0.12.1.new/src/vtepangox.h
+--- vte-0.12.1/src/vtepangox.h	2003-05-06 01:27:13.000000000 +0200
++++ vte-0.12.1.new/src/vtepangox.h	2006-10-20 19:22:48.671408422 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtepangox.h,v 1.2 2003/05/05 23:27:13 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
+diff -Nur vte-0.12.1/src/vterdb.c vte-0.12.1.new/src/vterdb.c
+--- vte-0.12.1/src/vterdb.c	2005-10-02 11:59:42.000000000 +0200
++++ vte-0.12.1.new/src/vterdb.c	2006-10-20 19:22:48.672408246 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vterdb.c,v 1.9 2005/10/02 09:59:42 kmaraas Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vterdb.h vte-0.12.1.new/src/vterdb.h
+--- vte-0.12.1/src/vterdb.h	2003-05-29 01:45:09.000000000 +0200
++++ vte-0.12.1.new/src/vterdb.h	2006-10-20 19:22:48.672408246 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vterdb.h,v 1.3 2003/05/28 23:45:09 nalin Exp $"
++#endif
+ 
+ #ifndef vte_rdbh_included
+ #define vte_rdbh_included
+diff -Nur vte-0.12.1/src/vteregex.c vte-0.12.1.new/src/vteregex.c
+--- vte-0.12.1/src/vteregex.c	2004-04-20 07:08:43.000000000 +0200
++++ vte-0.12.1.new/src/vteregex.c	2006-10-20 19:22:48.672408246 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteregex.c,v 1.2 2004/04/20 05:08:43 nalin Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <errno.h>
+diff -Nur vte-0.12.1/src/vteregex.h vte-0.12.1.new/src/vteregex.h
+--- vte-0.12.1/src/vteregex.h	2005-02-15 11:56:16.000000000 +0100
++++ vte-0.12.1.new/src/vteregex.h	2006-10-20 19:22:48.672408246 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_vteregex_h_included
+ #define vte_vteregex_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vteregex.h,v 1.2 2005/02/15 10:56:16 kmaraas Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/vtergb.c vte-0.12.1.new/src/vtergb.c
+--- vte-0.12.1/src/vtergb.c	2003-04-21 04:50:46.000000000 +0200
++++ vte-0.12.1.new/src/vtergb.c	2006-10-20 19:22:48.673408069 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtergb.c,v 1.2 2003/04/21 02:50:46 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtergb.h vte-0.12.1.new/src/vtergb.h
+--- vte-0.12.1/src/vtergb.h	2003-05-06 01:23:46.000000000 +0200
++++ vte-0.12.1.new/src/vtergb.h	2006-10-20 19:22:48.673408069 +0200
+@@ -19,7 +19,9 @@
+ #ifndef vte_vte_rgbh_included
+ #define vte_vte_rgbh_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vtergb.h,v 1.2 2003/05/05 23:23:46 nalin Exp $"
++#endif
+ 
+ #include <gdk/gdk.h>
+ #include <glib.h>
+diff -Nur vte-0.12.1/src/vteseq.c vte-0.12.1.new/src/vteseq.c
+--- vte-0.12.1/src/vteseq.c	2006-03-27 03:55:17.000000000 +0200
++++ vte-0.12.1.new/src/vteseq.c	2006-10-20 19:22:48.675407717 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteseq.c,v 1.3 2006/03/27 01:55:17 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+@@ -72,7 +74,7 @@
+ 	screen = terminal->pvt->screen;
+ 	if (_vte_ring_contains(screen->row_data, row)) {
+ 		rowdata = _vte_ring_index(screen->row_data, VteRowData *, row);
+-		if (rowdata->cells->len > col) {
++		if (rowdata->cells->len > (size_t)col) {
+ 			ret = &g_array_index(rowdata->cells,
+ 					     struct vte_charcell,
+ 					     col);
+@@ -1100,7 +1102,7 @@
+ 			GValueArray *params)
+ {
+ 	VteRowData *rowdata;
+-	long i;
++	int i;
+ 	VteScreen *screen;
+ 	struct vte_charcell *pcell;
+ 	screen = terminal->pvt->screen;
+@@ -1114,7 +1116,7 @@
+ 	 * attributes.  If there is no such character cell, we need
+ 	 * to add one. */
+ 	for (i = 0; i <= screen->cursor_current.col; i++) {
+-		if (i < rowdata->cells->len) {
++		if ((size_t)i < rowdata->cells->len) {
+ 			/* Muck with the cell in this location. */
+ 			pcell = &g_array_index(rowdata->cells,
+ 					       struct vte_charcell,
+@@ -1144,7 +1146,7 @@
+ 			GValueArray *params)
+ {
+ 	VteRowData *rowdata;
+-	long i;
++	int i;
+ 	VteScreen *screen;
+ 
+ 	screen = terminal->pvt->screen;
+@@ -1156,7 +1158,7 @@
+ 		rowdata = _vte_ring_index(screen->row_data, VteRowData *, i);
+ 		/* Clear everything to the right of the cursor. */
+ 		if ((rowdata != NULL) &&
+-		    (rowdata->cells->len > screen->cursor_current.col)) {
++		    (rowdata->cells->len > (size_t)screen->cursor_current.col)) {
+ 			g_array_set_size(rowdata->cells,
+ 					 screen->cursor_current.col);
+ 		}
+@@ -1218,7 +1220,7 @@
+ 	g_assert(rowdata != NULL);
+ 	/* Remove the data at the end of the array until the current column
+ 	 * is the end of the array. */
+-	if (rowdata->cells->len > screen->cursor_current.col) {
++	if (rowdata->cells->len > (size_t)screen->cursor_current.col) {
+ 		g_array_set_size(rowdata->cells, screen->cursor_current.col);
+ 	}
+ 	/* Add enough cells to the end of the line to fill out the row. */
+@@ -1556,7 +1558,7 @@
+ 		g_assert(rowdata != NULL);
+ 		col = screen->cursor_current.col;
+ 		/* Remove the column. */
+-		if (col < rowdata->cells->len) {
++		if ((size_t)col < rowdata->cells->len) {
+ 			g_array_remove_index(rowdata->cells, col);
+ 		}
+ 		/* Add new cells until we have enough to fill the row. */
+@@ -1726,7 +1728,7 @@
+ 		for (i = 0; i < count; i++) {
+ 			col = screen->cursor_current.col + i;
+ 			if (col >= 0) {
+-				if (col < rowdata->cells->len) {
++				if ((size_t)col < rowdata->cells->len) {
+ 					/* Replace this cell with the current
+ 					 * defaults. */
+ 					cell = &g_array_index(rowdata->cells,
+@@ -3151,7 +3153,8 @@
+ 			      GQuark match_quark,
+ 			      GValueArray *params)
+ {
+-	int i, again;
++	int again;
++        size_t i;
+ 	long setting;
+ 	GValue *value;
+ 	if ((params == NULL) || (params->n_values == 0)) {
+@@ -3186,7 +3189,7 @@
+ 		return FALSE;
+ 	}
+ 	again = 0;
+-	for (i = 0; i < params->n_values; i++) {
++	for (i = 0; (size_t)i < params->n_values; i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3214,7 +3217,7 @@
+ 		return FALSE;
+ 	}
+ 	again = 0;
+-	for (i = 0; i < params->n_values; i++) {
++	for (i = 0; (size_t)i < params->n_values; i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3242,7 +3245,7 @@
+ 		return FALSE;
+ 	}
+ 	again = 0;
+-	for (i = 0; i < params->n_values; i++) {
++	for (i = 0; (size_t)i < params->n_values; i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3280,7 +3283,7 @@
+ 	/* The default parameter is 0. */
+ 	param = 0;
+ 	/* Pull out a parameter. */
+-	for (i = 0; (params != NULL) && (i < params->n_values); i++) {
++	for (i = 0; (params != NULL) && ((size_t)i < params->n_values); i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3334,7 +3337,7 @@
+ 	/* The default parameter is 0. */
+ 	param = 0;
+ 	/* Pull out a parameter. */
+-	for (i = 0; (params != NULL) && (i < params->n_values); i++) {
++	for (i = 0; (params != NULL) && ((size_t)i < params->n_values); i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3616,7 +3619,7 @@
+ 		return FALSE;
+ 	}
+ 	again = 0;
+-	for (i = 0; i < params->n_values; i++) {
++	for (i = 0; (size_t)i < params->n_values; i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -3644,7 +3647,7 @@
+ 		return FALSE;
+ 	}
+ 	again = 0;
+-	for (i = 0; i < params->n_values; i++) {
++	for (i = 0; (size_t)i < params->n_values; i++) {
+ 		value = g_value_array_get_nth(params, i);
+ 		if (!G_VALUE_HOLDS_LONG(value)) {
+ 			continue;
+@@ -4009,8 +4012,10 @@
+ 				  GQuark match_quark,
+ 				  GValueArray *params)
+ {
++#ifndef _WIN32
+ 	g_warning(_("Got unexpected (key?) sequence `%s'."),
+ 		  match ? match : "???");
++#endif
+ 	return FALSE;
+ }
+ 
+diff -Nur vte-0.12.1/src/vteskel.c vte-0.12.1.new/src/vteskel.c
+--- vte-0.12.1/src/vteskel.c	2004-04-20 07:16:56.000000000 +0200
++++ vte-0.12.1.new/src/vteskel.c	2006-10-20 19:22:48.675407717 +0200
+@@ -16,11 +16,15 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteskel.c,v 1.10 2004/04/20 05:16:56 nalin Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
++#ifndef _WIN32
+ #include <sys/param.h>
++#endif
+ #include <stdio.h>
+ #include <string.h>
+ #include <gtk/gtk.h>
+diff -Nur vte-0.12.1/src/vteskel.h vte-0.12.1.new/src/vteskel.h
+--- vte-0.12.1/src/vteskel.h	2003-05-06 01:27:13.000000000 +0200
++++ vte-0.12.1.new/src/vteskel.h	2006-10-20 19:22:48.675407717 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vteskel.h,v 1.2 2003/05/05 23:27:13 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
+diff -Nur vte-0.12.1/src/vtetc.c vte-0.12.1.new/src/vtetc.c
+--- vte-0.12.1/src/vtetc.c	2006-01-15 22:09:41.000000000 +0100
++++ vte-0.12.1.new/src/vtetc.c	2006-10-20 19:22:48.676407541 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtetc.c,v 1.6 2006/01/15 21:09:41 gpastore Exp $"
++#endif
+ #include "../config.h"
+ #include <sys/types.h>
+ #include <ctype.h>
+@@ -253,7 +255,7 @@
+ 				case '0':
+ 				case '1':
+ 					i++;
+-					ret[o - 1] = strtol(termcap + i, &p, 8);
++					ret[o - 1] = (char)strtol(termcap + i, &p, 8);
+ 					p--;
+ 					i = p - termcap;
+ 					continue;
+diff -Nur vte-0.12.1/src/vtetc.h vte-0.12.1.new/src/vtetc.h
+--- vte-0.12.1/src/vtetc.h	2005-03-14 15:43:47.000000000 +0100
++++ vte-0.12.1.new/src/vtetc.h	2006-10-20 19:22:48.676407541 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_termcap_h_included
+ #define vte_termcap_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vtetc.h,v 1.2 2005/03/14 14:43:47 kmaraas Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/vtetree.h vte-0.12.1.new/src/vtetree.h
+--- vte-0.12.1/src/vtetree.h	2005-03-02 09:48:59.000000000 +0100
++++ vte-0.12.1.new/src/vtetree.h	2006-10-20 19:22:48.676407541 +0200
+@@ -21,7 +21,9 @@
+ #ifndef vte_tree_h_included
+ #define vte_tree_h_included
+ 
++#ifndef _WIN32
+ #ident "$Id: vtetree.h,v 1.1 2005/03/02 08:48:59 kmaraas Exp $"
++#endif
+ 
+ #include <glib.h>
+ 
+diff -Nur vte-0.12.1/src/vtexft.c vte-0.12.1.new/src/vtexft.c
+--- vte-0.12.1/src/vtexft.c	2006-10-20 19:22:48.196492137 +0200
++++ vte-0.12.1.new/src/vtexft.c	2006-10-20 19:22:48.677407364 +0200
+@@ -16,7 +16,9 @@
+  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtexft.c,v 1.25 2006/03/15 11:02:59 behdad Exp $"
++#endif
+ 
+ #include "../config.h"
+ 
+diff -Nur vte-0.12.1/src/vtexft.h vte-0.12.1.new/src/vtexft.h
+--- vte-0.12.1/src/vtexft.h	2003-05-06 01:27:13.000000000 +0200
++++ vte-0.12.1.new/src/vtexft.h	2006-10-20 19:22:48.677407364 +0200
+@@ -21,7 +21,9 @@
+ 
+ /* The interfaces in this file are subject to change at any time. */
+ 
++#ifndef _WIN32
+ #ident "$Id: vtexft.h,v 1.2 2003/05/05 23:27:13 nalin Exp $"
++#endif
+ 
+ #include "vtedraw.h"
+ 
--- vte-0.12.1.orig/debian/patches/08_set_backspace_to_utf8.patch
+++ vte-0.12.1/debian/patches/08_set_backspace_to_utf8.patch
@@ -0,0 +1,14 @@
+--- src/vte.c.orig	2004-12-20 00:57:39 -0800
++++ src/vte.c	2004-12-20 00:57:44 -0800
+@@ -7125,7 +7125,11 @@
+ 		break;
+ 	default:
+ 		if (pid != 0) {
++			char *codeset;
+ 			terminal->pvt->pty_master = i;
++			g_get_charset(&codeset);
++			_vte_pty_set_utf8(terminal->pvt->pty_master,
++					  (strcmp(codeset, "UTF-8") == 0));
+ 		}
+ 	}
+ 
--- vte-0.12.1.orig/debian/patches/99_zzzad.unichar.patch
+++ vte-0.12.1/debian/patches/99_zzzad.unichar.patch
@@ -0,0 +1,32 @@
+--- vte-0.12.1.eredeti/python/vte.override	2006-11-30 17:15:06.000000000 +0100
++++ vte-0.12.1/python/vte.override	2006-11-30 17:20:48.000000000 +0100
+@@ -580,15 +580,26 @@
+ static PyObject *
+ _wrap_vte_terminal_get_rawtext(PyGObject *self)
+ {
+-    const gchar *ret;
++    gunichar *ret;
+     PyObject *tmp;
+     int len = 0;
+ 
+-    ret = vte_terminal_get_rawtext(VTE_TERMINAL(self->obj), &len);
++    ret = (gunichar *) vte_terminal_get_rawtext(VTE_TERMINAL(self->obj), &len);
+     if (ret)
+     {
++#if 0
+         tmp = PyUnicode_FromUnicode((const Py_UNICODE*)ret, len/sizeof(gunichar));
+-        g_free((gpointer)ret);
++#else
++	Py_UNICODE *wstr;
++       gint i, len_in_unichars = len / sizeof(gunichar);
++
++	wstr = g_malloc(sizeof(Py_UNICODE) * len_in_unichars);
++	for (i = 0; i < len_in_unichars; i++)
++	  wstr[i] = (Py_UNICODE) ret[i];
++	tmp = PyUnicode_FromUnicode(wstr, len_in_unichars);
++       g_free(wstr);
++#endif
++        g_free(ret);
+         return(tmp);
+     }
+     Py_INCREF(Py_None);
--- vte-0.12.1.orig/debian/patches/91_keep_fds.patch
+++ vte-0.12.1/debian/patches/91_keep_fds.patch
@@ -0,0 +1,62 @@
+diff -Nur vte-0.11.15/src/pty.c vte-0.11.15.new/src/pty.c
+--- vte-0.11.15/src/pty.c	2005-08-22 11:11:41.000000000 -0400
++++ vte-0.11.15.new/src/pty.c	2005-10-28 15:57:23.000000000 -0400
+@@ -395,6 +395,25 @@
+ 	return 0;
+ }
+ 
++static int
++_vte_pty_keep_fd(char **env_add)
++{
++   int i, res = -1;
++   if(env_add == NULL)
++      return res;
++
++   const gchar *needle="VTE_PTY_KEEP_FD=";
++   for(i=0; env_add[i] != NULL; i++) {
++      gchar *s = strstr(env_add[i],needle);
++      if(s != NULL) {
++	 res = atoi(&s[strlen(needle)]);
++	 break;
++      }
++   }
++   return res;
++}
++
++
+ /* Open the named PTY slave, fork off a child (storing its PID in child),
+  * and exec the named command in its own session as a process group leader */
+ static int
+@@ -433,11 +452,15 @@
+ 		setsid();
+ 		setpgid(0, 0);
+ 
++		
++		int keep_fd = _vte_pty_keep_fd(env_add);
+ 		/* Close most descriptors. */
+ 		for (i = 0; i < sysconf(_SC_OPEN_MAX); i++) {
+-			if ((i != ready_b[0]) && (i != ready_a[1])) {
+-				close(i);
+-			}
++		   if ((i != ready_b[0]) && 
++		       (i != ready_a[1]) && 
++		       (i != keep_fd)) {
++		      close(i);
++		   }
+ 		}
+ 
+ 		/* Open the slave PTY, acquiring it as the controlling terminal
+@@ -537,10 +560,12 @@
+ 		/* Start a new session and become process-group leader. */
+ 		setsid();
+ 		setpgid(0, 0);
+-
++		
++		int keep_fd = _vte_pty_keep_fd(env_add);
+ 		/* Close all other descriptors. */
+ 		for (i = 0; i < sysconf(_SC_OPEN_MAX); i++) {
+ 			if ((i != fd) &&
++			    (i != keep_fd) && 
+ 			    (i != ready_b[0]) &&
+ 			    (i != ready_a[1])) {
+ 				close(i);
--- vte-0.12.1.orig/debian/patches/09_multiscreen_safe.patch
+++ vte-0.12.1/debian/patches/09_multiscreen_safe.patch
@@ -0,0 +1,374 @@
+diff -r -u src.orig/vtebg.c src/vtebg.c
+--- src.orig/vtebg.c	2004-04-19 23:35:43 -0700
++++ src/vtebg.c	2004-12-19 18:56:14 -0800
+@@ -37,7 +37,9 @@
+ 	GList *cache;
+ };
+ 
+-static VteBg *singleton_bg = NULL;
++#if !GTK_CHECK_VERSION(2,2,0)
++static VteBg *singlehead_bg = NULL;
++#endif
+ static void vte_bg_set_root_pixmap(VteBg *bg, GdkPixmap *pixmap);
+ static void vte_bg_init(VteBg *bg, gpointer *klass);
+ static GdkPixbuf *_vte_bg_resize_pixbuf(GdkPixbuf *pixbuf,
+@@ -70,7 +72,9 @@
+ #include <gdk/gdkx.h>
+ 
+ struct VteBgNative {
++#if GTK_CHECK_VERSION(2,2,0)
+ 	GdkDisplay *display;
++#endif
+ 	GdkWindow *window;
+ 	XID native_window;
+ 	GdkAtom atom;
+@@ -81,18 +85,19 @@
+ vte_bg_native_new(GdkWindow *window)
+ {
+ 	struct VteBgNative *pvt;
+-	Atom atom;
++
+ 	pvt = g_malloc0(sizeof(struct VteBgNative));
+ 	pvt->window = window;
+ 	pvt->native_window = gdk_x11_drawable_get_xid(window);
+-	pvt->atom = gdk_atom_intern("_XROOTPMAP_ID", FALSE);
++
+ #if GTK_CHECK_VERSION(2,2,0)
+-	atom = gdk_x11_atom_to_xatom_for_display(gdk_drawable_get_display(window),
+-						 pvt->atom);
++	pvt->display = gdk_drawable_get_display(GDK_DRAWABLE(window));
++	pvt->native_atom = gdk_x11_get_xatom_by_name_for_display(pvt->display, "_XROOTPMAP_ID");
++	pvt->atom = gdk_x11_xatom_to_atom_for_display(pvt->display, pvt->native_atom);
+ #else
+-	atom = gdk_x11_atom_to_xatom(pvt->atom);
++	pvt->atom = gdk_atom_intern("_XROOTPMAP_ID", FALSE);
++	pvt->native_atom = gdk_x11_atom_to_xatom(pvt->atom);
+ #endif
+-	pvt->native_atom = atom;
+ 	return pvt;
+ }
+ 
+@@ -100,7 +105,7 @@
+ _vte_bg_display_sync(VteBg *bg)
+ {
+ #if GTK_CHECK_VERSION(2,2,0)
+-	gdk_display_sync(gdk_drawable_get_display(bg->native->window));
++	gdk_display_sync(bg->native->display);
+ #else
+ 	XSync(GDK_DISPLAY(), FALSE);
+ #endif
+@@ -136,7 +141,7 @@
+ 		    (prop_size >= sizeof(XID) &&
+ 		    (pixmaps != NULL))) {
+ #if GTK_CHECK_VERSION(2,2,0)
+-			pixmap = gdk_pixmap_foreign_new_for_display(gdk_drawable_get_display(bg->native->window), pixmaps[0]);
++			pixmap = gdk_pixmap_foreign_new_for_display(bg->native->display, pixmaps[0]);
+ #else
+ 			pixmap = gdk_pixmap_foreign_new(pixmaps[0]);
+ #endif
+@@ -244,6 +249,7 @@
+ 
+ /**
+  * vte_bg_get:
++ * @screen : A #GdkScreen.
+  *
+  * Finds the address of the global #VteBg object, creating the object if
+  * necessary.
+@@ -251,12 +257,48 @@
+  * Returns: the global #VteBg object
+  */
+ VteBg *
+-vte_bg_get(void)
++vte_bg_get_for_screen(gpointer screen)
+ {
+-	if (!VTE_IS_BG(singleton_bg)) {
+-		singleton_bg = g_object_new(VTE_TYPE_BG, NULL);
++	GdkEventMask events;
++	GdkWindow   *window;
++	VteBg       *bg;
++
++#if GTK_CHECK_VERSION(2,2,0)
++	bg = g_object_get_data(G_OBJECT(screen), "vte-bg");
++	if (G_UNLIKELY(bg == NULL)) {
++		bg = g_object_new(VTE_TYPE_BG, NULL);
++		g_object_set_data(G_OBJECT(screen), "vte-bg", bg);
++
++		/* connect bg to screen */
++		bg->screen = screen;
++		window = gdk_screen_get_root_window(screen);
++		bg->native = vte_bg_native_new(window);
++		bg->root_pixmap = vte_bg_root_pixmap(bg);
++		bg->pvt = g_malloc0(sizeof(struct VteBgPrivate));
++		bg->pvt->cache = NULL;
++		events = gdk_window_get_events(window);
++		events |= GDK_PROPERTY_CHANGE_MASK;
++		gdk_window_set_events(window, events);
++		gdk_window_add_filter(window, vte_bg_root_filter, bg);
+ 	}
+-	return singleton_bg;
++#else
++	if (G_UNLIKELY(singlehead_bg == NULL)) {
++		bg = g_object_new(VTE_TYPE_BG, NULL);
++		singlehead_bg = bg;
++
++		window = gdk_get_default_root_window();
++		bg->native = vte_bg_native_new(window);
++		bg->root_pixmap = vte_bg_root_pixmap(bg);
++		bg->pvt = g_malloc0(sizeof(struct VteBgPrivate));
++		bg->pvt->cache = NULL;
++		events = gdk_window_get_events(window);
++		events |= GDK_PROPERTY_CHANGE_MASK;
++		gdk_window_set_events(window, events);
++		gdk_window_add_filter(window, vte_bg_root_filter, bg);
++	}
++#endif
++
++	return bg;
+ }
+ 
+ struct VteBgCacheItem {
+@@ -274,17 +316,6 @@
+ static void
+ vte_bg_init(VteBg *bg, gpointer *klass)
+ {
+-	GdkWindow *window;
+-	GdkEventMask events;
+-	window = gdk_get_default_root_window();
+-	bg->native = vte_bg_native_new(window);
+-	bg->root_pixmap = vte_bg_root_pixmap(bg);
+-	bg->pvt = g_malloc0(sizeof(struct VteBgPrivate));
+-	bg->pvt->cache = NULL;
+-	events = gdk_window_get_events(window);
+-	events |= GDK_PROPERTY_CHANGE_MASK;
+-	gdk_window_set_events(window, events);
+-	gdk_window_add_filter(window, vte_bg_root_filter, bg);
+ }
+ 
+ /* Generate lookup tables for desaturating an image toward a given color.  The
+@@ -581,10 +612,6 @@
+ 	GdkPixbuf *pixbuf;
+ 	char *file;
+ 
+-	if (bg == NULL) {
+-		bg = vte_bg_get();
+-	}
+-
+ 	if (source_type == VTE_BG_SOURCE_NONE) {
+ 		return NULL;
+ 	}
+@@ -614,7 +641,11 @@
+ 			int width, height;
+ 			/* Tell GTK+ that this foreign pixmap shares the
+ 			 * root window's colormap. */
++#if GTK_CHECK_VERSION(2,2,0)
++			rcolormap = gdk_drawable_get_colormap(gdk_screen_get_root_window(bg->screen));
++#else
+ 			rcolormap = gdk_drawable_get_colormap(gdk_get_default_root_window());
++#endif
+ 			if (gdk_drawable_get_colormap(bg->root_pixmap) == NULL) {
+ 				gdk_drawable_set_colormap(bg->root_pixmap,
+ 							  rcolormap);
+@@ -710,10 +741,6 @@
+ 	GdkColormap *rcolormap;
+ 	char *file;
+ 
+-	if (bg == NULL) {
+-		bg = vte_bg_get();
+-	}
+-
+ 	if (source_type == VTE_BG_SOURCE_NONE) {
+ 		return NULL;
+ 	}
+@@ -743,7 +770,11 @@
+ 
+ 			/* If the pixmap doesn't have a colormap, tell GTK+ that
+ 			 * it shares the root window's colormap. */
++#if GTK_CHECK_VERSION(2,2,0)
++			rcolormap = gdk_drawable_get_colormap(gdk_screen_get_root_window(bg->screen));
++#else
+ 			rcolormap = gdk_drawable_get_colormap(gdk_get_default_root_window());
++#endif
+ 			if (gdk_drawable_get_colormap(bg->root_pixmap) == NULL) {
+ 				gdk_drawable_set_colormap(bg->root_pixmap, rcolormap);
+ 			}
+diff -r -u src.orig/vtebg.h src/vtebg.h
+--- src.orig/vtebg.h	2003-05-19 15:48:58 -0700
++++ src/vtebg.h	2004-12-19 18:56:14 -0800
+@@ -30,6 +30,7 @@
+ typedef struct _VteBg VteBg;
+ struct _VteBg {
+ 	GObject parent;
++	gpointer screen;
+ 	GdkPixmap *root_pixmap;
+ 	struct VteBgNative *native;
+ 	struct VteBgPrivate *pvt;
+@@ -50,7 +51,7 @@
+ 
+ GType vte_bg_get_type(void);
+ 
+-VteBg *vte_bg_get(void);
++VteBg *vte_bg_get_for_screen(gpointer screen);
+ 
+ enum VteBgSourceType {
+ 	VTE_BG_SOURCE_NONE,
+diff -r -u src.orig/vte.c src/vte.c
+--- src.orig/vte.c	2004-05-01 23:43:01 -0700
++++ src/vte.c	2004-12-19 18:56:14 -0800
+@@ -11653,6 +11653,7 @@
+ vte_terminal_unrealize(GtkWidget *widget)
+ {
+ 	VteTerminal *terminal;
++  VteBg       *bg;
+ 
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+@@ -11671,7 +11672,12 @@
+ 	terminal->pvt->draw = NULL;
+ 
+ 	/* Disconnect from background-change events. */
+-	g_signal_handlers_disconnect_by_func(G_OBJECT(vte_bg_get()),
++#if GTK_CHECK_VERSION(2,2,0)
++	bg = vte_bg_get_for_screen(gtk_widget_get_screen(widget));
++#else
++	bg = vte_bg_get_for_screen(NULL);
++#endif
++	g_signal_handlers_disconnect_by_func(G_OBJECT(bg),
+ 					     root_pixmap_changed_cb,
+ 					     widget);
+ 
+@@ -12007,6 +12013,7 @@
+ 	GtkSettings *settings;
+ 	int attributes_mask = 0, i;
+ 	gint blink_cycle = 1000;
++	VteBg *bg;
+ 
+ #ifdef VTE_DEBUG
+ 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+@@ -12145,7 +12152,12 @@
+ 									0, 0);
+ 
+ 	/* Connect to background-change events. */
+-	g_signal_connect(G_OBJECT(vte_bg_get()),
++#if GTK_CHECK_VERSION(2,2,0)
++	bg = vte_bg_get_for_screen(gtk_widget_get_screen(widget));
++#else
++	bg = vte_bg_get_for_screen(NULL);
++#endif
++	g_signal_connect(G_OBJECT(bg),
+ 			 "root-pixmap-changed",
+ 			 G_CALLBACK(root_pixmap_changed_cb),
+ 			 terminal);
+Only in src/: vte.c.orig
+diff -r -u src.orig/vteft2.c src/vteft2.c
+--- src.orig/vteft2.c	2004-04-19 22:16:56 -0700
++++ src/vteft2.c	2004-12-19 18:56:14 -0800
+@@ -166,10 +166,18 @@
+ {
+ 	struct _vte_ft2_data *data;
+ 	GdkPixbuf *bgpixbuf;
++	gpointer screen;
++
++#if GTK_CHECK_VERSION(2,2,0)
++	screen = gtk_widget_get_screen(draw->widget);
++#else
++	screen = NULL;
++#endif
+ 
+ 	data = (struct _vte_ft2_data*) draw->impl_data;
+ 
+-	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get(), type, pixbuf, file,
++	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get_for_screen(screen),
++				     type, pixbuf, file,
+ 				     color, saturation);
+ 	if (GDK_IS_PIXBUF(data->pixbuf)) {
+ 		g_object_unref(G_OBJECT(data->pixbuf));
+diff -r -u src.orig/vtegl.c src/vtegl.c
+--- src.orig/vtegl.c	2004-04-19 22:16:56 -0700
++++ src/vtegl.c	2004-12-19 18:56:14 -0800
+@@ -279,9 +279,17 @@
+ {
+ 	struct _vte_gl_data *data;
+ 	GdkPixbuf *bgpixbuf;
++	gpointer screen;
++
++#if GTK_CHECK_VERSION(2,2,0)
++	screen = gtk_widget_get_screen(draw->widget);
++#else
++	screen = NULL;
++#endif
+ 
+ 	data = (struct _vte_gl_data*) draw->impl_data;
+-	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get(), type, pixbuf, file,
++	bgpixbuf = vte_bg_get_pixbuf(vte_bg_get_for_screen(screen),
++			 	     type, pixbuf, file,
+ 				     tint, saturation);
+ 	if (GDK_IS_PIXBUF(data->bgpixbuf)) {
+ 		g_object_unref(G_OBJECT(data->bgpixbuf));
+diff -r -u src.orig/vtepango.c src/vtepango.c
+--- src.orig/vtepango.c	2004-04-19 22:16:56 -0700
++++ src/vtepango.c	2004-12-19 18:56:14 -0800
+@@ -194,9 +194,17 @@
+ {
+ 	GdkPixmap *pixmap;
+ 	struct _vte_pango_data *data;
++	gpointer screen;
++
++#if GTK_CHECK_VERSION(2,2,0)
++	screen = gtk_widget_get_screen(draw->widget);
++#else
++	screen = NULL;
++#endif
+ 
+ 	data = (struct _vte_pango_data*) draw->impl_data;
+-	pixmap = vte_bg_get_pixmap(vte_bg_get(), type, pixbuf, file,
++	pixmap = vte_bg_get_pixmap(vte_bg_get_for_screen(screen),
++				   type, pixbuf, file,
+ 				   color, saturation,
+ 				   _vte_draw_get_colormap(draw, TRUE));
+ 	if (GDK_IS_PIXMAP(data->pixmap)) {
+diff -r -u src.orig/vtepangox.c src/vtepangox.c
+--- src.orig/vtepangox.c	2004-04-19 22:16:56 -0700
++++ src/vtepangox.c	2004-12-19 18:56:14 -0800
+@@ -207,9 +207,17 @@
+ {
+ 	GdkPixmap *pixmap;
+ 	struct _vte_pango_x_data *data;
++	gpointer screen;
++
++#if GTK_CHECK_VERSION(2,2,0)
++	screen = gtk_widget_get_screen (draw->widget);
++#else
++	screen = NULL;
++#endif
+ 
+ 	data = (struct _vte_pango_x_data*) draw->impl_data;
+-	pixmap = vte_bg_get_pixmap(vte_bg_get(), type, pixbuf, file,
++	pixmap = vte_bg_get_pixmap(vte_bg_get_for_screen(screen),
++				   type, pixbuf, file,
+ 				   color, saturation,
+ 				   _vte_draw_get_colormap(draw, TRUE));
+ 	if (data->pixmap) {
+diff -r -u src.orig/vtexft.c src/vtexft.c
+--- src.orig/vtexft.c	2004-04-19 22:16:56 -0700
++++ src/vtexft.c	2004-12-19 18:56:14 -0800
+@@ -451,12 +451,19 @@
+ {
+ 	struct _vte_xft_data *data;
+ 	GdkPixmap *pixmap;
++	gpointer screen;
+ 
+ 	data = (struct _vte_xft_data*) draw->impl_data;
+ 
++#if GTK_CHECK_VERSION(2,2,0)
++	screen = gtk_widget_get_screen (draw->widget);
++#else
++	screen = NULL;
++#endif
++
+ 	data->xpixmap = -1;
+ 	data->pixmapw = data->pixmaph = 0;
+-	pixmap = vte_bg_get_pixmap(vte_bg_get(), type,
++	pixmap = vte_bg_get_pixmap(vte_bg_get_for_screen(screen), type,
+ 				   pixbuf, file, color, saturation,
+ 				   _vte_draw_get_colormap(draw, TRUE));
+ 	if (GDK_IS_PIXMAP(data->pixmap)) {
--- vte-0.12.1.orig/debian/patches/92_python_reaper.patch
+++ vte-0.12.1/debian/patches/92_python_reaper.patch
@@ -0,0 +1,61 @@
+diff -Nur vte-0.11.15/python/vte.defs vte-0.11.15.new/python/vte.defs
+--- vte-0.11.15/python/vte.defs	2004-04-29 22:41:55.000000000 -0400
++++ vte-0.11.15.new/python/vte.defs	2005-10-28 15:59:50.000000000 -0400
+@@ -7,6 +7,14 @@
+   (gtype-id "VTE_TYPE_TERMINAL")
+ )
+ 
++(define-object Reaper
++  (in-module "Vte")
++  (parent "GObject")
++  (c-name "VteReaper")
++  (gtype-id "VTE_TYPE_REAPER")
++)
++
++
+ ;; Enumerations and flags ...
+ 
+ (define-enum TerminalEraseBinding
+@@ -665,3 +673,13 @@
+ )
+ 
+ 
++;; From ../src/reaper.h
++(define-function vte_reaper_get_type
++  (c-name "vte_reaper_get_type")
++  (return-type "GtkType")
++)
++
++(define-function reaper_get
++  (c-name "vte_reaper_get")
++  (return-type "VteReaper")
++)
+diff -Nur vte-0.11.15/python/vte.override vte-0.11.15.new/python/vte.override
+--- vte-0.11.15/python/vte.override	2005-10-28 15:59:45.000000000 -0400
++++ vte-0.11.15.new/python/vte.override	2005-10-28 15:59:50.000000000 -0400
+@@ -6,12 +6,14 @@
+ #include <pygobject.h>
+ #include <gtk/gtk.h>
+ #include "../src/vte.h"
++#include "../src/reaper.h"
+ %%
+ modulename vte
+ %%
+ import gtk.gdk.Pixbuf as PyGdkPixbuf_Type
+ import gtk.MenuShell as PyGtkMenuShell_Type
+ import gtk.Widget as PyGtkWidget_Type
++import gobject.GObject as PyGObject_Type
+ %%
+ override vte_terminal_feed kwargs
+ static PyObject *
+diff -Nur vte-0.11.15/python/vtemodule.c vte-0.11.15.new/python/vtemodule.c
+--- vte-0.11.15/python/vtemodule.c	2005-03-17 01:43:44.000000000 -0500
++++ vte-0.11.15.new/python/vtemodule.c	2005-10-28 15:59:50.000000000 -0400
+@@ -25,6 +25,7 @@
+ #include <pygobject.h>
+ #include <pygtk/pygtk.h>
+ #include "../src/vte.h"
++#include "../src/reaper.h"
+ 
+ extern void pyvte_register_classes(PyObject * d);
+ extern PyMethodDef pyvte_functions[];
--- vte-0.12.1.orig/debian/copyright
+++ vte-0.12.1/debian/copyright
@@ -0,0 +1,28 @@
+This package was debianized by Christian Marillat <marillat@debian.org> on
+Sun, 21 Jul 2002 16:30:57 +0200.
+
+It was downloaded from http://people.redhat.com/nalin/vte/
+
+Upstream Author: Nalin Dahyabhai <nalin@redhat.com>
+
+Copyright: 2002 Nalin Dahyabhai
+
+License:
+
+    This package is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This package 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
--- vte-0.12.1.orig/Makefile.am
+++ vte-0.12.1/Makefile.am
@@ -1,6 +1,7 @@
-SUBDIRS = src python termcaps po doc
+SUBDIRS = src python termcaps po doc winbuild
 EXTRA_DIST = MAINTAINERS HACKING vte.spec vte.pc.in vte-uninstalled.pc.in \
-	     intltool-extract.in intltool-merge.in intltool-update.in
+	     intltool-extract.in intltool-merge.in intltool-update.in \
+	     makefile.msc simple-patchsys.mk
 DISTCLEANFILES = intltool-extract intltool-merge intltool-update
 
 if BUILD_GNOME_PTY_HELPER
--- vte-0.12.1.orig/winbuild/Makefile.am
+++ vte-0.12.1/winbuild/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST=build.bat
--- vte-0.12.1.orig/winbuild/build.bat
+++ vte-0.12.1/winbuild/build.bat
@@ -0,0 +1,35 @@
+rem @echo off
+rem man this sucks.
+set VERSION=0.12.1-0ubuntu1.zorpos3
+call c:\build\cygwin.bat
+if not %ERRORLEVEL%==0 goto exitt
+call c:\build\pygtk-dev.bat
+if not %ERRORLEVEL%==0 goto exitt
+call c:\build\gtkdev.bat
+if not %ERRORLEVEL%==0 goto exitt
+make -f simple-patchsys.mk apply-patches
+if not %ERRORLEVEL%==0 goto exitt
+nmake -f makefile.msc clean ROOT=%COMPILE_ENV%
+if not %ERRORLEVEL%==0 goto exitt
+nmake -f makefile.msc ROOT=%COMPILE_ENV%
+if not %ERRORLEVEL%==0 goto exitt
+	
+FOR /F "TOKENS=1" %%D IN ('cd') DO set @dirname=%%D
+cd %COMPILE_ENV%\out
+
+set DRV=%COMPILE_ENV:~0,2%
+%DRV%
+
+if not %ERRORLEVEL%==0 goto exitt
+zip -q -m -r ..\vte\libvte4_%VERSION%_i386.zip bin\*.*
+if not %ERRORLEVEL%==0 goto exitt
+zip -q -m -r ..\vte\python-vte_%VERSION%_i386.zip python\*.*
+if not %ERRORLEVEL%==0 goto exitt
+zip -q -m -r ..\vte\libvte-dev_%VERSION%_i386.zip lib\*.* include\*.* debug\*.*
+if not %ERRORLEVEL%==0 goto exitt
+
+dir ..\vte
+
+:exitt
+exit %ERRORLEVEL%
+
--- vte-0.12.1.orig/python/makefile.msc
+++ vte-0.12.1/python/makefile.msc
@@ -0,0 +1,44 @@
+## Use: nmake -f makefile.msc
+!IFNDEF COMPILE_ENV
+COMPILE_ENV=c:\build
+!ENDIF
+
+!INCLUDE $(COMPILE_ENV)\include\make.msc
+ROOT= $(COMPILE_ENV)\out
+################################################################
+
+INCLUDES = -DNDEBUG -DTHREADING -FI$(TOP)\include\msvc_recommended_pragmas.h $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS) -I . -I..\src
+DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS) $(INTL_CFLAGS) $(LIBGLADE_CFLAGS) $(GLIB_CFLAGS) $(LIBXML_CFLAGS) $(GTK2_CFLAGS) 
+
+LDFLAGS=$(INTL_LIBS) $(LIBICONV_LIBS) $(DIRENT_LIBS) $(INTL_LIBS) $(LIBGLADE_LIBS) $(GLIB_LIBS) $(LIBXML_LIBS) $(GTK2_LIBS) $(FONTSTUFF_LIBS) $(ATK_LIBS) $(REGEX_LIBS)
+LDFLAGS=$(LDFLAGS) /LIBPATH:../src libvte.lib $(PYTHONROOT)\libs\python24.lib /INCREMENTAL:NO
+PDBFILE=vte.pdb
+DLLFILE=vte.pyd
+
+CFLAGS = $(CFLAGS) /GX /Fd$(PDBFILE) -DG_DISABLE_ASSERT
+all: install
+
+OUTPUTS = 			\
+	$(LIBFILE)
+	
+VTE_OBJECTS =			\
+	vte.obj \
+	vtemodule.obj
+		
+all: install
+
+vte.c: def2c.bat vte.defs vte.override
+	def2c.bat
+
+$(DLLFILE):  $(VTE_OBJECTS)
+	$(LINK) /dll /out:$(DLLFILE) $(VTE_OBJECTS) $(LDFLAGS)
+
+clean::
+	-del /q vte.c >NUL 2>&1
+	-del /q *.pyd >NUL 2>&1
+	
+install: $(DLLFILE)
+	if not exist $(ROOT)\python mkdir $(ROOT)\python
+	if not exist $(ROOT)\python\Lib mkdir $(ROOT)\python\Lib
+	if not exist $(ROOT)\python\Lib\site-packages mkdir $(ROOT)\python\Lib\site-packages 
+	copy /y .\$(DLLFILE) $(ROOT)\python\Lib\site-packages 
--- vte-0.12.1.orig/python/Makefile.am
+++ vte-0.12.1/python/Makefile.am
@@ -1,4 +1,4 @@
-EXTRA_DIST = vte.defs vte.override cat.py unrealize.py vte-demo.py
+EXTRA_DIST = vte.defs vte.override cat.py unrealize.py vte-demo.py def2c.bat makefile.msc
 
 PYTHON_MODULES = vtemodule.la
 
--- vte-0.12.1.orig/python/def2c.bat
+++ vte-0.12.1/python/def2c.bat
@@ -0,0 +1,5 @@
+
+set DEFSDIR=%PYTHONROOT%\share\pygtk\2.0\defs\
+%PYTHONROOT%\python.exe %PYTHONROOT%\share\pygtk\2.0\codegen\codegen.py --register %DEFSDIR%\pango-types.defs --register %DEFSDIR%\gdk-types.defs --register %DEFSDIR%\gtk-types.defs --override vte.override --prefix pyvte vte.defs > vte.c
+
+
--- vte-0.12.1.orig/config.sub.cdbs-orig
+++ vte-0.12.1/config.sub.cdbs-orig
@@ -0,0 +1,1566 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-02-10'
+
+# 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>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# 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, 2002, 2003, 2004, 2005
+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* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+    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 | -knuth | -cray)
+		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] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| msp430 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| 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]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| msp430-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
+	| 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
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	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
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	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
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	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 | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	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
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	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
+		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	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 | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`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
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-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=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	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
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	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
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	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 | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv8 | 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
+		;;
+	*-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* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -ekkobsd* | -kfreebsd* | -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* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|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-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-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
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-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
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-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
+		;;
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
+	# This must come before the *-dec entry.
+	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
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-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
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-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
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				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:
