From 745184ce4dfd76dfe3edd5289bd638e599e0892e Mon Sep 17 00:00:00 2001
From: Eric Gillespie <epg@pretzelnet.org>
Date: Thu, 14 Aug 2008 19:47:29 +0000
Subject: [PATCH] 	* test/setup-test: Don't run autogen.sh unless needed.
  Build in a 	blddir under the temporary directory so as not to interfere
 with 	whatever the developer may be doing in the source directory. 	If the
 temporary directory already exists, rebuild and install it.

---
 ChangeLog       |  7 +++++++
 test/setup-test | 16 +++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 60587481..d7a94330 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-14  Eric Gillespie  <epg@pretzelnet.org>
+
+	* test/setup-test: Don't run autogen.sh unless needed.  Build in a
+	blddir under the temporary directory so as not to interfere with
+	whatever the developer may be doing in the source directory.
+	If the temporary directory already exists, rebuild and install it.
+
 2008-08-13  Eric Gillespie  <epg@pretzelnet.org>
 
 	* sbr/ambigsw.c: Send print_sw output to stderr.  This avoids
diff --git a/test/setup-test b/test/setup-test
index 00ad57a0..a99c6c7e 100755
--- a/test/setup-test
+++ b/test/setup-test
@@ -2,13 +2,23 @@
 
 set -e
 
+if TEMPDIR=`cat test-temp-dir 2> /dev/null` \
+   && [ -e $TEMPDIR/bld/Makefile ]; then
+    (cd $TEMPDIR/bld && make all install)
+    exit
+fi
+
 TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
 echo $TEMPDIR > test-temp-dir
 
 cd ..
-./autogen.sh
-./configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
-make clean
+if ! [ -e configure ]; then
+    ./autogen.sh
+fi
+srcdir=$PWD
+mkdir $TEMPDIR/bld
+cd $TEMPDIR/bld
+$srcdir/configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
 make install
 
 echo "Path: $TEMPDIR/Mail" > $TEMPDIR/mh_profile
-- 
2.39.5