-if [ ! -d "$apu_src_dir" -o ! -f "$apu_src_dir/Makefile.in" ]; then
- echo ""
- echo "You don't have a copy of the apr-util source in $apu_src_dir. "
- echo "Please get one the source using the following instructions, "
- echo "or specify the location of the source with "
- echo "--with-apr-util=[path to apr-util]:"
- echo ""
- echo " cd srclib"
- echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login"
- echo " (password 'anoncvs')"
- echo " cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co apr-util"
- echo ""
+
+if [ $apr_major_version -lt 2 ] ; then
+ if test -z "$apu_src_dir"; then
+ apu_src_dir=`echo $apr_src_dir | sed -e 's#/apr#/apr-util#g;'`
+ apu_src_dir="$apu_src_dir `echo $apr_src_dir | sed -e 's#/apr#/aprutil#;g'`"
+ apu_src_dir="$apu_src_dir srclib/apr-util ../apr-util"
+ fi
+
+ for dir in $apu_src_dir
+ do
+ if [ -f "${dir}/Makefile.in" ]; then
+ echo "found apr-util source: ${dir}"
+ apu_src_dir=$dir
+ apu_found=1
+ break
+ fi
+ done
+
+ if [ $apu_found -lt 1 ]; then
+ echo ""
+ echo "You don't have a copy of the apr-util source in srclib/apr-util. "
+ echo "Please get one the source using the following instructions, "
+ echo "or specify the location of the source with "
+ echo "--with-apr-util=[path to apr-util]:"
+ echo ""
+ echo " svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk srclib/apr-util"
+ echo ""
+ should_exit=1
+ fi
+fi
+
+if [ $should_exit -gt 0 ]; then