Fix spelling and encoding errors in manpages and an error message
[mmh] / test / setup-test
index 2636a5d..ffd9e64 100755 (executable)
@@ -2,13 +2,25 @@
 
 set -e
 
-TEMPDIR=`mktemp -d /tmp/nmh-test-XXXXXXXX`
-echo $TEMPDIR > test-temp-dir
+if TEMPDIR="`cat test-temp-dir 2>/dev/null`" \
+               && [ -f "$TEMPDIR/build/Makefile" ]; then
+       (cd "$TEMPDIR/build" && make all install)
+       exit
+fi
+
+TEMPDIR="`mktemp -d /tmp/mmh-test-XXXXXXXX`"
+echo "$TEMPDIR" >test-temp-dir
 
 cd ..
-autoheader && autoconf && date > stamp-h.in
-./configure --prefix=$TEMPDIR --with-locking=fcntl --enable-debug
-make clean
-make install
+srcdir="$PWD"
+if [ ! -f configure ]; then
+       ./autogen.sh
+fi
+if [ -f Makefile ]; then
+       make -s clean
+fi
 
-echo "Path: $TEMPDIR/Mail" > $TEMPDIR/mh_profile
+mkdir "$TEMPDIR/build"
+cd "$TEMPDIR/build"
+"$srcdir/configure" -q --prefix="$TEMPDIR" --enable-debug
+make -s all install