Index: unix/Makefile.gtk
--- unix/Makefile.gtk.orig	2007-04-29 13:41:48 +0200
+++ unix/Makefile.gtk	2007-04-30 00:17:00 +0200
@@ -97,9 +97,9 @@
 
 # You can define this path to point at your tools if you need to
 # TOOLPATH = /opt/gcc/bin
-CC = $(TOOLPATH)cc
+CC = gcc
 
-CFLAGS = -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ \
+CFLAGS = -O2 -Wall -I.././ -I../charset/ -I../windows/ -I../unix/ \
 		-I../mac/ -I../macosx/ `gtk-config --cflags` -D _FILE_OFFSET_BITS=64
 XLDFLAGS = $(LDFLAGS) `gtk-config --libs`
 ULDFLAGS = $(LDFLAGS)
@@ -905,7 +905,7 @@
 	$(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../unix/xpmputty.c
 
 version.o: FORCE
-	if test -z "$(VER)" && (cd ..; md5sum -c manifest); then \
+	if test -z "$(VER)"; then \
 		$(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) `cat ../version.def` -c ../version.c; \
 	else \
 		$(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) $(VER) -c ../version.c; \
@@ -926,8 +926,6 @@
 	$(INSTALL_PROGRAM) -m 755 puttygen $(DESTDIR)$(bindir)/puttygen
 	$(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
Index: unix/uxpty.c
--- unix/uxpty.c.orig	2007-02-05 21:14:17 +0100
+++ unix/uxpty.c	2007-04-30 00:17:00 +0200
@@ -22,6 +22,12 @@
 #include <sys/ioctl.h>
 #include <errno.h>
 
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#define OMIT_UTMP
+#define BSD_PTYS
+#endif
+
 #include "putty.h"
 #include "tree234.h"
 
Index: unix/uxucs.c
--- unix/uxucs.c.orig	2004-11-24 12:36:08 +0100
+++ unix/uxucs.c	2007-04-30 00:17:00 +0200
@@ -12,6 +12,67 @@
 #include "terminal.h"
 #include "misc.h"
 
+#ifdef __FreeBSD__
+#include <osreldate.h>
+#if __FreeBSD_version <= 500000
+
+#include <errno.h>
+#include <rune.h>
+#include <limits.h>
+
+/*
+ * Emulate the ISO C mbrtowc() function in terms of the deprecated
+ * 4.4BSD sgetrune() function.
+ */
+size_t
+mbrtowc(wchar_t * __restrict pwc, const char * __restrict s,
+    size_t n, mbstate_t * __restrict ps __unused)
+{
+    const char *e;
+    rune_t r;
+
+    if (s == NULL) {
+        pwc = NULL;
+        s = "";
+        n = 1;
+    }
+    if ((r = sgetrune(s, n, &e)) == _INVALID_RUNE) {
+        if (n >= (size_t)MB_CUR_MAX) {
+            errno = EILSEQ;
+            return ((size_t)-1);
+        }
+        return ((size_t)-2);
+    }
+    if (pwc != NULL)
+        *pwc = (wchar_t)r;
+    return (r != 0 ? (size_t)(e - s) : 0);
+}
+
+/*
+ * Emulate the ISO C wcrtomb() function in terms of the deprecated
+ * 4.4BSD sputrune() function.
+ */
+size_t
+wcrtomb(char * __restrict s, wchar_t wc,
+    mbstate_t * __restrict ps __unused)
+{
+	char *e;
+	char buf[MB_LEN_MAX];
+
+	if (s == NULL) {
+		s = buf;
+		wc = L'\0';
+	}
+	sputrune(wc, s, MB_CUR_MAX, &e);
+	if (e == NULL) {
+		errno = EILSEQ;
+		return ((size_t)-1);
+	}
+	return ((size_t)(e - s));
+}
+#endif
+#endif
+
 /*
  * Unix Unicode-handling routines.
  */
