swig embeds its own C preprocessor which somehow breaks apr.h.  This is
the only workaround I can think of.  And yes, I *know* it's horrible.
(Harmless, though, as the bindings don't use APR_PATH_MAX anyway.)

See bug #341812 against swig 1.3.27-1.

--- Makefile.in
+++ Makefile.in
@@ -110,11 +110,13 @@
 SWIG = @SWIG@
 SWIG_VERSION = @SWIG_VERSION@
 SWIG_LIBSWIG_DIR = @SWIG_LIBSWIG_DIR@
+SWIG_1_3_27_HACK = -DPATH_MAX=4096
 SWIG_INCLUDES = -I$(SWIG_SRC_DIR) \
                 -I$(abs_srcdir)/subversion/include \
                 -I$(SWIG_LIBSWIG_DIR) \
                 -DSVN_SWIG_VERSION=$(SWIG_VERSION) \
                 -DSWIG_TABLE_TYPE=subversion \
+                $(SWIG_1_3_27_HACK) \
                 $(SVN_APR_INCLUDES) $(SVN_APRUTIL_INCLUDES)
 SWIG_NORUNTIME_FLAG = @SWIG_NORUNTIME_FLAG@
 SWIG_LDFLAGS = @SWIG_LDFLAGS@
--- subversion/bindings/swig/perl/native/Makefile.PL.in
+++ subversion/bindings/swig/perl/native/Makefile.PL.in
@@ -31,6 +31,8 @@
 my $apr_shlib_path_var = '@SVN_APR_SHLIB_PATH_VAR@';
 my $apr_cflags = '@SVN_APR_INCLUDES@';
 my $apu_cflags = '@SVN_APRUTIL_INCLUDES@';
+# Debian HACK to work around bug in swig 1.3.27.  Ewwww.  But it works.
+$apr_cflags .= ' -DPATH_MAX=4096';
 
 # According to the log of r7937, the flags guarded by the conditional break
 # the build on FreeBSD if not conditionalized.

