- Substitute PID directory in sshd.8. Suggestion from Andrew
   Stribblehill <a.d.stribblehill@durham.ac.uk>
diff --git a/ChangeLog b/ChangeLog
index 74c8ef9..77501f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,8 @@
  - Patch from Christos Zoulas <christos@zoulas.com>
    - Try $prefix first when looking for OpenSSL.
    - Include sys/types.h when including sys/socket.h in test programs
+ - Substitute PID directory in sshd.8. Suggestion from Andrew 
+   Stribblehill <a.d.stribblehill@durham.ac.uk>
 
 20000116
  - Renamed --with-xauth-path to --with-xauth
diff --git a/Makefile.in b/Makefile.in
index 786cd43..580065c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -5,15 +5,15 @@
 libexecdir=@libexecdir@
 mandir=@mandir@
 sysconfdir=@sysconfdir@
+piddir=@piddir@
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH=@srcdir@
 
 SSH_PROGRAM=@bindir@/ssh
 ASKPASS_LOCATION=@libexecdir@/ssh
 ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass
-FIXPATHS=@top_srcdir@/fixpaths
 
 CC=@CC@
 PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\"
@@ -24,6 +24,7 @@
 RANLIB=@RANLIB@
 INSTALL=@INSTALL@
 PERL=@PERL@
+FIXPATHS=$(PERL) @top_srcdir@/fixpaths -Dsysconfdir=${sysconfdir} -Dpiddir=${piddir}
 LDFLAGS=-L. @LDFLAGS@
 
 GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
@@ -73,28 +74,28 @@
 	$(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS)
 
 scp.1: scp.1.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} $(srcdir)/scp.1.in
+	$(FIXPATHS) $(srcdir)/scp.1.in
 
 ssh-add.1: ssh-add.1.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-add.1.in
+	$(FIXPATHS) ssh-add.1.in
 
 ssh-agent.1: ssh-agent.1.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-agent.1.in
+	$(FIXPATHS) ssh-agent.1.in
 
 ssh-keygen.1: ssh-keygen.1.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-keygen.1.in
+	$(FIXPATHS) ssh-keygen.1.in
 
 ssh.1: ssh.1.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh.1.in
+	$(FIXPATHS) ssh.1.in
 
 sshd.8: sshd.8.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} sshd.8.in
+	$(FIXPATHS) sshd.8.in
 
 sshd_config: sshd_config.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} sshd_config.in
+	$(FIXPATHS) sshd_config.in
 
 ssh_config: ssh_config.in
-	$(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh_config.in
+	$(FIXPATHS) ssh_config.in
 
 clean:
 	rm -f *.o *.a $(TARGETS) config.status config.cache config.log 
@@ -172,3 +173,7 @@
 	-rm -f ${ASKPASS_PROGRAM}
 	-rmdir $(libexecdir)/ssh ;
 
+preformat:
+	-rm -f catman
+	-mkdir catman
+	for x in $(MANPAGES) ; do man ./$${x}.in > catman/$${x}.in ; done
diff --git a/configure.in b/configure.in
index e7524cd..b356beb 100644
--- a/configure.in
+++ b/configure.in
@@ -661,14 +661,17 @@
 	]
 )
 
+piddir=/var/run
 AC_ARG_WITH(pid-dir,
 	[  --with-pid-dir=PATH     Specify location of ssh.pid file],
 	[
 		if test "x$withval" != "xno" ; then	
-			AC_DEFINE_UNQUOTED(PID_DIR, "$withval")
+			piddir=$withval
 		fi
 	]
 )
+AC_DEFINE_UNQUOTED(PID_DIR, "$piddir")
+AC_SUBST(piddir)
 
 dnl Check for mail directory (last resort if we cannot get it from headers)
 if test ! -z "$MAIL" ; then
diff --git a/sshd.8.in b/sshd.8.in
index b5d925b..671fe4c 100644
--- a/sshd.8.in
+++ b/sshd.8.in
@@ -9,7 +9,7 @@
 .\"
 .\" Created: Sat Apr 22 21:55:14 1995 ylo
 .\"
-.\" $Id: sshd.8.in,v 1.2 2000/01/14 04:45:52 damien Exp $
+.\" $Id: sshd.8.in,v 1.3 2000/01/17 11:02:18 damien Exp $
 .\"
 .Dd September 25, 1999
 .Dt SSHD 8
@@ -637,7 +637,7 @@
 the user so its contents can be copied to known hosts files.
 These two files are created using
 .Xr ssh-keygen 1 .
-.It Pa /var/run/sshd.pid
+.It Pa @piddir@/sshd.pid
 Contains the process ID of the
 .Nm
 listening for connections (if there are several daemons running