diff -ruN putty-0.56.orig/config.c putty-0.56/config.c
--- putty-0.56.orig/config.c	Sun Oct 24 15:37:32 2004
+++ putty-0.56/config.c	Tue Jan 25 17:07:22 2005
@@ -360,6 +360,8 @@
 		    *cfg = cfg2;       /* structure copy */
 		    cfg->remote_cmd_ptr = cfg->remote_cmd; /* nasty */
 		    dlg_end(dlg, 1);
+		    /* fg: looks like there is a return missing */
+		    return;
 		} else
 		    dlg_beep(dlg);
 	    }
diff -ruN putty-0.56.orig/unix/buildos2.cmd putty-0.56/unix/buildos2.cmd
--- putty-0.56.orig/unix/buildos2.cmd	Thu Jan  1 00:00:00 1970
+++ putty-0.56/unix/buildos2.cmd	Tue Jan 25 17:07:22 2005
@@ -0,0 +1,9 @@
+@echo off
+setlocal
+call ..\..\setenv302.cmd
+path=e:\usr\x11r6\bin;e:\xfree86\bin;%PATH%
+rem make -f Makefile.os2 SHELL=sh.exe puttytel.exe 2>&1 |tee make.log
+rem make -f Makefile.os2 SHELL=sh.exe pterm.exe 2>&1 |tee make.log
+rem make -f Makefile.os2 SHELL=sh.exe putty.exe 2>&1 |tee make.log
+make -f Makefile.os2 SHELL=sh.exe %1 2>&1 |tee make.log
+endlocal
diff -ruN putty-0.56.orig/unix/gtkdlg.c putty-0.56/unix/gtkdlg.c
--- putty-0.56.orig/unix/gtkdlg.c	Mon Aug 30 15:23:22 2004
+++ putty-0.56/unix/gtkdlg.c	Tue Jan 25 17:07:22 2005
@@ -2044,6 +2044,10 @@
 		assert(j == ctrl_path_elements(s->pathname) - 1);
 
 		c = strrchr(s->pathname, '/');
+#ifdef __EMX__
+		if (!c)
+		    c = strrchr(s->pathname, '\\');
+#endif		
 		if (!c)
 		    c = s->pathname;
 		else
@@ -2082,7 +2086,10 @@
 		gtk_container_add(GTK_CONTAINER(panels), panelvbox);
 		if (first) {
 		    panels_switch_to(PANELS(panels), panelvbox);
+#ifndef __EMX__
+/* Why does this segfault?? */
 		    gtk_tree_select_child(GTK_TREE(tree), treeitem);
+#endif
 		}
 
 		if (nselparams >= selparamsize) {
@@ -2128,6 +2135,9 @@
 
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     gtk_widget_show(window);
+#ifdef __EMX__
+    gtk_tree_select_item(GTK_TREE(tree),0);
+#endif
 
     /*
      * Set focus into the first available control.
diff -ruN putty-0.56.orig/unix/Makefile.os2 putty-0.56/unix/Makefile.os2
--- putty-0.56.orig/unix/Makefile.os2	Thu Jan  1 00:00:00 1970
+++ putty-0.56/unix/Makefile.os2	Tue Jan 25 17:07:22 2005
@@ -0,0 +1,668 @@
+# Makefile for putty under X/GTK and Unix.
+#
+# This file was created by `mkfiles.pl' from the `Recipe' file.
+# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.
+#
+# Extra options you can set:
+#
+#  - FWHACK=-DFWHACK
+#      Enables a hack that tunnels through some firewall proxies.
+#
+#  - VER=-DSNAPSHOT=1999-01-25
+#      Generates executables whose About box report them as being a
+#      development snapshot.
+#
+#  - VER=-DRELEASE=0.43
+#      Generates executables whose About box report them as being a
+#      release version.
+#
+#  - COMPAT=-DAUTO_WINSOCK
+#      Causes PuTTY to assume that <windows.h> includes its own WinSock
+#      header file, so that it won't try to include <winsock.h>.
+#
+#  - COMPAT=-DWINSOCK_TWO
+#      Causes the PuTTY utilities to include <winsock2.h> instead of
+#      <winsock.h>, except Plink which _needs_ WinSock 2 so it already
+#      does this.
+#
+#  - COMPAT=-DNO_SECURITY
+#      Disables Pageant's use of <aclapi.h>, which is not available
+#      with some development environments (such as older versions of
+#      the Cygwin/mingw GNU toolchain). This means that Pageant
+#      won't care about the local user ID of processes accessing it; a
+#      version of Pageant built with this option will therefore refuse
+#      to run under NT-series OSes on security grounds (although it
+#      will run fine on Win95-series OSes where there is no access
+#      control anyway).
+#
+#  - COMPAT=-DNO_MULTIMON
+#      Disables PuTTY's use of <multimon.h>, which is not available
+#      with some development environments. This means that PuTTY's
+#      full-screen mode (configurable to work on Alt-Enter) will
+#      not behave usefully in a multi-monitor environment.
+#
+#      Note that this definition is always enabled in the Cygwin
+#      build, since at the time of writing this <multimon.h> is
+#      known not to be available in Cygwin.
+#
+#  - COMPAT=-DMSVC4
+#  - RCFL=-DMSVC4
+#      Makes a couple of minor changes so that PuTTY compiles using
+#      MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON.
+#
+#  - RCFL=-DASCIICTLS
+#      Uses ASCII rather than Unicode to specify the tab control in
+#      the resource file. Probably most useful when compiling with
+#      Cygnus/mingw32, whose resource compiler may have less of a
+#      problem with it.
+#
+#  - XFLAGS=-DTELNET_DEFAULT
+#      Causes PuTTY to default to the Telnet protocol (in the absence
+#      of Default Settings and so on to the contrary). Normally PuTTY
+#      will default to SSH.
+#
+#  - XFLAGS=-DDEBUG
+#      Causes PuTTY to enable internal debugging.
+#
+#  - XFLAGS=-DMALLOC_LOG
+#      Causes PuTTY to emit a file called putty_mem.log, logging every
+#      memory allocation and free, so you can track memory leaks.
+#
+#  - XFLAGS=-DMINEFIELD
+#      Causes PuTTY to use a custom memory allocator, similar in
+#      concept to Electric Fence, in place of regular malloc(). Wastes
+#      huge amounts of RAM, but should cause heap-corruption bugs to
+#      show up as GPFs at the point of failure rather than appearing
+#      later on as second-level damage.
+#
+
+# You can define this path to point at your tools if you need to
+# TOOLPATH = /opt/gcc/bin
+TOOLPATH=/gcc-3.0.2/bin/
+CC = $(TOOLPATH)gcc
+
+VER=-DRELEASE=0.56-XFree86/OS2
+CFLAGS = -O2 -Zmtd -Zsysv-signals -Zbin-files -fstrength-reduce -D__ST_MT_ERRNO -Wall -I.././ -I../charset/ -I../unix/ -I../mac/ \
+		-I/x11_latest/xf86sup/api `gtk-config --cflags`
+XLDFLAGS = `gtk-config --libs`
+ULDFLAGS = -Zmtd -Zsysv-signals -Zbin-files -fstrength-reduce
+XLIB = -L/usr/X11R6/lib -lX11
+EXTRALIBS = -lsocket -lpthreads -lemxfix -lgcc
+INSTALL=install
+INSTALL_PROGRAM=$(INSTALL)
+INSTALL_DATA=$(INSTALL)
+prefix=/usr/local
+exec_prefix=$(prefix)
+bindir=$(exec_prefix)/bin
+mandir=$(prefix)/man
+man1dir=$(mandir)/man1
+
+.SUFFIXES:
+
+%.o:
+	$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -o $@ -c $<
+
+#all: plink pscp psftp pterm putty puttygen puttytel
+all: plink.exe pscp.exe psftp.exe putty.exe puttygen.exe
+
+plink.exe: be_all.o cmdline.o cproxy.o ldisc.o logging.o misc.o portfwd.o \
+		proxy.o raw.o rlogin.o settings.o signal.o ssh.o sshaes.o \
+		sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
+		sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
+		sshsha.o sshzlib.o telnet.o tree234.o ux_x11.o uxagentc.o \
+		uxcons.o uxmisc.o uxnet.o os2noise.o uxplink.o uxproxy.o \
+		uxsel.o uxstore.o version.o wildcard.o x11fwd.o
+	$(CC) $(ULDFLAGS) -o $@ be_all.o cmdline.o cproxy.o ldisc.o \
+		logging.o misc.o portfwd.o proxy.o raw.o rlogin.o settings.o \
+		signal.o ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o \
+		sshcrcda.o sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o \
+		sshrand.o sshrsa.o sshsh512.o sshsha.o sshzlib.o telnet.o \
+		tree234.o ux_x11.o uxagentc.o uxcons.o uxmisc.o uxnet.o \
+		os2noise.o uxplink.o uxproxy.o uxsel.o uxstore.o version.o \
+		wildcard.o x11fwd.o \
+		$(EXTRALIBS)
+
+pscp.exe: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o portfwd.o \
+		proxy.o scp.o settings.o sftp.o ssh.o sshaes.o sshblowf.o \
+		sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \
+		sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o sshsha.o \
+		sshzlib.o tree234.o uxagentc.o uxcons.o uxmisc.o uxnet.o \
+		os2noise.o uxproxy.o uxsel.o uxsftp.o uxstore.o version.o \
+		wildcard.o x11fwd.o
+	$(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
+		logging.o misc.o portfwd.o proxy.o scp.o settings.o sftp.o \
+		ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
+		sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o sshrand.o \
+		sshrsa.o sshsh512.o sshsha.o sshzlib.o tree234.o uxagentc.o \
+		uxcons.o uxmisc.o uxnet.o os2noise.o uxproxy.o uxsel.o \
+		uxsftp.o uxstore.o version.o wildcard.o x11fwd.o \
+		$(EXTRALIBS)
+
+psftp.exe: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o portfwd.o \
+		proxy.o psftp.o settings.o sftp.o ssh.o sshaes.o sshblowf.o \
+		sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \
+		sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o sshsha.o \
+		sshzlib.o tree234.o uxagentc.o uxcons.o uxmisc.o uxnet.o \
+		os2noise.o uxproxy.o uxsel.o uxsftp.o uxstore.o version.o \
+		wildcard.o x11fwd.o
+	$(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
+		logging.o misc.o portfwd.o proxy.o psftp.o settings.o sftp.o \
+		ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
+		sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o sshrand.o \
+		sshrsa.o sshsh512.o sshsha.o sshzlib.o tree234.o uxagentc.o \
+		uxcons.o uxmisc.o uxnet.o os2noise.o uxproxy.o uxsel.o \
+		uxsftp.o uxstore.o version.o wildcard.o x11fwd.o \
+		$(EXTRALIBS)
+
+pterm.exe: be_none.o cmdline.o config.o dialog.o fromucs.o gtkcols.o gtkdlg.o \
+		gtkpanel.o ldisc.o ldiscucs.o localenc.o logging.o macenc.o \
+		mimeenc.o misc.o nocproxy.o pterm.o ptermm.o pty.o sbcs.o \
+		sbcsdat.o settings.o signal.o slookup.o terminal.o toucs.o \
+		tree234.o utf8.o uxcfg.o uxmisc.o uxprint.o uxsel.o \
+		uxstore.o uxucs.o version.o wcwidth.o xenc.o xkeysym.o
+	$(CC) -o $@ be_none.o cmdline.o config.o dialog.o \
+		fromucs.o gtkcols.o gtkdlg.o gtkpanel.o ldisc.o ldiscucs.o \
+		localenc.o logging.o macenc.o mimeenc.o misc.o nocproxy.o \
+		pterm.o ptermm.o pty.o sbcs.o sbcsdat.o settings.o signal.o \
+		slookup.o terminal.o toucs.o tree234.o utf8.o uxcfg.o \
+		uxmisc.o uxprint.o uxsel.o uxstore.o uxucs.o version.o \
+		wcwidth.o xenc.o xkeysym.o \
+		$(XLDFLAGS) $(EXTRALIBS)
+
+putty.exe: be_all.o cmdline.o config.o cproxy.o dialog.o fromucs.o gtkcols.o \
+		gtkdlg.o gtkpanel.o ldisc.o ldiscucs.o localenc.o logging.o \
+		macenc.o mimeenc.o misc.o portfwd.o proxy.o pterm.o pty.o \
+		raw.o rlogin.o sbcs.o sbcsdat.o settings.o signal.o \
+		slookup.o ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o \
+		sshcrcda.o sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o \
+		sshrand.o sshrsa.o sshsh512.o sshsha.o sshzlib.o telnet.o \
+		terminal.o toucs.o tree234.o utf8.o ux_x11.o uxagentc.o \
+		uxcfg.o uxmisc.o uxnet.o os2noise.o uxprint.o uxproxy.o \
+		uxputty.o uxsel.o uxstore.o uxucs.o version.o wcwidth.o \
+		wildcard.o x11fwd.o xenc.o xkeysym.o
+	$(CC) -o $@ be_all.o cmdline.o config.o cproxy.o \
+		dialog.o fromucs.o gtkcols.o gtkdlg.o gtkpanel.o ldisc.o \
+		ldiscucs.o localenc.o logging.o macenc.o mimeenc.o misc.o \
+		portfwd.o proxy.o pterm.o pty.o raw.o rlogin.o sbcs.o \
+		sbcsdat.o settings.o signal.o slookup.o ssh.o sshaes.o \
+		sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
+		sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
+		sshsha.o sshzlib.o telnet.o terminal.o toucs.o tree234.o \
+		utf8.o ux_x11.o uxagentc.o uxcfg.o uxmisc.o uxnet.o \
+		os2noise.o uxprint.o uxproxy.o uxputty.o uxsel.o uxstore.o \
+		uxucs.o version.o wcwidth.o wildcard.o x11fwd.o xenc.o \
+		xkeysym.o \
+		$(XLDFLAGS) $(EXTRALIBS)
+
+puttygen.exe: cmdgen.o import.o misc.o sshaes.o sshbn.o sshdes.o sshdss.o \
+		sshdssg.o sshmd5.o sshprime.o sshpubk.o sshrand.o sshrsa.o \
+		sshrsag.o sshsh512.o sshsha.o tree234.o uxcons.o os2gen.o \
+		uxmisc.o os2noise.o uxstore.o version.o
+	$(CC) $(ULDFLAGS) -o $@ cmdgen.o import.o misc.o sshaes.o sshbn.o \
+		sshdes.o sshdss.o sshdssg.o sshmd5.o sshprime.o sshpubk.o \
+		sshrand.o sshrsa.o sshrsag.o sshsh512.o sshsha.o tree234.o \
+		uxcons.o os2gen.o uxmisc.o os2noise.o uxstore.o version.o \
+		$(XLIB) $(EXTRALIBS)
+
+puttytel.exe: be_nossh.o cmdline.o config.o dialog.o fromucs.o gtkcols.o \
+		gtkdlg.o gtkpanel.o ldisc.o ldiscucs.o localenc.o logging.o \
+		macenc.o mimeenc.o misc.o nocproxy.o proxy.o pterm.o pty.o \
+		raw.o rlogin.o sbcs.o sbcsdat.o settings.o signal.o \
+		slookup.o telnet.o terminal.o toucs.o tree234.o utf8.o \
+		uxcfg.o uxmisc.o uxnet.o uxprint.o uxproxy.o uxputty.o \
+		uxsel.o uxstore.o uxucs.o version.o wcwidth.o xenc.o \
+		xkeysym.o
+	$(CC) -o $@ be_nossh.o cmdline.o config.o dialog.o \
+		fromucs.o gtkcols.o gtkdlg.o gtkpanel.o ldisc.o ldiscucs.o \
+		localenc.o logging.o macenc.o mimeenc.o misc.o nocproxy.o \
+		proxy.o pterm.o pty.o raw.o rlogin.o sbcs.o sbcsdat.o \
+		settings.o signal.o slookup.o telnet.o terminal.o toucs.o \
+		tree234.o utf8.o uxcfg.o uxmisc.o uxnet.o uxprint.o \
+		uxproxy.o uxputty.o uxsel.o uxstore.o uxucs.o version.o \
+		wcwidth.o xenc.o xkeysym.o \
+		$(XLDFLAGS) $(EXTRALIBS)
+
+be_all.o: .././be_all.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+be_none.o: .././be_none.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+be_nossh.o: .././be_nossh.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+cmdgen.o: .././cmdgen.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+cmdline.o: .././cmdline.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+config.o: .././config.c .././putty.h .././dialog.h .././storage.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+console.o: .././console.c .././putty.h .././storage.h .././ssh.h \
+		.././puttyps.h .././network.h .././misc.h .././puttymem.h \
+		.././int64.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+cproxy.o: .././cproxy.c .././putty.h .././ssh.h .././network.h .././proxy.h \
+		.././puttyps.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+dialog.o: .././dialog.c .././putty.h .././dialog.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+fromucs.o: ../charset/fromucs.c ../charset/charset.h ../charset/internal.h
+gtkcols.o: ../unix/gtkcols.c ../unix/gtkcols.h
+gtkdlg.o: ../unix/gtkdlg.c ../unix/gtkcols.h ../unix/gtkpanel.h .././putty.h \
+		.././storage.h .././dialog.h .././tree234.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h \
+		../charset/charset.h
+gtkpanel.o: ../unix/gtkpanel.c ../unix/gtkpanel.h
+import.o: .././import.c .././putty.h .././ssh.h .././misc.h .././puttyps.h \
+		.././network.h .././puttymem.h .././int64.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././tree234.h \
+		.././winhelp.h ../charset/charset.h
+int64.o: .././int64.c .././int64.h
+ldisc.o: .././ldisc.c .././putty.h .././terminal.h .././ldisc.h \
+		.././puttyps.h .././network.h .././misc.h .././tree234.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././winhelp.h ../charset/charset.h
+ldiscucs.o: .././ldiscucs.c .././putty.h .././terminal.h .././ldisc.h \
+		.././puttyps.h .././network.h .././misc.h .././tree234.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././winhelp.h ../charset/charset.h
+localenc.o: ../charset/localenc.c ../charset/charset.h ../charset/internal.h
+logging.o: .././logging.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+mac.o: ../mac/mac.c ../mac/macresid.h .././putty.h .././ssh.h \
+		.././terminal.h ../mac/mac.h .././puttyps.h .././network.h \
+		.././misc.h .././puttymem.h .././int64.h .././tree234.h \
+		../charset/charset.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././winhelp.h
+macabout.o: ../mac/macabout.c .././putty.h ../mac/mac.h ../mac/macresid.h \
+		.././puttyps.h .././network.h .././misc.h \
+		../charset/charset.h .././tree234.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h
+macctrls.o: ../mac/macctrls.c .././putty.h ../mac/mac.h ../mac/macresid.h \
+		.././dialog.h .././tree234.h .././puttyps.h .././network.h \
+		.././misc.h ../charset/charset.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h
+macdlg.o: ../mac/macdlg.c .././putty.h .././dialog.h ../mac/mac.h \
+		../mac/macresid.h .././storage.h .././puttyps.h \
+		.././network.h .././misc.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h
+macenc.o: ../charset/macenc.c ../charset/charset.h ../charset/internal.h
+macevlog.o: ../mac/macevlog.c .././putty.h ../mac/mac.h ../mac/macresid.h \
+		.././terminal.h .././puttyps.h .././network.h .././misc.h \
+		../charset/charset.h .././tree234.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h
+macmisc.o: ../mac/macmisc.c .././putty.h ../mac/mac.h .././puttyps.h \
+		.././network.h .././misc.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h
+macnet.o: ../mac/macnet.c .././putty.h .././network.h ../mac/mac.h \
+		.././puttyps.h .././misc.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h
+macnoise.o: ../mac/macnoise.c .././putty.h .././ssh.h .././storage.h \
+		.././puttyps.h .././network.h .././misc.h .././puttymem.h \
+		.././int64.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+macpgen.o: ../mac/macpgen.c ../mac/macpgrid.h .././putty.h .././ssh.h \
+		../mac/mac.h .././puttyps.h .././network.h .././misc.h \
+		.././puttymem.h .././int64.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././winhelp.h
+macpgkey.o: ../mac/macpgkey.c .././putty.h ../mac/mac.h ../mac/macpgrid.h \
+		.././ssh.h .././puttyps.h .././network.h .././misc.h \
+		../charset/charset.h .././tree234.h .././puttymem.h \
+		.././int64.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././winhelp.h
+macstore.o: ../mac/macstore.c .././putty.h .././storage.h ../mac/mac.h \
+		../mac/macresid.h .././puttyps.h .././network.h .././misc.h \
+		../charset/charset.h .././tree234.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h
+macterm.o: ../mac/macterm.c ../mac/macresid.h .././putty.h \
+		../charset/charset.h ../mac/mac.h .././terminal.h \
+		.././puttyps.h .././network.h .././misc.h .././tree234.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././winhelp.h
+macucs.o: ../mac/macucs.c .././putty.h .././terminal.h .././misc.h \
+		../mac/mac.h .././puttyps.h .././network.h .././tree234.h \
+		.././puttymem.h ../charset/charset.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././winhelp.h
+mimeenc.o: ../charset/mimeenc.c ../charset/charset.h ../charset/internal.h
+misc.o: .././misc.c .././putty.h .././puttyps.h .././network.h .././misc.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+mtcpnet.o: ../mac/mtcpnet.c .././putty.h .././network.h ../mac/mac.h \
+		.././puttyps.h .././misc.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h
+nocproxy.o: .././nocproxy.c .././putty.h .././network.h .././proxy.h \
+		.././puttyps.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+noise.o: .././noise.c .././putty.h .././ssh.h .././storage.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+otnet.o: ../mac/otnet.c .././putty.h .././network.h ../mac/mac.h \
+		.././puttyps.h .././misc.h ../charset/charset.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h
+pageant.o: .././pageant.c .././putty.h .././ssh.h .././misc.h .././tree234.h \
+		.././puttyps.h .././network.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././winhelp.h ../charset/charset.h
+pageantc.o: .././pageantc.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+plink.o: .././plink.c .././putty.h .././storage.h .././tree234.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+portfwd.o: .././portfwd.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+pproxy.o: .././pproxy.c .././putty.h .././network.h .././proxy.h \
+		.././puttyps.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+printing.o: .././printing.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+proxy.o: .././proxy.c .././putty.h .././network.h .././proxy.h \
+		.././puttyps.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+psftp.o: .././psftp.c .././putty.h .././psftp.h .././storage.h .././ssh.h \
+		.././sftp.h .././int64.h .././puttyps.h .././network.h \
+		.././misc.h .././puttymem.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././tree234.h \
+		.././winhelp.h ../charset/charset.h
+pterm.o: ../unix/pterm.c .././putty.h .././terminal.h .././puttyps.h \
+		.././network.h .././misc.h .././tree234.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+ptermm.o: ../unix/ptermm.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+pty.o: ../unix/pty.c .././putty.h .././puttyps.h .././network.h .././misc.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+puttygen.o: .././puttygen.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+raw.o: .././raw.c .././putty.h .././puttyps.h .././network.h .././misc.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+rlogin.o: .././rlogin.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+sbcs.o: ../charset/sbcs.c ../charset/charset.h ../charset/internal.h
+sbcsdat.o: ../charset/sbcsdat.c ../charset/charset.h ../charset/internal.h
+scp.o: .././scp.c .././putty.h .././psftp.h .././ssh.h .././sftp.h \
+		.././storage.h .././puttyps.h .././network.h .././misc.h \
+		.././puttymem.h .././int64.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././tree234.h \
+		.././winhelp.h ../charset/charset.h
+settings.o: .././settings.c .././putty.h .././storage.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+sftp.o: .././sftp.c .././misc.h .././int64.h .././tree234.h .././sftp.h \
+		.././puttymem.h
+signal.o: ../unix/signal.c
+sizetip.o: .././sizetip.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \
+		../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c
+ssh.o: .././ssh.c .././putty.h .././tree234.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././winhelp.h ../charset/charset.h
+sshaes.o: .././sshaes.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshblowf.o: .././sshblowf.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshbn.o: .././sshbn.c .././misc.h .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h
+sshcrc.o: .././sshcrc.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshcrcda.o: .././sshcrcda.c .././misc.h .././ssh.h .././puttymem.h \
+		.././network.h .././int64.h
+sshdes.o: .././sshdes.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshdh.o: .././sshdh.c .././ssh.h .././puttymem.h .././network.h .././int64.h \
+		.././misc.h
+sshdss.o: .././sshdss.c .././ssh.h .././misc.h .././puttymem.h \
+		.././network.h .././int64.h
+sshdssg.o: .././sshdssg.c .././misc.h .././ssh.h .././puttymem.h \
+		.././network.h .././int64.h
+sshmd5.o: .././sshmd5.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshprime.o: .././sshprime.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshpubk.o: .././sshpubk.c .././putty.h .././ssh.h .././misc.h .././puttyps.h \
+		.././network.h .././puttymem.h .././int64.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././tree234.h \
+		.././winhelp.h ../charset/charset.h
+sshrand.o: .././sshrand.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+sshrsa.o: .././sshrsa.c .././ssh.h .././misc.h .././puttymem.h \
+		.././network.h .././int64.h
+sshrsag.o: .././sshrsag.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshsh512.o: .././sshsh512.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshsha.o: .././sshsha.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+sshzlib.o: .././sshzlib.c .././ssh.h .././puttymem.h .././network.h \
+		.././int64.h .././misc.h
+stricmp.o: ../mac/stricmp.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+telnet.o: .././telnet.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+terminal.o: .././terminal.c .././putty.h .././terminal.h .././puttyps.h \
+		.././network.h .././misc.h .././tree234.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+testback.o: .././testback.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+toucs.o: ../charset/toucs.c ../charset/charset.h ../charset/internal.h
+tree234.o: .././tree234.c .././puttymem.h .././tree234.h
+unicode.o: .././unicode.c .././putty.h .././terminal.h .././misc.h \
+		.././puttyps.h .././network.h .././tree234.h .././puttymem.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././winhelp.h ../charset/charset.h
+utf8.o: ../charset/utf8.c ../charset/charset.h ../charset/internal.h
+ux_x11.o: ../unix/ux_x11.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+uxagentc.o: ../unix/uxagentc.c .././putty.h .././misc.h .././tree234.h \
+		.././puttymem.h .././puttyps.h .././network.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././winhelp.h ../charset/charset.h
+uxcfg.o: ../unix/uxcfg.c .././putty.h .././dialog.h .././storage.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+uxcons.o: ../unix/uxcons.c .././putty.h .././storage.h .././ssh.h \
+		.././puttyps.h .././network.h .././misc.h .././puttymem.h \
+		.././int64.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+os2gen.o: ../unix/os2gen.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxmisc.o: ../unix/uxmisc.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxnet.o: ../unix/uxnet.c .././putty.h .././network.h .././tree234.h \
+		.././puttyps.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h \
+		../charset/charset.h
+os2noise.o: ../unix/os2noise.c .././putty.h .././ssh.h .././storage.h \
+		.././puttyps.h .././network.h .././misc.h .././puttymem.h \
+		.././int64.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxplink.o: ../unix/uxplink.c .././putty.h .././storage.h .././tree234.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+uxprint.o: ../unix/uxprint.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxproxy.o: ../unix/uxproxy.c .././tree234.h .././putty.h .././network.h \
+		.././proxy.h .././puttyps.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+uxputty.o: ../unix/uxputty.c .././putty.h .././storage.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxsel.o: ../unix/uxsel.c .././putty.h .././tree234.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h \
+		../charset/charset.h
+uxsftp.o: ../unix/uxsftp.c .././putty.h .././psftp.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+uxstore.o: ../unix/uxstore.c .././putty.h .././storage.h .././tree234.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././winhelp.h ../charset/charset.h
+uxucs.o: ../unix/uxucs.c .././putty.h ../charset/charset.h .././terminal.h \
+		.././misc.h .././puttyps.h .././network.h .././tree234.h \
+		.././puttymem.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././winhelp.h
+version.o: .././version.c
+vsnprint.o: ../mac/vsnprint.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+wcwidth.o: .././wcwidth.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+wildcard.o: .././wildcard.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+wincfg.o: .././wincfg.c .././putty.h .././dialog.h .././storage.h \
+		.././puttyps.h .././network.h .././misc.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././puttymem.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+winctrls.o: .././winctrls.c .././putty.h .././misc.h .././dialog.h \
+		.././puttyps.h .././network.h .././puttymem.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+windefs.o: .././windefs.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+windlg.o: .././windlg.c .././putty.h .././ssh.h .././win_res.h \
+		.././storage.h .././dialog.h .././puttyps.h .././network.h \
+		.././misc.h .././puttymem.h .././int64.h .././winstuff.h \
+		../mac/macstuff.h ../unix/unix.h .././tree234.h \
+		.././winhelp.h ../charset/charset.h
+window.o: .././window.c .././putty.h .././terminal.h .././storage.h \
+		.././win_res.h .././puttyps.h .././network.h .././misc.h \
+		.././tree234.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h \
+		../charset/charset.h
+winmisc.o: .././winmisc.c .././putty.h .././puttyps.h .././network.h \
+		.././misc.h .././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+winnet.o: .././winnet.c .././putty.h .././network.h .././tree234.h \
+		.././puttyps.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././winhelp.h \
+		../charset/charset.h
+winsftp.o: .././winsftp.c .././putty.h .././psftp.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+winstore.o: .././winstore.c .././putty.h .././storage.h .././puttyps.h \
+		.././network.h .././misc.h .././winstuff.h ../mac/macstuff.h \
+		../unix/unix.h .././puttymem.h .././tree234.h .././winhelp.h \
+		../charset/charset.h
+winutils.o: .././winutils.c .././misc.h .././puttymem.h
+x11fwd.o: .././x11fwd.c .././putty.h .././ssh.h .././puttyps.h \
+		.././network.h .././misc.h .././puttymem.h .././int64.h \
+		.././winstuff.h ../mac/macstuff.h ../unix/unix.h \
+		.././tree234.h .././winhelp.h ../charset/charset.h
+xenc.o: ../charset/xenc.c ../charset/charset.h ../charset/internal.h
+xkeysym.o: ../unix/xkeysym.c .././misc.h .././puttymem.h
+
+version.o: FORCE;
+FORCE:
+	if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
+		$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
+	else \
+		$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
+	fi
+install:
+	$(INSTALL_PROGRAM) -m 755 plink.exe $(DESTDIR)$(bindir)/plink.exe
+	$(INSTALL_PROGRAM) -m 755 pscp.exe $(DESTDIR)$(bindir)/pscp.exe
+	$(INSTALL_PROGRAM) -m 755 psftp.exe $(DESTDIR)$(bindir)/psftp.exe
+#	$(INSTALL_PROGRAM) -m 755 pterm $(DESTDIR)$(bindir)/pterm
+	$(INSTALL_PROGRAM) -m 755 putty.exe $(DESTDIR)$(bindir)/putty.exe
+	$(INSTALL_PROGRAM) -m 755 puttygen.exe $(DESTDIR)$(bindir)/puttygen.exe
+#	$(INSTALL_PROGRAM) -m 755 puttytel $(DESTDIR)$(bindir)/puttytel
+	$(INSTALL_DATA) -m 644 ../doc/plink.1 $(DESTDIR)$(man1dir)/plink.1
+	$(INSTALL_DATA) -m 644 ../doc/pscp.1 $(DESTDIR)$(man1dir)/pscp.1
+	$(INSTALL_DATA) -m 644 ../doc/psftp.1 $(DESTDIR)$(man1dir)/psftp.1
+#	$(INSTALL_DATA) -m 644 ../doc/pterm.1 $(DESTDIR)$(man1dir)/pterm.1
+	$(INSTALL_DATA) -m 644 ../doc/putty.1 $(DESTDIR)$(man1dir)/putty.1
+	$(INSTALL_DATA) -m 644 ../doc/puttygen.1 $(DESTDIR)$(man1dir)/puttygen.1
+#	$(INSTALL_DATA) -m 644 ../doc/puttytel.1 $(DESTDIR)$(man1dir)/puttytel.1
+
+install-strip:
+	$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
+
+clean:
+	rm -f *.o plink.exe pscp.exe psftp.exe pterm.exe putty.exe puttygen.exe puttytel.exe
diff -ruN putty-0.56.orig/unix/os2gen.c putty-0.56/unix/os2gen.c
--- putty-0.56.orig/unix/os2gen.c	Thu Jan  1 00:00:00 1970
+++ putty-0.56/unix/os2gen.c	Tue Jan 25 17:07:22 2005
@@ -0,0 +1,58 @@
+/*
+ * uxgen.c: Unix implementation of get_heavy_noise() from cmdgen.c.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Xlib.h>
+
+#include "putty.h"
+
+char *get_random_data(int len)
+{
+    char *buf = snewn(len, char);
+    int ngot,i;
+    Display *dpy;
+    Window root;
+    unsigned char noise;
+
+    dpy = XOpenDisplay(NULL);
+
+    if (!dpy) {
+	perror("\nCannot connect to display\n");
+	exit(1);
+    }
+
+    root = DefaultRootWindow(dpy);
+    XSelectInput(dpy, root, PointerMotionMask);
+    
+    printf("\nWelcome to the poor man's random number generator!\n");
+    printf("Please move the mouse on the root window to generate %d bytes of noise\n",len);
+
+    ngot = 0;
+    while (ngot < len) {
+        XEvent event;
+
+        noise=0;
+
+        for (i=0;i<2;i++) {
+            XNextEvent(dpy, &event);
+            switch(event.type) {
+              case MotionNotify:
+                noise = (noise << 4) 
+                      | ((event.xmotion.x & 0xf) ^ (event.xmotion.y & 0xf));
+                break;
+              default:
+                break;
+            }
+        }
+        memcpy(buf+ngot, &noise, sizeof(noise));
+        ngot += sizeof(noise);
+//        printf("noise = 0x%.2x (%d bytes)\n", noise, ngot);
+        printf("*");
+    }
+
+    printf("\nThank you.\n");
+    XCloseDisplay(dpy);
+    return buf;
+}
diff -ruN putty-0.56.orig/unix/os2noise.c putty-0.56/unix/os2noise.c
--- putty-0.56.orig/unix/os2noise.c	Thu Jan  1 00:00:00 1970
+++ putty-0.56/unix/os2noise.c	Tue Jan 25 17:07:22 2005
@@ -0,0 +1,131 @@
+/*
+ * Noise generation for PuTTY's cryptographic random number
+ * generator.
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#include "putty.h"
+#include "ssh.h"
+#include "storage.h"
+
+/*
+ * This function is called once, at PuTTY startup. It will do some
+ * slightly silly things such as fetching an entire process listing
+ * and scanning /tmp, load the saved random seed from disk, and
+ * also read 32 bytes out of /dev/urandom.
+ */
+
+void noise_get_heavy(void (*func) (void *, int))
+{
+    char buf[512], cmdline[512];
+    FILE *fp;
+    int ret;
+    char *tmpdir;
+
+    fp = popen("netstat.exe -s 2>NUL", "r");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    fp = popen("netstat.exe -m 2>NUL", "r");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    fp = popen("netstat.exe -i 2>NUL", "r");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    fp = popen("netstat.exe -t 2>NUL", "r");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    fp = popen("pstat.exe 2>NUL", "r");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    if ((tmpdir = getenv("TMP")) == NULL)
+      if ((tmpdir = getenv("TEMP")) == NULL)
+        if ((tmpdir = getenv("TMPDIR")) == NULL)
+          tmpdir = "\\tmp";
+    
+    sprintf(cmdline,"dir /S %s 2>NUL",tmpdir);
+    
+    fp = popen(cmdline, "rt");
+    while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0)
+	func(buf, ret);
+    pclose(fp);
+
+    read_random_seed(func);
+    random_save_seed();
+}
+
+void random_save_seed(void)
+{
+    int len;
+    void *data;
+
+    if (random_active) {
+	random_get_savedata(&data, &len);
+	write_random_seed(data, len);
+	sfree(data);
+    }
+}
+
+/*
+ * This function is called every time the random pool needs
+ * stirring, and will acquire the system time.
+ */
+void noise_get_light(void (*func) (void *, int))
+{
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    func(&tv, sizeof(tv));
+}
+
+/*
+ * This function is called on a timer, and grabs as much changeable
+ * system data as it can quickly get its hands on.
+ */
+/*void noise_regular(void)
+{
+    int fd;
+    int ret;
+    char buf[512];
+    struct rusage rusage;
+
+    if ((fd = open("/proc/meminfo", O_RDONLY)) >= 0) {
+	while ( (ret = read(fd, buf, sizeof(buf))) > 0)
+	    random_add_noise(buf, ret);
+	close(fd);
+    }
+    if ((fd = open("/proc/stat", O_RDONLY)) >= 0) {
+	while ( (ret = read(fd, buf, sizeof(buf))) > 0)
+	    random_add_noise(buf, ret);
+	close(fd);
+    }
+    getrusage(RUSAGE_SELF, &rusage);
+    random_add_noise(&rusage, sizeof(rusage));
+}*/
+
+/*
+ * This function is called on every keypress or mouse move, and
+ * will add the current time to the noise pool. It gets the scan
+ * code or mouse position passed in, and adds that too.
+ */
+void noise_ultralight(unsigned long data)
+{
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    random_add_noise(&tv, sizeof(tv));
+    random_add_noise(&data, sizeof(data));
+}
diff -ruN putty-0.56.orig/unix/pterm.c putty-0.56/unix/pterm.c
--- putty-0.56.orig/unix/pterm.c	Sun Oct 24 15:31:54 2004
+++ putty-0.56/unix/pterm.c	Tue Jan 25 17:07:22 2005
@@ -17,6 +17,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#ifdef __EMX__
+#include <process.h>
+#endif
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdkx.h>
@@ -2954,6 +2957,7 @@
 
     assert(i == n);
 
+#ifndef __EMX__
     /*
      * Do the double fork.
      */
@@ -2996,6 +3000,19 @@
 	waitpid(pid, &status, 0);
     }
 
+#else
+    /* 
+     * Right now, our fork() implementation is rather buggy.
+     * This will hopefully change in the future. Until then we 
+     * use spawn() instead, but with the risk that fd_to_close
+     * remain open.
+     */
+    pid = spawnvp(P_NOWAIT, inst->progname, args);
+    if (pid <0) {
+        perror("spawnvp");
+        _exit(1);
+    }
+#endif		/* !__EMX__ */
 }
 
 void dup_session_menuitem(GtkMenuItem *item, gpointer gdata)
diff -ruN putty-0.56.orig/unix/pty.c putty-0.56/unix/pty.c
--- putty-0.56.orig/unix/pty.c	Sun Oct 24 15:29:02 2004
+++ putty-0.56/unix/pty.c	Tue Jan 25 17:07:22 2005
@@ -14,7 +14,9 @@
 #define _XOPEN_SOURCE
 #define _XOPEN_SOURCE_EXTENDED
 #define _GNU_SOURCE
+#ifndef __EMX__
 #include <features.h>
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,6 +33,13 @@
 #include <sys/wait.h>
 #include <sys/ioctl.h>
 #include <errno.h>
+#ifdef __EMX__
+#include <os2.h>
+#include <ptyos2.h>
+#include <pty.h>
+#define TIOCSCTTY TTY_TIOCSCTTY
+#define HAVE_NO_STRSIGNAL
+#endif
 
 #include "putty.h"
 
@@ -55,6 +64,24 @@
 #endif
 #endif
 
+#ifdef __EMX__
+int chown(char* file, int uid,int gid)
+{
+	/* accept everything; will change if LIBEMU is in place */
+	return 0;
+}
+
+int chmod(const char *path, mode_t mode)
+{
+	return 0;
+}
+
+void setpgrp()
+{
+	/* do nothing, will change when LIBEMU is in place */
+}
+
+#endif
 /*
  * Set up a default for vaguely sane systems. The idea is that if
  * OMIT_UTMP is not defined, then at least one of the symbols which
@@ -63,6 +90,12 @@
  * OMIT_UTMP if you didn't want any. Currently HAVE_PUTUTLINE is
  * the only such symbol.
  */
+#ifdef __EMX__
+#define OMIT_UTMP
+#define BSD_PTYS
+#define HAVE_NO_SETRESUID
+#endif
+
 #ifndef OMIT_UTMP
 #if !defined HAVE_PUTUTLINE
 #define HAVE_PUTUTLINE
diff -ruN putty-0.56.orig/unix/signal.c putty-0.56/unix/signal.c
--- putty-0.56.orig/unix/signal.c	Sat Nov  2 15:35:56 2002
+++ putty-0.56/unix/signal.c	Tue Jan 25 17:07:22 2005
@@ -1,5 +1,8 @@
 #include <signal.h>
 
+#ifdef __EMX__
+#define SA_RESTART 0x10000000
+#endif
 /*
  * Calling signal() is a non-portable, as it varies in meaning between
  * platforms and depending on feature macros, and has stupid semantics
diff -ruN putty-0.56.orig/unix/ux_x11.c putty-0.56/unix/ux_x11.c
--- putty-0.56.orig/unix/ux_x11.c	Thu Oct  7 00:31:04 2004
+++ putty-0.56/unix/ux_x11.c	Tue Jan 25 17:07:22 2005
@@ -22,13 +22,23 @@
      * Normally we should run `xauth list DISPLAYNAME'. However,
      * there's an oddity when the display is local: the display
      * `localhost:0' (or `:0') should become just `:0'.
+     * The same holds for `local/<hostname>:0'.
      */
     if (!strncmp(display, "localhost:", 10)
-	|| !strncmp(display, "unix:", 5))
+	|| !strncmp(display, "unix:", 5)
+	|| !strncmp(display, "local/", 6))
+#ifndef __EMX__
 	command = dupprintf("xauth list %s 2>/dev/null",
+#else
+	command = dupprintf("xauth list %s 2>NUL",
+#endif
 			    strchr(display, ':'));
     else
+#ifndef __EMX__
 	command = dupprintf("xauth list %s 2>/dev/null", display);
+#else
+	command = dupprintf("xauth list %s 2>NUL", display);
+#endif
     sfree(display);
     fp = popen(command, "r");
     sfree(command);
diff -ruN putty-0.56.orig/unix/uxnet.c putty-0.56/unix/uxnet.c
--- putty-0.56.orig/unix/uxnet.c	Sun Jun 20 19:07:38 2004
+++ putty-0.56/unix/uxnet.c	Tue Jan 25 17:07:22 2005
@@ -11,7 +11,9 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#ifndef __EMX__
 #include <arpa/inet.h>
+#endif
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <netdb.h>
@@ -27,6 +29,10 @@
 #endif
 
 #define ipv4_is_loopback(addr) (inet_netof(addr) == IN_LOOPBACKNET)
+
+#ifdef __EMX__
+typedef int socklen_t;
+#endif
 
 struct Socket_tag {
     struct socket_function_table *fn;
diff -ruN putty-0.56.orig/unix/uxplink.c putty-0.56/unix/uxplink.c
--- putty-0.56.orig/unix/uxplink.c	Sun Oct 24 15:29:02 2004
+++ putty-0.56/unix/uxplink.c	Tue Jan 25 17:07:24 2005
@@ -13,6 +13,14 @@
 #include <termios.h>
 #include <pwd.h>
 #include <sys/ioctl.h>
+#ifdef __EMX__
+#include <os2.h> 
+#include <ptyos2.h>
+#include <pty.h>
+#include <sys/select.h>
+#define TIOCSCTTY TTY_TIOCSCTTY
+#define HAVE_NO_STRSIGNAL
+#endif
 
 #define PUTTY_DO_GLOBALS	       /* actually _define_ globals */
 #include "putty.h"
diff -ruN putty-0.56.orig/unix/uxstore.c putty-0.56/unix/uxstore.c
--- putty-0.56.orig/unix/uxstore.c	Mon Jan 19 10:37:16 2004
+++ putty-0.56/unix/uxstore.c	Tue Jan 25 17:07:24 2005
@@ -540,6 +540,9 @@
 
     fclose(wfp);
 
+#ifdef __EMX__
+    unlink(filename);
+#endif
     rename(tmpfilename, filename);
 
     sfree(newtext);
diff -ruN putty-0.56.orig/unix/uxucs.c putty-0.56/unix/uxucs.c
--- putty-0.56.orig/unix/uxucs.c	Sun Oct 24 15:29:02 2004
+++ putty-0.56/unix/uxucs.c	Tue Jan 25 17:07:24 2005
@@ -3,7 +3,9 @@
 #include <ctype.h>
 #include <locale.h>
 #include <limits.h>
+#ifndef __EMX__
 #include <wchar.h>
+#endif /* __EMX__ */
 
 #include <time.h>
 
@@ -24,6 +26,7 @@
 int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
 	     wchar_t *wcstr, int wclen)
 {
+#ifndef __EMX__
     if (codepage == DEFAULT_CODEPAGE) {
 	int n = 0;
 	mbstate_t state = { 0 };
@@ -42,7 +45,9 @@
 	setlocale(LC_CTYPE, "C");
 
 	return n;
-    } else if (codepage == CS_NONE) {
+    } else 
+#endif	/* !__EMX__ */
+      if (codepage == CS_NONE) {
 	int n = 0;
 
 	while (mblen > 0) {
@@ -66,6 +71,7 @@
     if (defused)
 	*defused = 0;
 
+#ifndef __EMX__
     if (codepage == DEFAULT_CODEPAGE) {
 	char output[MB_LEN_MAX];
 	mbstate_t state = { 0 };
@@ -86,7 +92,9 @@
 	setlocale(LC_CTYPE, "C");
 
 	return n;
-    } else if (codepage == CS_NONE) {
+    } else 
+#endif
+      if (codepage == CS_NONE) {
 	int n = 0;
 	while (wclen > 0 && n < mblen) {
 	    if (*wcstr >= 0xD800 && *wcstr < 0xD900)
