diff -udr subversion-1.1.1.orig/Makefile.in subversion-1.1.1/Makefile.in
--- subversion-1.1.1.orig/Makefile.in	2004-09-11 17:45:29.000000000 +0200
+++ subversion-1.1.1/Makefile.in	2004-12-06 15:04:25.000000000 +0100
@@ -578,7 +578,7 @@
 $(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
 	cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
 
-swig-pl_DEPS = libsvn_client libsvn_delta libsvn_diff libsvn_fs libsvn_ra libsvn_repos libsvn_subr libsvn_wc libsvn_swig_perl $(SWIG_PL_DIR)/native/Makefile
+swig-pl_DEPS = libsvn_swig_perl $(SWIG_PL_DIR)/native/Makefile
 swig-pl: $(swig-pl_DEPS)
 	cd $(SWIG_PL_DIR)/native; $(MAKE)
 
diff -udr subversion-1.1.1.orig/ac-helpers/ltmain.sh subversion-1.1.1/ac-helpers/ltmain.sh
--- subversion-1.1.1.orig/ac-helpers/ltmain.sh	2004-10-22 20:13:13.000000000 +0200
+++ subversion-1.1.1/ac-helpers/ltmain.sh	2004-12-06 15:11:16.000000000 +0100
@@ -1395,6 +1395,8 @@
 	lib=
 	found=no
 	case $deplib in
+	-ldb-4.1*) continue ;;
+	libdb-4.1*) continue ;;
 	-l*)
 	  if test $linkmode = oldlib && test $linkmode = obj; then
 	    $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
@@ -3649,7 +3651,7 @@
 # if CDPATH is set.
 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
-relink_command=\"$relink_command\"
+relink_command=\"\""
 
 # This environment variable determines our operation mode.
 if test \"\$libtool_install_magic\" = \"$magic\"; then
@@ -4020,7 +4022,7 @@
 libdir='$install_libdir'"
 	  if test "$installed" = no && test $need_relink = yes; then
 	    $echo >> $output "\
-relink_command=\"$relink_command\""
+relink_command=\"\""
 	  fi
 	done
       fi
diff -udr subversion-1.1.1.orig/build/generator/gen_make.py subversion-1.1.1/build/generator/gen_make.py
--- subversion-1.1.1.orig/build/generator/gen_make.py	2004-08-10 00:30:31.000000000 +0200
+++ subversion-1.1.1/build/generator/gen_make.py	2004-12-06 15:16:54.000000000 +0100
@@ -5,6 +5,7 @@
 import os
 import sys
 import string
+import ConfigParser
 
 import gen_base
 
@@ -27,6 +28,13 @@
     install_deps = self.graph.get_deps(gen_base.DT_INSTALL)
     install_sources = self.graph.get_all_sources(gen_base.DT_INSTALL)
 
+    cp = ConfigParser.ConfigParser()
+    cp.read('gen-make.opts')
+    if cp.has_option('options', '--installed-libs'):
+      self.installed_libs = cp.get('options', '--installed-libs').split(',')
+    else:
+      self.installed_libs = []
+
     # ensure consistency between runs
     install_deps.sort()
     install_sources.sort(lambda s1, s2: cmp(s1.name, s2.name))
@@ -68,6 +76,8 @@
         elif isinstance(source, gen_base.TargetLinked):
           if source.external_lib:
             libs.append(source.external_lib)
+          elif source.name in self.installed_libs:
+            libs.append('-l%s-%s' % (source.name[3:], self.cfg.version))
           else:
             # append the output of the target to our stated dependencies
             deps.append(source.filename)
@@ -184,6 +194,8 @@
       for target in inst_targets:
         for target_dep in self.graph.get_sources(gen_base.DT_LINK, target.name,
                                                  gen_base.TargetLib):
+          if target_dep.name in self.installed_libs:
+            continue
           if target_dep.install and target_dep.install != area:
             install_deps['install-%s' % target_dep.install] = None
       install_deps = install_deps.keys()
@@ -356,11 +368,18 @@
 
         # construct a list of the other .la libs to link against
         retreat = build_path_retreat(target.path)
-        deps = [ target.filename ]
-        link = [ build_path_join(retreat, target.filename) ]
+        if target.name in self.installed_libs:
+          deps = []
+          link = [ '-l%s-%s' % (target.name[3:], self.cfg.version) ]
+        else:
+          deps = [ target.filename ]
+          link = [ build_path_join(retreat, target.filename) ]
         for source in self.graph.get_sources(gen_base.DT_LINK, target.name):
           if not isinstance(source, gen_base.TargetLib) or source.external_lib:
             continue
+          if source.name in self.installed_libs:
+            link.append('-l%s-%s' % (source.name[3:], self.cfg.version))
+            continue
           deps.append(source.filename)
           link.append(build_path_join(retreat, source.filename))
 
diff -udr subversion-1.1.1.orig/gen-make.py subversion-1.1.1/gen-make.py
--- subversion-1.1.1.orig/gen-make.py	2004-08-10 19:26:26.000000000 +0200
+++ subversion-1.1.1/gen-make.py	2004-12-06 15:08:00.000000000 +0100
@@ -62,6 +62,13 @@
   print
   print "           The default generator type is 'make'"
   print
+  print "  UNIX-specific options:"
+  print
+  print "  --installed-libs"
+  print "           Comma-separated list of Subversion libraries to find"
+  print "           pre-installed instead of building (probably only"
+  print "           useful for packagers)"
+  print
   print "  Windows-specific options:"
   print
   print "  --with-apr=DIR"
@@ -140,7 +147,8 @@
                                 'enable-purify',
                                 'enable-quantify',
                                 'enable-nls',
-                                'enable-bdb-in-apr-util'
+                                'enable-bdb-in-apr-util',
+                                'installed-libs=',
                                 ])
     if len(args) > 1:
       _usage_exit()
diff -udr subversion-1.1.1.orig/subversion/bindings/swig/perl/native/Makefile.PL.in subversion-1.1.1/subversion/bindings/swig/perl/native/Makefile.PL.in
--- subversion-1.1.1.orig/subversion/bindings/swig/perl/native/Makefile.PL.in	2004-09-14 18:32:08.000000000 +0200
+++ subversion-1.1.1/subversion/bindings/swig/perl/native/Makefile.PL.in	2004-12-06 15:14:23.000000000 +0100
@@ -3,7 +3,7 @@
 use Config;
 use Cwd 'abs_path';
 
-my $perl_path = $Config{perlpath};
+my $perl_path = $^X;
 if ($^O ne 'VMS') {
   $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i;
 }
@@ -103,7 +103,6 @@
 
    my $swig_modules_command = join ('',
                               map {"\nsvn_$_.c : $swig_srcdir/svn_$_.i ".
-                                   "$svnlib_builddir/libsvn_$_/libsvn_$_-1.la ".
                                    "ra_plugin.hi ra_reporter.hi ".
                                    "delta_editor.hi\n" .
                                    "\t$swig_command".
diff -udr subversion-1.1.1.orig/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c subversion-1.1.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
--- subversion-1.1.1.orig/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c  (revision 12471)
+++ subversion-1.1.1/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c  (patch 11x level 1)
@@ -31,6 +31,32 @@
 
 #include "swigutil_pl.h"
 
+/* cache SWIG_TypeQuery results in a perl hash */
+static HV *type_cache = NULL;
+
+#define _SWIG_TYPE(name) _swig_perl_type_query(name, sizeof (name)-1)
+#define POOLINFO         _SWIG_TYPE("apr_pool_t *")
+
+static swig_type_info *_swig_perl_type_query (const char *typename, U32 klen)
+{
+    SV **type_info;
+    swig_type_info *tinfo;
+
+    if (!type_cache)
+        type_cache = newHV ();
+
+    if (klen == 0)
+        klen = strlen (typename);
+
+    if ((type_info = hv_fetch(type_cache, typename, klen, 0)))
+        return (swig_type_info *) (SvIV (*type_info));
+
+    tinfo = SWIG_TypeQuery(typename);
+    hv_store(type_cache, typename, klen, newSViv ((IV)tinfo), 0);
+
+    return tinfo;
+}
+
 /* element convertors for perl -> c */
 typedef void *(*pl_element_converter_t)(SV *value, void *ctx, 
                                         apr_pool_t *pool);
@@ -97,7 +123,7 @@
                                              const char *typename,
                                              apr_pool_t *pool)
 {
-    swig_type_info *tinfo = SWIG_TypeQuery(typename);
+    swig_type_info *tinfo = _swig_perl_type_query(typename, 0);
     return svn_swig_pl_objs_to_hash (source, tinfo, pool);
 }
 
@@ -297,7 +323,7 @@
 	case 'S': /* swig object */
 	    o = va_arg (ap, void *);
 	    t = va_arg (ap, swig_type_info *);
-  
+
 	    obj = sv_newmortal ();
 	    SWIG_MakePtr (obj, o, t, 0);
 	    XPUSHs(obj);
@@ -411,37 +437,24 @@
     return newb;
 }
 
-static svn_error_t * close_baton(void *baton, const char *method)
+static svn_error_t * close_baton(void *baton, const char *method, apr_pool_t *pool)
 {
     item_baton *ib = baton;
-    dSP ;
 
-    ENTER ;
-    SAVETMPS ;
+    if (ib->baton) {
+        SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+                                             (void *)method, NULL,
+                                             "OOS", ib->editor, ib->baton,
+                                             pool, POOLINFO));
+        SvREFCNT_dec(ib->baton);
+    }
+    else {
+        SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
+                                             (void *)method, NULL,
+                                             "OS", ib->editor, pool, POOLINFO));
+    }
 
-    PUSHMARK(SP) ;
-    XPUSHs(ib->editor);
-
-    if (ib->baton)
-	XPUSHs(ib->baton);
-
-    PUTBACK;
-
-    call_method(method, G_DISCARD);
-
-    /* check result? */
-
     SvREFCNT_dec(ib->editor);
-    if (ib->baton)
-	SvREFCNT_dec(ib->baton);
-
-#ifdef SVN_DEBUG
-    ib->editor = ib->baton = NULL;
-#endif
-
-    FREETMPS ;
-    LEAVE ;
-
     return SVN_NO_ERROR;
 }
 
@@ -464,13 +477,12 @@
                                      void **root_baton)
 {
     item_baton *ib = edit_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"open_root", &result,
 				         "OrS", ib->editor, base_revision,
-				         dir_pool, poolinfo));
+				         dir_pool, POOLINFO));
 
     *root_baton = make_baton(dir_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -482,12 +494,11 @@
                                         apr_pool_t *pool)
 {
     item_baton *ib = parent_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"delete_entry", NULL,
 				         "OsrOS", ib->editor, path, revision,
-				         ib->baton, pool, poolinfo));
+				         ib->baton, pool, POOLINFO));
     return SVN_NO_ERROR;
 }
 
@@ -499,14 +510,13 @@
                                          void **child_baton)
 {
     item_baton *ib = parent_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"add_directory", &result,
 				         "OsOsrS", ib->editor, path, ib->baton,
 				         copyfrom_path, copyfrom_revision, 
-				         dir_pool, poolinfo));
+				         dir_pool, POOLINFO));
     *child_baton = make_baton(dir_pool, ib->editor, result);
     return SVN_NO_ERROR;
 }
@@ -519,12 +529,11 @@
 {
     item_baton *ib = parent_baton;
     SV *result;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"open_directory", &result,
 				         "OsOrS", ib->editor, path, ib->baton,
-				         base_revision, dir_pool, poolinfo));
+				         base_revision, dir_pool, POOLINFO));
 
     *child_baton = make_baton(dir_pool, ib->editor, result);
 
@@ -537,13 +546,12 @@
                                            apr_pool_t *pool)
 {
     item_baton *ib = dir_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"change_dir_prop", NULL,
 				         "OOssS", ib->editor, ib->baton, name,
 				         value ? value->data : NULL,
-				         pool, poolinfo));
+				         pool, POOLINFO));
 
     return SVN_NO_ERROR;
 }
@@ -551,7 +559,7 @@
 static svn_error_t * thunk_close_directory(void *dir_baton,
                                            apr_pool_t *pool)
 {
-    return close_baton(dir_baton, "close_directory");
+    return close_baton(dir_baton, "close_directory", pool);
 }
 
 static svn_error_t * thunk_absent_directory(const char *path,
@@ -559,12 +567,11 @@
 					    apr_pool_t *pool)
 {
     item_baton *ib = parent_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 	   			         (void *)"absent_directory", NULL,
 				         "OsOS", ib->editor, path, ib->baton,
-				         pool, poolinfo));
+				         pool, POOLINFO));
 
     return SVN_NO_ERROR;
 }
@@ -578,13 +585,12 @@
 {
     item_baton *ib = parent_baton;
     SV *result;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"add_file", &result,
 				         "OsOsrS", ib->editor, path, ib->baton,
 				         copyfrom_path, copyfrom_revision,
-				         file_pool, poolinfo));
+				         file_pool, POOLINFO));
 
     *file_baton = make_baton(file_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -597,13 +603,12 @@
                                      void **file_baton)
 {
     item_baton *ib = parent_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"open_file", &result,
 				         "OsOrS", ib->editor, path, ib->baton,
-				         base_revision, file_pool, poolinfo));
+				         base_revision, file_pool, POOLINFO));
 
     *file_baton = make_baton(file_pool, ib->editor, result);
     return SVN_NO_ERROR;
@@ -621,7 +626,7 @@
         SvREFCNT_dec(handler);
     }
     else {
-	swig_type_info *tinfo = SWIG_TypeQuery("svn_txdelta_window_t *");
+	swig_type_info *tinfo = _SWIG_TYPE("svn_txdelta_window_t *");
 	SVN_ERR (svn_swig_pl_callback_thunk (CALL_SV, handler,
 				             NULL, "S", window, tinfo));
     }
@@ -637,18 +642,17 @@
                       void **h_baton)
 {
     item_baton *ib = file_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
     SV *result;
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"apply_textdelta", &result,
 				         "OOsS", ib->editor, ib->baton,
-					 base_checksum, pool, poolinfo));
+					 base_checksum, pool, POOLINFO));
     if (SvOK(result)) {
 	if (SvROK(result) && SvTYPE(SvRV(result)) == SVt_PVAV) {
 	    swig_type_info *handler_info = 
-              SWIG_TypeQuery("svn_txdelta_window_handler_t");
-            swig_type_info *void_info = SWIG_TypeQuery("void *");
+              _SWIG_TYPE("svn_txdelta_window_handler_t");
+            swig_type_info *void_info = _SWIG_TYPE("void *");
 	    AV *array = (AV *)SvRV(result);
 
 	    if (SWIG_ConvertPtr(*av_fetch (array, 0, 0),
@@ -680,13 +684,12 @@
                                             apr_pool_t *pool)
 {
     item_baton *ib = file_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"change_file_prop", NULL,
 				         "OOssS", ib->editor, ib->baton, name,
 				         value ? value->data : NULL,
-				         pool, poolinfo));
+				         pool, POOLINFO));
   
     return SVN_NO_ERROR;
 }
@@ -696,20 +699,15 @@
                                       apr_pool_t *pool)
 {
     item_baton *ib = file_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"close_file", NULL, "OOsS",
 				         ib->editor, ib->baton, text_checksum,
-				         pool, poolinfo));
+				         pool, POOLINFO));
 
     SvREFCNT_dec(ib->editor);
     SvREFCNT_dec(ib->baton);
 
-#ifdef SVN_DEBUG
-    ib->editor = ib->baton = NULL;
-#endif
-
     return SVN_NO_ERROR;
 }
 
@@ -718,12 +716,11 @@
 				       apr_pool_t *pool)
 {
     item_baton *ib = parent_baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     SVN_ERR (svn_swig_pl_callback_thunk (CALL_METHOD,
 				         (void *)"absent_file", NULL,
 				         "OsOS", ib->editor, path, ib->baton,
-				         pool, poolinfo));
+				         pool, POOLINFO));
 
     return SVN_NO_ERROR;
 }
@@ -731,13 +728,13 @@
 static svn_error_t * thunk_close_edit(void *edit_baton,
                                       apr_pool_t *pool)
 {
-    return close_baton(edit_baton, "close_edit");
+    return close_baton(edit_baton, "close_edit", pool);
 }
 
 static svn_error_t * thunk_abort_edit(void *edit_baton,
                                       apr_pool_t *pool)
 {
-    return close_baton(edit_baton, "abort_edit");
+    return close_baton(edit_baton, "abort_edit", pool);
 }
 
 void svn_delta_make_editor(svn_delta_editor_t **editor,
@@ -777,8 +774,7 @@
 					    apr_pool_t *pool)
 {
     SV *receiver = baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
-    swig_type_info *tinfo = SWIG_TypeQuery("svn_log_changed_path_t *");
+    swig_type_info *tinfo = _SWIG_TYPE("svn_log_changed_path_t *");
 
     if (!SvOK(receiver))
 	return SVN_NO_ERROR;
@@ -788,7 +784,7 @@
 			        "OrsssS", (changed_paths) ?
 			        svn_swig_pl_convert_hash(changed_paths, tinfo)
 			        : &PL_sv_undef,
-			        rev, author, date, msg, pool, poolinfo);
+			        rev, author, date, msg, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -799,14 +795,13 @@
                                             apr_pool_t *pool)
 {
     SV *func = baton;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 
     if (!SvOK(func))
 	return SVN_NO_ERROR;
 
     svn_swig_pl_callback_thunk (CALL_SV,
 			        func, NULL,
-			        "srS", path, revision, pool, poolinfo);
+			        "srS", path, revision, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -818,15 +813,14 @@
                                            apr_pool_t *pool)
 {
     SV *func = baton, *result;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
-    swig_type_info *rootinfo = SWIG_TypeQuery("svn_fs_root_t *");
 
     if (!SvOK(func))
 	return SVN_NO_ERROR;
 
     svn_swig_pl_callback_thunk (CALL_SV,
 			        func, &result,
-			        "SsS", root, rootinfo, path, pool, poolinfo);
+			        "SsS", root, _SWIG_TYPE("svn_fs_root_t *"),
+                                path, pool, POOLINFO);
 
     *allowed = SvIV (result);
     SvREFCNT_dec (result);
@@ -855,7 +849,7 @@
 					 apr_pool_t *pool)
 {
     SV *result;
-    swig_type_info *tinfo = SWIG_TypeQuery("apr_file_t *");
+    swig_type_info *tinfo = _SWIG_TYPE("apr_file_t *");
 
     svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"open_tmp_file",
 			        &result, "OS", callback_baton, pool, POOLINFO);
@@ -902,7 +896,6 @@
 				   SV *perl_callbacks,
 				   apr_pool_t *pool)
 {
-    swig_type_info *tinfo = SWIG_TypeQuery("svn_auth_baton_t *");
     SV *auth_baton;
 
     *cb = apr_pcalloc (pool, sizeof(**cb));
@@ -915,7 +908,7 @@
     auth_baton = *hv_fetch((HV *)SvRV(perl_callbacks), "auth", 4, 0);
 
     if (SWIG_ConvertPtr(auth_baton, 
-                        (void **)&(*cb)->auth_baton, tinfo,0) < 0) {
+                        (void **)&(*cb)->auth_baton, _SWIG_TYPE("svn_auth_baton_t *"),0) < 0) {
 	croak("Unable to convert from SWIG Type");
     }
     *c_baton = perl_callbacks;
@@ -930,9 +923,6 @@
                                              svn_boolean_t may_save,
                                              apr_pool_t *pool)
 {
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
-    swig_type_info *credinfo = SWIG_TypeQuery ("svn_auth_cred_simple_t *");
-
     /* Be nice and allocate the memory for the cred structure before passing it
      * off to the perl space */
     *cred = apr_pcalloc (pool, sizeof (**cred));
@@ -941,8 +931,8 @@
     }
     svn_swig_pl_callback_thunk (CALL_SV,
                                 baton, NULL,
-                                "SssbS", *cred, credinfo,
-                                realm, username, may_save, pool, poolinfo);
+                                "SssbS", *cred, _SWIG_TYPE ("svn_auth_cred_simple_t *"),
+                                realm, username, may_save, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -953,9 +943,6 @@
                                                svn_boolean_t may_save,
                                                apr_pool_t *pool)
 {
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
-    swig_type_info *credinfo = SWIG_TypeQuery ("svn_auth_cred_username_t *");
-
     /* Be nice and allocate the memory for the cred structure before passing it
      * off to the perl space */
     *cred = apr_pcalloc (pool, sizeof (**cred));
@@ -964,8 +951,8 @@
     }
     svn_swig_pl_callback_thunk (CALL_SV,
                                 baton, NULL,
-                                "SsbS", *cred, credinfo,
-                                realm, may_save, pool, poolinfo);
+                                "SsbS", *cred, _SWIG_TYPE("svn_auth_cred_username_t *"),
+                                realm, may_save, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -979,12 +966,6 @@
                               svn_boolean_t may_save,
                               apr_pool_t *pool)
 {
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
-    swig_type_info *credinfo = SWIG_TypeQuery (
-                                 "svn_auth_cred_ssl_server_trust_t *");
-    swig_type_info *cert_info_info = SWIG_TypeQuery (
-                                 "svn_auth_ssl_server_cert_info_t *");
-
     /* Be nice and allocate the memory for the cred structure before passing it
      * off to the perl space */
     *cred = apr_pcalloc (pool, sizeof (**cred));
@@ -993,10 +974,10 @@
     }
     svn_swig_pl_callback_thunk (CALL_SV,
                                 baton, NULL,
-                                "SsiSbS", *cred, credinfo,
+                                "SsiSbS", *cred, _SWIG_TYPE ("svn_auth_cred_ssl_server_trust_t *"),
                                 realm, failures, 
-                                cert_info, cert_info_info,
-                                may_save, pool, poolinfo);
+                                cert_info, _SWIG_TYPE ("svn_auth_ssl_server_cert_info_t *"),
+                                may_save, pool, POOLINFO);
 
     /* Allow the perl callback to indicate failure by setting all vars to 0 
      * or by simply doing nothing.  While still allowing them to indicate
@@ -1017,10 +998,6 @@
                 svn_boolean_t may_save,
                 apr_pool_t *pool)
 {
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
-    swig_type_info *credinfo = SWIG_TypeQuery (
-                                 "svn_auth_cred_ssl_client_cert_t *");
-    
     /* Be nice and allocate the memory for the cred structure before passing it
      * off to the perl space */
     *cred = apr_pcalloc (pool, sizeof (**cred));
@@ -1029,8 +1006,8 @@
     }
     svn_swig_pl_callback_thunk (CALL_SV,
                                 baton, NULL,
-                                "SsbS", *cred, credinfo,
-                                realm, may_save, pool, poolinfo);
+                                "SsbS", *cred, _SWIG_TYPE ("svn_auth_cred_ssl_client_cert_t *"),
+                                realm, may_save, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -1042,10 +1019,6 @@
                                      svn_boolean_t may_save,
                                      apr_pool_t *pool)
 {
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
-    swig_type_info *credinfo = SWIG_TypeQuery (
-                                 "svn_auth_cred_ssl_client_cert_pw_t *");
-
     /* Be nice and allocate the memory for the cred structure before passing it
      * off to the perl space */
     *cred = apr_pcalloc (pool, sizeof (**cred));
@@ -1054,8 +1027,8 @@
     }
     svn_swig_pl_callback_thunk (CALL_SV,
                                 baton, NULL,
-                                "SsbS", *cred, credinfo,
-                                realm, may_save, pool, poolinfo);
+                                "SsbS", *cred, _SWIG_TYPE ("svn_auth_cred_ssl_client_cert_pw_t *"),
+                                realm, may_save, pool, POOLINFO);
 
     return SVN_NO_ERROR;
 }
@@ -1093,9 +1066,6 @@
     SV *log_msg_sv;
     SV *tmp_file_sv;
     SV *commit_items_sv;
-    swig_type_info *commit_itemsinfo = SWIG_TypeQuery 
-	                                ("svn_client_commit_item_t *");
-    swig_type_info *poolinfo = SWIG_TypeQuery ("apr_pool_t *");
 
     if (!SvOK((SV *)baton)) {
         *log_msg = apr_pstrdup (pool, "");
@@ -1105,13 +1075,13 @@
     
     log_msg_sv = newRV_noinc (sv_newmortal ());
     tmp_file_sv = newRV_noinc (sv_newmortal ());
-    commit_items_sv = svn_swig_pl_convert_array (commit_items, 
-			                         commit_itemsinfo);
+    commit_items_sv = svn_swig_pl_convert_array
+      (commit_items, _SWIG_TYPE("svn_client_commit_item_t *"));
 
     svn_swig_pl_callback_thunk (CALL_SV,
 	                        baton, &result,
 				"OOOS", log_msg_sv, tmp_file_sv,
-				commit_items_sv, pool, poolinfo);
+				commit_items_sv, pool, POOLINFO);
 
     if (!SvOK(SvRV(log_msg_sv))) {
         /* client returned undef to us */
@@ -1134,7 +1104,7 @@
     }
 
     if (sv_derived_from (result, "_p_svn_error_t")) {
-        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+        swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
 	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
             SvREFCNT_dec(result);
 	    croak("Unable to convert from SWIG Type");
@@ -1156,7 +1126,7 @@
     svn_swig_pl_callback_thunk(CALL_SV, cancel_baton, &result, "");
 
     if (sv_derived_from(result,"_p_svn_error_t")) { 
-        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+        swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
 	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
 	    SvREFCNT_dec(result);
 	    croak("Unable to convert from SWIG Type");
@@ -1179,7 +1149,7 @@
                              const char *path,
                              svn_wc_status_t *status)
 {
-  swig_type_info *statusinfo = SWIG_TypeQuery ("svn_wc_status_t *");
+  swig_type_info *statusinfo = _SWIG_TYPE ("svn_wc_status_t *");
 
   if (!SvOK ((SV *)baton)) {
     return;
@@ -1201,14 +1171,13 @@
 {
     SV *result;
     svn_error_t *ret_val = SVN_NO_ERROR;
-    swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
  
     svn_swig_pl_callback_thunk (CALL_SV, baton, &result, "LrsssS",
 		                line_no, revision, author, date, line,
-				pool, poolinfo);
+				pool, POOLINFO);
 
     if (sv_derived_from (result, "_p_svn_error_t")) {
-        swig_type_info *errorinfo = SWIG_TypeQuery("svn_error_t *");
+        swig_type_info *errorinfo = _SWIG_TYPE("svn_error_t *");
 	if (SWIG_ConvertPtr(result, (void *)&ret_val, errorinfo, 0) < 0) {
             SvREFCNT_dec(result);
 	    croak("Unable to convert from SWIG Type");
@@ -1251,12 +1220,11 @@
     apr_pool_t *pool;
 
     if (obj && sv_isobject (obj)) {
-	swig_type_info *poolinfo = SWIG_TypeQuery("apr_pool_t *");
 	if (sv_derived_from (obj, "SVN::Pool")) {
 	    obj = SvRV(obj);
 	}
 	if (sv_derived_from(obj, "_p_apr_pool_t")) {
-	    SWIG_ConvertPtr(obj, (void **)&pool, poolinfo, 0);
+	    SWIG_ConvertPtr(obj, (void **)&pool, POOLINFO, 0);
 	    return pool;
 	}
     }
@@ -1344,7 +1312,6 @@
 
 svn_error_t *svn_swig_pl_make_stream (svn_stream_t **stream, SV *obj)
 {
-    swig_type_info *tinfo = SWIG_TypeQuery("svn_stream_t *");
     IO *io;
     int simple_type = 1;
 
@@ -1361,7 +1328,7 @@
             simple_type = 0;
 
         if (simple_type) {
-            SWIG_ConvertPtr(obj, (void **)stream, tinfo, 0);
+            SWIG_ConvertPtr(obj, (void **)stream, _SWIG_TYPE("svn_stream_t *"), 0);
             return SVN_NO_ERROR;
         }
     }
@@ -1389,11 +1356,10 @@
 
 SV *svn_swig_pl_from_stream (svn_stream_t *stream)
 {
-    swig_type_info *tinfo = SWIG_TypeQuery("svn_stream_t *");
     SV *ret;
 
     svn_swig_pl_callback_thunk (CALL_METHOD, (void *)"new", &ret, "sS",
-			        "SVN::Stream", stream, tinfo);
+			        "SVN::Stream", stream, _SWIG_TYPE("svn_stream_t *"));
 
     return sv_2mortal (ret);
 }
