+# rsync_bin gives the location of the rsync binary. This is either
+# builddir/rsync if we're testing an uninstalled copy, or
+# install_prefix/bin/rsync if we're testing an installed copy. On the
+# build farm rsync will be installed, but into a scratch /usr.
+
+# srcdir gives the location of the source tree, which lets us find the
+# build scripts. It might be relative, so we need to make it
+# absolute.
+
+# testdir is a scratch directory for holding temporary test files.
+
+# The pwd is undefined when this script starts.
+
+set -e
+
+if ! [ -d "$testdir" ] && ! mkdir "$testdir"
+then
+ echo "warning: testdir $testdir is not a directory!" >&2
+ exit 1
+fi
+
+testdir=`cd $testdir && pwd`
+
+srcdir=`cd $srcdir && pwd`
+