Index: files/patch-configure.diff
===================================================================
--- files/patch-configure.diff	(revision 0)
+++ files/patch-configure.diff	(revision 0)
@@ -0,0 +1,94 @@
+--- configure.orig	2010-12-08 22:33:09.000000000 -0500
++++ configure	2010-12-08 22:34:14.000000000 -0500
+@@ -4753,7 +4753,7 @@
+     as_fn_error "apr-config --cflags failed" "$LINENO" 5
+   fi
+ 
+-  LDFLAGS="$LDFLAGS `$apr_config --ldflags`"
++  SVN_APR_LIBS="`$apr_config --ldflags`"
+   if test $? -ne 0; then
+     as_fn_error "apr-config --ldflags failed" "$LINENO" 5
+   fi
+@@ -4768,7 +4768,7 @@
+     as_fn_error "apr-config --prefix failed" "$LINENO" 5
+   fi
+ 
+-      SVN_APR_LIBS="`$apr_config --link-libtool --libs`"
++  SVN_APR_LIBS="$SVN_APR_LIBS `$apr_config --link-libtool --libs`"
+   if test $? -ne 0; then
+     as_fn_error "apr-config --link-libtool --libs failed" "$LINENO" 5
+   fi
+@@ -5090,7 +5090,7 @@
+   fi
+ 
+ 
+-  LDFLAGS="$LDFLAGS `$apu_config --ldflags`"
++  SVN_APRUTIL_LIBS="`$apu_config --ldflags`"
+   if test $? -ne 0; then
+     as_fn_error "apu-config --ldflags failed" "$LINENO" 5
+   fi
+@@ -5105,7 +5105,7 @@
+     as_fn_error "apu-config --prefix failed" "$LINENO" 5
+   fi
+ 
+-      SVN_APRUTIL_LIBS="`$apu_config --link-libtool --libs`"
++  SVN_APRUTIL_LIBS="$SVN_APRUTIL_LIBS `$apu_config --link-libtool --libs`"
+   if test $? -ne 0; then
+     as_fn_error "apu-config --link-libtool --libs failed" "$LINENO" 5
+   fi
+@@ -6171,8 +6171,7 @@
+     if test -e "$serf_prefix/lib/libserf-0.la"; then
+       SVN_SERF_LIBS="$serf_prefix/lib/libserf-0.la"
+     else
+-      SVN_SERF_LIBS="-lserf-0"
+-      LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
++      SVN_SERF_LIBS="-L$serf_prefix/lib -lserf-0"
+     fi
+     SVN_SERF_EXPORT_LIBS="-L$serf_prefix/lib -lserf-0"
+   elif test $serf_found = "reconfig"; then
+@@ -21482,10 +21481,10 @@
+           SVN_DB_INCLUDES="$SVN_DB_INCLUDES -I$i"
+         done
+         SVN_DB_INCLUDES="${SVN_DB_INCLUDES## }"
++        SVN_DB_LIBS=""
+         for l in `echo "$withval" | $SED -e "s/.*:[^:]*:\([^:]*\):.*/\1/"`; do
+-          LDFLAGS="$LDFLAGS -L$l"
++          SVN_DB_LIBS="$SVN_DB_LIBS -L$l"
+         done
+-        SVN_DB_LIBS=""
+         for l in `echo "$withval" | $SED -e "s/.*:\([^:]*\)/\1/"`; do
+           SVN_DB_LIBS="$SVN_DB_LIBS -l$l"
+         done
+@@ -21806,7 +21805,7 @@
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for availability of Cyrus SASL v2" >&5
+ $as_echo_n "checking for availability of Cyrus SASL v2... " >&6; }
+     if test "$svn_lib_sasl" = "yes"; then
+-      SVN_SASL_LIBS="-lsasl2"
++      SVN_SASL_LIBS="-L${with_sasl}/lib -lsasl2"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+     else
+@@ -21818,9 +21817,9 @@
+       fi
+ 
+       SVN_SASL_INCLUDES=""
+-      LDFLAGS="$saved_LDFLAGS"
+     fi
+ 
++    LDFLAGS="$saved_LDFLAGS"
+     CPPFLAGS="$saved_CPPFLAGS"
+   fi
+ 
+@@ -23205,10 +23204,10 @@
+   if test "$zlib_found" = "yes"; then
+     SVN_ZLIB_PREFIX="$zlib_prefix"
+     SVN_ZLIB_INCLUDES="-I$zlib_prefix/include"
+-    LDFLAGS="$LDFLAGS -L$zlib_prefix/lib"
++    SVN_ZLIB_LIBS="-L$zlib_prefix/lib"
+   fi
+ 
+-  SVN_ZLIB_LIBS="-lz"
++  SVN_ZLIB_LIBS="$SVN_ZLIB_LIBS -lz"
+ 
+ 
+ 
Index: files/patch-Makefile.in.diff
===================================================================
--- files/patch-Makefile.in.diff	(revision 74243)
+++ files/patch-Makefile.in.diff	(working copy)
@@ -1,6 +1,45 @@
---- Makefile.in.orig	Sun Aug 17 19:45:25 2003
-+++ Makefile.in	Sun Aug 17 19:45:54 2003
-@@ -204,7 +204,7 @@
+--- Makefile.in.orig	2010-11-17 09:47:23.000000000 -0500
++++ Makefile.in	2010-12-08 22:49:00.000000000 -0500
+@@ -103,8 +103,8 @@
+ 
+ SHELL = @SHELL@
+ LIBTOOL = @SVN_LIBTOOL@
+-LTFLAGS = --tag=CC --silent
+-LTCXXFLAGS = --tag=CXX --silent
++LTFLAGS = --tag=CC
++LTCXXFLAGS = --tag=CXX
+ LT_LDFLAGS = @LT_LDFLAGS@
+ LT_NO_UNDEFINED = @LT_NO_UNDEFINED@
+ LT_CXX_LIBADD = @LT_CXX_LIBADD@
+@@ -184,21 +184,21 @@
+ COMPILE_JAVAHL_JAVAC = $(JAVAC) $(JAVAC_FLAGS)
+ COMPILE_JAVAHL_JAVAH = $(JAVAH)
+ 
+-LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir)
+-LINK_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS) -rpath $(libdir)
++LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS)
++LINK_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS)
+ 
+ # special link rule for mod_dav_svn
+-LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS)
++LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -avoid-version -module $(APACHE_LDFLAGS)
+ 
+ # Compilation of SWIG-generated C source code
+ COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
+ COMPILE_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_RB_COMPILE) $(CPPFLAGS) $(SWIG_RB_INCLUDES) -prefer-pic -c -o $@
+ 
+ # these commands link the wrapper objects into an extension library/module
+-LINK_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_PY_LINK) $(SWIG_LDFLAGS) -rpath $(swig_pydir) -avoid-version -module
+-LINK_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_RB_LINK) $(SWIG_LDFLAGS) -rpath $(swig_rbdir) -avoid-version -module
++LINK_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_PY_LINK) $(SWIG_LDFLAGS) -avoid-version -module
++LINK_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_RB_LINK) $(SWIG_LDFLAGS) -avoid-version -module
+ 
+-LINK_JAVAHL_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LT_CXX_LIBADD) -rpath $(libdir)
++LINK_JAVAHL_CXX = $(LIBTOOL) $(LTCXXFLAGS) --mode=link $(CXX) $(LT_LDFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LT_CXX_LIBADD)
+ 
+ INSTALL = @INSTALL@
+ INSTALL_LIB = $(LIBTOOL) --mode=install $(INSTALL)
+@@ -305,7 +305,7 @@
  clean: external-clean local-clean
  distclean: external-distclean local-distclean
  extraclean: external-extraclean local-extraclean
Index: Portfile
===================================================================
--- Portfile	(revision 74243)
+++ Portfile	(working copy)
@@ -30,7 +30,8 @@
 test.target		check
 test.env		CLEANUP=true
 
-patchfiles		patch-Makefile.in.diff
+patchfiles		patch-Makefile.in.diff \
+ 			patch-configure.diff
 
 configure.args		--with-berkeley-db=:${prefix}/include/db46:${prefix}/lib/db46:db-4.6 \
 			--with-neon=${prefix} --with-apr=${prefix}/bin/apr-1-config \
@@ -39,6 +40,14 @@
 			--disable-neon-version-check --with-serf=${prefix} \
 			--with-sasl=${prefix}
 
+# configure does not recognize this option
+configure.universal_args-delete --disable-dependency-tracking
+
+# Make sure to not use any already installed headers and libraries;
+# these are set in CPATH and LIBRARY_PATH anyway.  
+configure.cppflags-delete -I${prefix}/include
+configure.ldflags-delete  -L${prefix}/lib
+
 use_parallel_build	yes
 build.target		all
 
