You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David James <ja...@gmail.com> on 2005/08/20 18:05:43 UTC

Major upgrades to SWIG/Python bindings in r15848

I've committed some major upgrades to SWIG/Python bindings in r15848
(Merged from the python-bindings-improvements branch).

Details below:
- Automated Test Suite for Python bindings
 * Test suite for memory pools (r15396, r15462)
 * Test suite for FS library (r15590, r15632)
 * In-build-directory testing (r15478)
 * Nightly smoke tests (r15505)
- Automatic Memory Management for Python bindings
 * Autogenerated proxy classes for SVN structs (r15428)
 * Hand-written proxy classes for APR structs (r15484)
 * Real reference counting for Pool objects (r15489, r15495, r15500)
 * Treat svn_string_t objects as Python strings (r15595)
 * Optional Pool Arguments (r15370, r15529)
- Better Documentation and error messages
 * Enabled SWIG autodoc feature (r15490)
 * Report assertion failures when variables are deleted prematurely
   (r15488, r15489, r15492)
 * Python argument numbers in error messages (r15460, r15493, r15525)
- Streamlined build process
 * Release versions of Subversion bindings can be built without SWIG (r15620,
   r15623, r15626, r15635, r15636, r15637, r15642, r15643)
 * Automatic dependency checking for SWIG files (r15381, r15405, r15426,
   r15429, r15430)
 * Makefile rule for clean-swig-py (r15476)
- Other changes
 * Compile-time type lookups for SWIG (r15396, r15407, r15408, r15409,
   r15412, r15417)
 * Move SWIG includes into include directory (r15407, r15408, r15413)
 * Refactoring (r15411, r15425, r15453, r15521, r15522, r15527, r15559)
 * SWIG bindings compile with Microsoft Visual C++ 6.0 (r15644)
 * Minor bugfixes (r15409, r15494, r15496, r15497, r15498, r15499, r15501,
   r15511, r15519, r15526, r15565, r15566, r15591, r15592, r15603, r15607,
   r15645, r15646, r15653, r15579)

To see commit logs for this feature, examine
/branches/python-bindings-improvements, r15365:15846

Approved by: kfogel
Review by: dannyb,
           breser,
           cmpilato,
           brane
Testing by: Troy Straszheim <tr...@resophonic.com>,
            Christian Boos <cb...@wanadoo.fr>,
            cmpilato

As gstein says, "It works on my machine" ;) Let me know if you run
into any issues.

On 8/20/05, djames@tigris.org <dj...@tigris.org> wrote:
> Author: djames
> Date: Sat Aug 20 12:36:30 2005
> New Revision: 15848
> 
> Added:
>    trunk/build/generator/gen_swig.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/build/generator/gen_swig.py
>    trunk/subversion/bindings/swig/include/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/
>    trunk/subversion/bindings/swig/include/apr.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/apr.swg
>    trunk/subversion/bindings/swig/include/proxy.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/proxy.swg
>    trunk/subversion/bindings/swig/include/svn_global.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/svn_global.swg
>    trunk/subversion/bindings/swig/include/svn_string.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/svn_string.swg
>    trunk/subversion/bindings/swig/include/svn_types.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/include/svn_types.swg
>    trunk/subversion/bindings/swig/proxy/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/proxy/
>    trunk/subversion/bindings/swig/proxy/apr_h.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/proxy/apr_h.swg
>    trunk/subversion/bindings/swig/proxy/proxy_apr.swg
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/proxy/proxy_apr.swg
>    trunk/subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS
>    trunk/subversion/bindings/swig/python/tests/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/
>    trunk/subversion/bindings/swig/python/tests/pool.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/pool.py
>    trunk/subversion/bindings/swig/python/tests/run_all.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/run_all.py
>    trunk/subversion/bindings/swig/python/tests/trac/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/
>    trunk/subversion/bindings/swig/python/tests/trac/__init__.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/__init__.py
>    trunk/subversion/bindings/swig/python/tests/trac/test.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/test.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/__init__.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/__init__.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/main.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/main.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/svn_fs.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/
>       - copied from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/__init__.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/__init__.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
>    trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svnrepos.dump
>       - copied unchanged from r15846, /branches/python-bindings-improvements/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svnrepos.dump
>    trunk/www/license-for-python-bindings.html
>       - copied unchanged from r15846, /branches/python-bindings-improvements/www/license-for-python-bindings.html
> Removed:
>    trunk/subversion/bindings/swig/apr.i
>    trunk/subversion/bindings/swig/perl/native/h2i.pl
>    trunk/subversion/bindings/swig/svn_string.i
>    trunk/subversion/bindings/swig/svn_types.i
> Modified:
>    trunk/Makefile.in
>    trunk/autogen.sh
>    trunk/build.conf
>    trunk/build/ac-macros/swig.m4
>    trunk/build/generator/gen_base.py
>    trunk/build/generator/gen_make.py
>    trunk/build/generator/gen_win.py
>    trunk/gen-make.py
>    trunk/subversion/bindings/swig/INSTALL
>    trunk/subversion/bindings/swig/core.i
>    trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
>    trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
>    trunk/subversion/bindings/swig/perl/native/Makefile.PL.in
>    trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
>    trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
>    trunk/subversion/bindings/swig/python/svn/core.py
>    trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
>    trunk/subversion/bindings/swig/svn_client.i
>    trunk/subversion/bindings/swig/svn_delta.i
>    trunk/subversion/bindings/swig/svn_fs.i
>    trunk/subversion/bindings/swig/svn_ra.i
>    trunk/subversion/bindings/swig/svn_repos.i
>    trunk/subversion/bindings/swig/svn_wc.i
>    trunk/tools/test-scripts/svntest/svntest-bindings.sh
> 
> Log:
> Merge python-bindings-improvements to trunk, by comparing trunkURL with
> branchURL.
> 
> New features:
> - Automated Test Suite
>  * Test suite for memory pools (r15396, r15462)
>  * Test suite for FS library (r15590, r15632)
>  * In-build-directory testing (r15478)
>  * Nightly smoke tests (r15505)
> - Automatic Memory Management
>  * Autogenerated proxy classes for SVN structs (r15428)
>  * Hand-written proxy classes for APR structs (r15484)
>  * Real reference counting for Pool objects (r15489, r15495, r15500)
>  * Treat svn_string_t objects as Python strings (r15595)
>  * Optional Pool Arguments (r15370, r15529)
> - Better Documentation and error messages
>  * Enabled SWIG autodoc feature (r15490)
>  * Report assertion failures when variables are deleted prematurely
>    (r15488, r15489, r15492)
>  * Python argument numbers in error messages (r15460, r15493, r15525)
> - Streamlined build process
>  * Release versions of Subversion bindings can be built without SWIG (r15620,
>    r15623, r15626, r15635, r15636, r15637, r15642, r15643)
>  * Automatic dependency checking for SWIG files (r15381, r15405, r15426,
>    r15429, r15430)
>  * Makefile rule for clean-swig-py (r15476)
> - Other changes
>  * Compile-time type lookups for SWIG (r15396, r15407, r15408, r15409,
>    r15412, r15417)
>  * Move SWIG includes into include directory (r15407, r15408, r15413)
>  * Refactoring (r15411, r15425, r15453, r15521, r15522, r15527, r15559)
>  * SWIG bindings compile with Microsoft Visual C++ 6.0 (r15644)
>  * Minor bugfixes (r15409, r15494, r15496, r15497, r15498, r15499, r15501,
>    r15511, r15519, r15526, r15565, r15566, r15591, r15592, r15603, r15607,
>    r15645, r15646, r15653, r15579)
> 
> To see commit logs for this feature, examine
> /branches/python-bindings-improvements, r15365:15846
> 
> Approved by: kfogel
> Review by: dannyb,
>            breser,
>            cmpilato,
>            brane
> Testing by: Troy Straszheim <tr...@resophonic.com>,
>             Christian Boos <cb...@wanadoo.fr>,
>             cmpilato
> 
> 
> 
> Modified: trunk/Makefile.in
> Url: http://svn.collab.net/viewcvs/svn/trunk/Makefile.in?rev=15848&p1=trunk/Makefile.in&p2=trunk/Makefile.in&r1=15847&r2=15848
> ==============================================================================
> --- trunk/Makefile.in   (original)
> +++ trunk/Makefile.in   Sat Aug 20 12:36:30 2005
> @@ -107,17 +107,11 @@
>  APACHE_TARGET = @APACHE_TARGET@
>  APACHE_LIBEXECDIR = $(DESTDIR)@APACHE_LIBEXECDIR@
> 
> -SWIG = @SWIG@
> -SWIG_VERSION = @SWIG_VERSION@
> -SWIG_LIBSWIG_DIR = @SWIG_LIBSWIG_DIR@
>  SWIG_INCLUDES = -I$(SWIG_SRC_DIR) \
> +                -I$(SWIG_SRC_DIR)/include \
> +                -I$(SWIG_SRC_DIR)/proxy \
>                  -I$(abs_srcdir)/subversion/include \
> -                -I$(SWIG_LIBSWIG_DIR) \
> -                -DSVN_SWIG_VERSION=$(SWIG_VERSION) \
> -                -DSWIG_TABLE_TYPE=subversion \
>                  $(SVN_APR_INCLUDES) $(SVN_APRUTIL_INCLUDES)
> -SWIG_NORUNTIME_FLAG = @SWIG_NORUNTIME_FLAG@
> -SWIG_LDFLAGS = @SWIG_LDFLAGS@
>  SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ -I$(SWIG_SRC_DIR)/python/libsvn_swig_py
>  SWIG_PY_COMPILE = @SWIG_PY_COMPILE@
>  SWIG_PY_LINK = @SWIG_PY_LINK@
> @@ -129,8 +123,6 @@
>  SWIG_RB_SITE_LIB_DIR = @SWIG_RB_SITE_LIB_DIR@
>  SWIG_RB_SITE_ARCH_DIR = @SWIG_RB_SITE_ARCH_DIR@
>  SWIG_RB_TEST_VERBOSE = @SWIG_RB_TEST_VERBOSE@
> -LSWIGPL = @LSWIGPL@
> -LSWIGPY = @LSWIGPY@
> 
>  JAVAHL_INCLUDES= @JNI_INCLUDES@ -I$(abs_builddir)/subversion/bindings/java/javahl/include
> 
> @@ -171,11 +163,6 @@
>  # 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
> 
> -# these commands run SWIG to generate wrapper source files (*.c)
> -### should we protect against swig not being available?
> -RUN_SWIG_PY = $(SWIG) $(SWIG_NORUNTIME_FLAG) -python $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -o $@
> -RUN_SWIG_RB = $(SWIG) -ruby $(SWIG_INCLUDES) $(SWIG_RB_INCLUDES) -o $@
> -
>  # Compilation of SWIG-generated C source code
>  COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
>  COMPILE_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_RB_COMPILE) $(CPPFLAGS) $(SWIG_INCLUDES) $(SWIG_RB_INCLUDES) -prefer-pic -c -o $@
> @@ -219,9 +206,11 @@
>  # The path to generated and complementary source files for the SWIG
>  # bindings.
>  SWIG_PL_DIR = $(abs_builddir)/subversion/bindings/swig/perl
> +SWIG_PY_DIR = $(abs_builddir)/subversion/bindings/swig/python
>  SWIG_RB_DIR = $(abs_builddir)/subversion/bindings/swig/ruby
> 
> -# The path to the source files for the Ruby SWIG
> +# The path to the source files for the SWIG bindings
> +SWIG_PY_SRC_DIR = $(abs_srcdir)/subversion/bindings/swig/python
>  SWIG_RB_SRC_DIR = $(abs_srcdir)/subversion/bindings/swig/ruby
> 
>  ### Automate JAR creation using Makefile generator's javahl-java.jar
> @@ -611,6 +600,28 @@
>         if [ -f "$(SWIG_PL_DIR)/native/Makefile" ]; then \
>           cd $(SWIG_PL_DIR)/native; $(MAKE) clean; \
>         fi
> +
> +$(SWIG_PY_DIR)/libsvn:
> +       ln -sf $(SWIG_PY_DIR) $(SWIG_PY_DIR)/libsvn
> +
> +$(SWIG_PY_DIR)/__init__.py:
> +       cp -f $(SWIG_PY_SRC_DIR)/__init__.py $(SWIG_PY_DIR)
> +
> +swig-py: $(SWIG_PY_DIR)/libsvn $(SWIG_PY_DIR)/__init__.py
> +
> +check-swig-py: swig-py
> +       cd $(SWIG_PY_DIR); \
> +         $(PYTHON) $(SWIG_PY_SRC_DIR)/tests/run_all.py
> +
> +clean-swig-py:
> +       rm -f $(SWIG_PY_SRC_DIR)/svn/*.pyc $(SWIG_PY_SRC_DIR)/tests/*.pyc \
> +             $(SWIG_PY_DIR)/libsvn
> +       test $(SWIG_PY_DIR) = $(SWIG_PY_SRC_DIR) || rm -f $(SWIG_PY_DIR)/__init__.py
> +       for d in $(SWIG_PY_DIR) $(SWIG_PY_DIR)/libsvn_swig_py; \
> +       do \
> +         cd $$d && rm -rf svn_*.c _*.c core.c *.lo *.la *.o *.pyc .libs \
> +                 client.py core.py delta.py fs.py ra.py repos.py wc.py; \
> +       done
> 
>  check-swig-rb: swig-rb svnserve
>         cd $(SWIG_RB_DIR); \
> 
> Modified: trunk/autogen.sh
> Url: http://svn.collab.net/viewcvs/svn/trunk/autogen.sh?rev=15848&p1=trunk/autogen.sh&p2=trunk/autogen.sh&r1=15847&r2=15848
> ==============================================================================
> --- trunk/autogen.sh    (original)
> +++ trunk/autogen.sh    Sat Aug 20 12:36:30 2005
> @@ -95,6 +95,15 @@
>    fi
>  fi
> 
> +# Compile SWIG headers into standalone C files if we are in release mode
> +if test -n "$RELEASE_MODE"; then
> +  echo "Generating SWIG code..."
> +  echo abs_srcdir=. > autogen-standalone.mk
> +  cat build-outputs.mk >> autogen-standalone.mk
> +  make -f autogen-standalone.mk autogen-swig
> +  rm autogen-standalone.mk
> +fi
> +
>  if test -n "$gen_failed"; then
>    echo "ERROR: gen-make.py failed"
>    exit 1
> 
> Modified: trunk/build.conf
> Url: http://svn.collab.net/viewcvs/svn/trunk/build.conf?rev=15848&p1=trunk/build.conf&p2=trunk/build.conf&r1=15847&r2=15848
> ==============================================================================
> --- trunk/build.conf    (original)
> +++ trunk/build.conf    Sat Aug 20 12:36:30 2005
> @@ -25,7 +25,9 @@
>  #
> 
>  [options]
> +include-dirs = subversion/include
>  includes = subversion/include/*.h
> +include-wildcards = *.h *.i *.swg
> 
>  # Makefile.in and config.m4 (omit README)
>  static-apache-files = subversion/mod_dav_svn/static/[Mc]*
> @@ -62,12 +64,21 @@
> 
>  bdb-test-scripts =
> 
> +swig-include-dirs = subversion/bindings/swig/include
> +                    subversion/bindings/swig/proxy
> +swig-includes = subversion/bindings/swig/include/*.swg
> +                subversion/bindings/swig/proxy/*.swg
> +swig-python-opts = -python -classic -w451 -w305
> +swig-perl-opts = -perl -nopm -noproxy -w453
> +swig-ruby-opts = -ruby -w453
>  swig-languages = python perl ruby
>  swig-dirs =
>          subversion/bindings/swig/python
>          subversion/bindings/swig/perl
>          subversion/bindings/swig/ruby
> 
> +swig-proxy-dir = subversion/bindings/swig/proxy
> +
>  # ----------------------------------------------------------------------------
>  #
>  # BUILD TARGETS
> @@ -342,8 +353,7 @@
>  lang = python
>  path = subversion/bindings/swig/python/libsvn_swig_py
>  libs = libsvn_subr libsvn_delta aprutil apriconv apr
> -# need SWIG_LDFLAGS to be able to link swig_runtime
> -link-cmd = $(LINK) $(SWIG_LDFLAGS) $(SWIG_PY_LIBS)
> +link-cmd = $(LINK) $(SWIG_PY_LIBS)
>  install = swig-py-lib
>  # need special build rule to include -DSWIGPYTHON
>  compile-cmd = $(COMPILE_SWIG_PY)
> 
> Modified: trunk/build/ac-macros/swig.m4
> Url: http://svn.collab.net/viewcvs/svn/trunk/build/ac-macros/swig.m4?rev=15848&p1=trunk/build/ac-macros/swig.m4&p2=trunk/build/ac-macros/swig.m4&r1=15847&r2=15848
> ==============================================================================
> --- trunk/build/ac-macros/swig.m4       (original)
> +++ trunk/build/ac-macros/swig.m4       Sat Aug 20 12:36:30 2005
> @@ -33,234 +33,144 @@
>  AC_DEFUN(SVN_FIND_SWIG,
>  [
>    where=$1
> -
> -  if test $where = check; then
> -    AC_PATH_PROG(SWIG, swig, none)
> -  else
> -    if test -f "$where"; then
> -      SWIG="$where"
> -    else
> -      SWIG="$where/bin/swig"
> -    fi
> -    if test ! -f "$SWIG" -o ! -x "$SWIG"; then
> -      AC_MSG_ERROR([Could not find swig binary at $SWIG])
> -    fi
> -  fi
> -
> -  if test "$SWIG" != "none"; then
> -    AC_MSG_CHECKING([swig version])
> -    SWIG_VERSION_RAW="`$SWIG -version 2>&1 | \
> -                       sed -ne 's/^.*Version \(.*\)$/\1/p'`"
> -    # We want the version as an integer so we can test against
> -    # which version we're using.  SWIG doesn't provide this
> -    # to us so we have to come up with it on our own.
> -    # The major is passed straight through,
> -    # the minor is zero padded to two places,
> -    # and the patch level is zero padded to three places.
> -    # e.g. 1.3.21 becomes 103021
> -    SWIG_VERSION="`echo \"$SWIG_VERSION_RAW\" | \
> -                  sed -e 's/[[^0-9\.]].*$//' \
> -                      -e 's/\.\([[0-9]]\)$/.0\1/' \
> -                      -e 's/\.\([[0-9]][[0-9]]\)$/.0\1/' \
> -                      -e 's/\.\([[0-9]]\)\./0\1/; s/\.//g;'`"
> -    AC_MSG_RESULT([$SWIG_VERSION_RAW])
> -    AC_SUBST(SWIG_VERSION)
> -    # If you change the required swig version number, don't forget to update:
> -    #   subversion/bindings/swig/INSTALL
> -    #   subversion/bindings/swig/README
> -    #   packages/rpm/mandrake-9.0/subversion.spec
> -    #   packages/rpm/redhat-7.x/subversion.spec
> -    #   packages/rpm/redhat-8.x/subversion.spec
> -    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103019" -a \
> -                                       "$SWIG_VERSION" -lt "103022" -o \
> -                                       "$SWIG_VERSION" -ge "103024"; then
> -      SWIG_SUITABLE=yes
> -
> -      dnl Newer versions of SWIG have deprecated the -c "do not
> -      dnl include SWIG runtime functions (used for creating multi-module
> -      dnl packages)" in favor of the -noruntime flag.
> -      if test "$SWIG_VERSION" -ge "103024"; then
> -        SWIG_NORUNTIME_FLAG=''
> -        LSWIGPL=''
> -        LSWIGPY=''
> -      else
> -        if test "$SWIG_VERSION" -ge "103020"; then
> -          SWIG_NORUNTIME_FLAG='-noruntime'
> -        else
> -          SWIG_NORUNTIME_FLAG='-c'
> -        fi
> -        LSWIGPL='-lswigpl'
> -        LSWIGPY='-lswigpy'
> +  SWIG_SUITABLE=yes
> +  SWIG_PY_COMPILE="none"
> +  SWIG_PY_LINK="none"
> +  if test "$PYTHON" != "none" -a "$SWIG_SUITABLE" = "yes"; then
> +    AC_MSG_NOTICE([Configuring python swig binding])
> +    SWIG_CLEAN_RULES="$SWIG_CLEAN_RULES clean-swig-py"
> +
> +    AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
> +      ac_cv_python_includes="`$PYTHON ${abs_srcdir}/build/get-py-info.py --includes`"
> +    ])
> +    SWIG_PY_INCLUDES="\$(SWIG_INCLUDES) $ac_cv_python_includes"
> +
> +    AC_CACHE_CHECK([for compiling Python extensions], [ac_cv_python_compile],[
> +      ac_cv_python_compile="`$PYTHON ${abs_srcdir}/build/get-py-info.py --compile`"
> +    ])
> +    SWIG_PY_COMPILE="$ac_cv_python_compile"
> +
> +    AC_CACHE_CHECK([for linking Python extensions], [ac_cv_python_link],[
> +      ac_cv_python_link="`$PYTHON ${abs_srcdir}/build/get-py-info.py --link`"
> +    ])
> +    SWIG_PY_LINK="$ac_cv_python_link"
> +
> +    AC_CACHE_CHECK([for linking Python libraries], [ac_cv_python_libs],[
> +      ac_cv_python_libs="`$PYTHON ${abs_srcdir}/build/get-py-info.py --libs`"
> +    ])
> +    SWIG_PY_LIBS="$ac_cv_python_libs"
> +
> +    dnl Sun Forte adds an extra space before substituting APR_INT64_T_FMT
> +    dnl gcc-2.95 adds an extra space after substituting APR_INT64_T_FMT
> +    dnl thus the egrep patterns have a + in them.
> +    SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
> +    CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
> +    AC_CACHE_CHECK([for apr_int64_t Python/C API format string],
> +                   [svn_cv_pycfmt_apr_int64_t], [
> +      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> +        AC_EGREP_CPP([MaTcHtHiS +\"lld\" +EnDeNd],
> +                     [#include <apr.h>
> +                      MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> +                     [svn_cv_pycfmt_apr_int64_t="L"])
>        fi
> -
> -    else
> -      SWIG_SUITABLE=no
> -      AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
> -      AC_MSG_WARN([This is not compatible with Subversion])
> -      AC_MSG_WARN([Subversion can use SWIG versions 1.3.19, 1.3.20, 1.3.21])
> -      AC_MSG_WARN([or 1.3.24 or later])
> -    fi
> -
> -    if test "$SWIG_SUITABLE" = "yes"; then
> -      AC_CACHE_CHECK([for swig library directory], [ac_cv_swig_swiglib_dir],[
> -                      ac_cv_swig_swiglib_dir="`$SWIG -swiglib`"
> -                     ])
> -      SWIG_LIBSWIG_DIR="$ac_cv_swig_swiglib_dir"
> -    fi
> -
> -    SWIG_PY_COMPILE="none"
> -    SWIG_PY_LINK="none"
> -    if test "$PYTHON" != "none" -a "$SWIG_SUITABLE" = "yes"; then
> -      AC_MSG_NOTICE([Configuring python swig binding])
> -      AC_CACHE_CHECK([if swig needs -L for its libraries],
> -        [ac_cv_swig_ldflags],[
> -        # The swig libraries are one directory above the
> -        # `swig -swiglib` directory.
> -        ac_cv_swig_ldflags=""
> -        swig_lib_dir="`dirname $ac_cv_swig_swiglib_dir`"
> -        if test "$swig_lib_dir" &&
> -           test "$swig_lib_dir" != "/lib" &&
> -           test "$swig_lib_dir" != "/usr/lib"; then
> -          ac_cv_swig_ldflags="-L$swig_lib_dir"
> -        fi
> -      ])
> -      SWIG_LDFLAGS="$ac_cv_swig_ldflags"
> -
> -      AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
> -        ac_cv_python_includes="`$PYTHON ${abs_srcdir}/build/get-py-info.py --includes`"
> -      ])
> -      SWIG_PY_INCLUDES="\$(SWIG_INCLUDES) $ac_cv_python_includes"
> -
> -      AC_CACHE_CHECK([for compiling Python extensions], [ac_cv_python_compile],[
> -        ac_cv_python_compile="`$PYTHON ${abs_srcdir}/build/get-py-info.py --compile`"
> -      ])
> -      SWIG_PY_COMPILE="$ac_cv_python_compile"
> -
> -      AC_CACHE_CHECK([for linking Python extensions], [ac_cv_python_link],[
> -        ac_cv_python_link="`$PYTHON ${abs_srcdir}/build/get-py-info.py --link`"
> -      ])
> -      SWIG_PY_LINK="$ac_cv_python_link"
> -
> -      AC_CACHE_CHECK([for linking Python libraries], [ac_cv_python_libs],[
> -        ac_cv_python_libs="`$PYTHON ${abs_srcdir}/build/get-py-info.py --libs`"
> -      ])
> -      SWIG_PY_LIBS="$ac_cv_python_libs"
> -
> -      dnl Sun Forte adds an extra space before substituting APR_INT64_T_FMT
> -      dnl gcc-2.95 adds an extra space after substituting APR_INT64_T_FMT
> -      dnl thus the egrep patterns have a + in them.
> -      SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
> -      CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
> -      AC_CACHE_CHECK([for apr_int64_t Python/C API format string],
> -                     [svn_cv_pycfmt_apr_int64_t], [
> -        if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> -          AC_EGREP_CPP([MaTcHtHiS +\"lld\" +EnDeNd],
> -                       [#include <apr.h>
> -                        MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> -                       [svn_cv_pycfmt_apr_int64_t="L"])
> -        fi
> -        if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> -          AC_EGREP_CPP([MaTcHtHiS +\"ld\" +EnDeNd],r
> -                       [#include <apr.h>
> -                        MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> -                       [svn_cv_pycfmt_apr_int64_t="l"])
> -        fi
> -        if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> -          AC_EGREP_CPP([MaTcHtHiS +\"d\" +EnDeNd],
> -                       [#include <apr.h>
> -                        MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> -                       [svn_cv_pycfmt_apr_int64_t="i"])
> -        fi
> -      ])
> -      CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
>        if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> -        AC_MSG_ERROR([failed to recognize APR_INT64_T_FMT on this platform])
> +        AC_EGREP_CPP([MaTcHtHiS +\"ld\" +EnDeNd],r
> +                     [#include <apr.h>
> +                      MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> +                     [svn_cv_pycfmt_apr_int64_t="l"])
>        fi
> -      AC_DEFINE_UNQUOTED([SVN_APR_INT64_T_PYCFMT],
> -                         ["$svn_cv_pycfmt_apr_int64_t"],
> -                         [Define to the Python/C API format character suitable]
> -                         [ for apr_int64_t])
> -    fi
> -
> -    if test "$PERL" != "none" -a "$SWIG_SUITABLE" = "yes"; then
> -      AC_MSG_CHECKING([perl version])
> -      dnl Note that the q() bit is there to avoid unbalanced brackets
> -      dnl which m4 really doesn't like.
> -      PERL_VERSION="`$PERL -e 'q([[); print $]] * 1000000,$/;'`"
> -      AC_MSG_RESULT([$PERL_VERSION])
> -      if test "$PERL_VERSION" -ge "5008000"; then
> -        SWIG_CLEAN_RULES="$SWIG_CLEAN_RULES clean-swig-pl"
> -        SWIG_PL_INCLUDES="\$(SWIG_INCLUDES) `$PERL -MExtUtils::Embed -e ccopts`"
> -      else
> -        AC_MSG_WARN([perl bindings require perl 5.8.0 or newer.])
> +      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> +        AC_EGREP_CPP([MaTcHtHiS +\"d\" +EnDeNd],
> +                     [#include <apr.h>
> +                      MaTcHtHiS APR_INT64_T_FMT EnDeNd],
> +                     [svn_cv_pycfmt_apr_int64_t="i"])
>        fi
> +    ])
> +    CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
> +    if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
> +      AC_MSG_ERROR([failed to recognize APR_INT64_T_FMT on this platform])
> +    fi
> +    AC_DEFINE_UNQUOTED([SVN_APR_INT64_T_PYCFMT],
> +                       ["$svn_cv_pycfmt_apr_int64_t"],
> +                       [Define to the Python/C API format character suitable]
> +                       [ for apr_int64_t])
> +  fi
> +
> +  if test "$PERL" != "none" -a "$SWIG_SUITABLE" = "yes"; then
> +    AC_MSG_CHECKING([perl version])
> +    dnl Note that the q() bit is there to avoid unbalanced brackets
> +    dnl which m4 really doesn't like.
> +    PERL_VERSION="`$PERL -e 'q([[); print $]] * 1000000,$/;'`"
> +    AC_MSG_RESULT([$PERL_VERSION])
> +    if test "$PERL_VERSION" -ge "5008000"; then
> +      SWIG_CLEAN_RULES="$SWIG_CLEAN_RULES clean-swig-pl"
> +      SWIG_PL_INCLUDES="\$(SWIG_INCLUDES) `$PERL -MExtUtils::Embed -e ccopts`"
> +    else
> +      AC_MSG_WARN([perl bindings require perl 5.8.0 or newer.])
>      fi
> +  fi
> 
> -    SWIG_RB_COMPILE="none"
> -    SWIG_RB_LINK="none"
> -    if test "$RUBY" != "none" -a \
> -        "$SWIG_SUITABLE" = "yes" -a \
> -        "$SWIG_VERSION" -ge "103024"; then
> -
> -      AC_MSG_NOTICE([Configuring Ruby SWIG binding])
> -      SWIG_CLEAN_RULES="$SWIG_CLEAN_RULES clean-swig-rb"
> -
> -      AC_CACHE_CHECK([for Ruby include path], [svn_cv_ruby_includes],[
> -        svn_cv_ruby_includes="-I. -I`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(archdir))'`"
> -      ])
> -      SWIG_RB_INCLUDES="\$(SWIG_INCLUDES) $svn_cv_ruby_includes"
> -
> -      AC_CACHE_CHECK([how to compile Ruby extensions], [svn_cv_ruby_compile],[
> -        svn_cv_ruby_compile="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(CC)), %q( ), Config::CONFIG.fetch(%q(CFLAGS))'` \$(SWIG_RB_INCLUDES)"
> -      ])
> -      SWIG_RB_COMPILE="$svn_cv_ruby_compile"
> -
> -      AC_CACHE_CHECK([how to link Ruby extensions], [svn_cv_ruby_link],[
> -        svn_cv_ruby_link="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(LDSHARED)).sub(/^\S+/, Config::CONFIG.fetch(%q(CC)) + %q( -shrext .) + Config::CONFIG.fetch(%q(DLEXT)))'`"
> -      ])
> -      SWIG_RB_LINK="$svn_cv_ruby_link"
> -
> -      AC_CACHE_VAL([svn_cv_ruby_sitedir],[
> -        svn_cv_ruby_sitedir="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitedir))'`"
> -      ])
> -      AC_ARG_WITH([ruby-sitedir],
> -                 AC_HELP_STRING([--with-ruby-sitedir=SITEDIR],
> -                                 [install Ruby bindings in SITEDIR
> -                                  (default is same as ruby's one)]),
> -                 [svn_ruby_installdir="$withval"],
> -                 [svn_ruby_installdir="$svn_cv_ruby_sitedir"])
> -
> -      AC_MSG_CHECKING([where to install Ruby scripts])
> -      AC_CACHE_VAL([svn_cv_ruby_sitedir_libsuffix],[
> -        svn_cv_ruby_sitedir_libsuffix="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitelibdir)).sub(/^#{Config::CONFIG.fetch(%q(sitedir))}/, %q())'`"
> -      ])
> -      SWIG_RB_SITE_LIB_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_libsuffix}"
> -      AC_MSG_RESULT([$SWIG_RB_SITE_LIB_DIR])
> -
> -      AC_MSG_CHECKING([where to install Ruby extensions])
> -      AC_CACHE_VAL([svn_cv_ruby_sitedir_archsuffix],[
> -        svn_cv_ruby_sitedir_archsuffix="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitearchdir)).sub(/^#{Config::CONFIG.fetch(%q(sitedir))}/, %q())'`"
> -      ])
> -      SWIG_RB_SITE_ARCH_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_archsuffix}"
> -      AC_MSG_RESULT([$SWIG_RB_SITE_ARCH_DIR])
> -
> -      AC_MSG_CHECKING([how to use output level for Ruby bindings tests])
> -      AC_CACHE_VAL([svn_cv_ruby_test_verbose],[
> -        svn_cv_ruby_test_verbose="normal"
> -      ])
> -      AC_ARG_WITH([ruby-test-verbose],
> -                 AC_HELP_STRING([--with-ruby-test-verbose=LEVEL],
> -                                 [how to use output level for Ruby bindings tests
> -                                  (default is normal)]),
> -                 [svn_ruby_test_verbose="$withval"],
> +  SWIG_RB_COMPILE="none"
> +  SWIG_RB_LINK="none"
> +  if test "$RUBY" != "none" -a \
> +        "$SWIG_SUITABLE" = "yes"; then
> +
> +    AC_MSG_NOTICE([Configuring Ruby SWIG binding])
> +    SWIG_CLEAN_RULES="$SWIG_CLEAN_RULES clean-swig-rb"
> +
> +    AC_CACHE_CHECK([for Ruby include path], [svn_cv_ruby_includes],[
> +    svn_cv_ruby_includes="-I. -I`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(archdir))'`"
> +    ])
> +    SWIG_RB_INCLUDES="\$(SWIG_INCLUDES) $svn_cv_ruby_includes"
> +
> +    AC_CACHE_CHECK([how to compile Ruby extensions], [svn_cv_ruby_compile],[
> +      svn_cv_ruby_compile="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(CC)), %q( ), Config::CONFIG.fetch(%q(CFLAGS))'` \$(SWIG_RB_INCLUDES)"
> +    ])
> +    SWIG_RB_COMPILE="$svn_cv_ruby_compile"
> +
> +    AC_CACHE_CHECK([how to link Ruby extensions], [svn_cv_ruby_link],[
> +      svn_cv_ruby_link="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(LDSHARED)).sub(/^\S+/, Config::CONFIG.fetch(%q(CC)) + %q( -shrext .) + Config::CONFIG.fetch(%q(DLEXT)))'`"
> +    ])
> +    SWIG_RB_LINK="$svn_cv_ruby_link"
> +
> +    AC_CACHE_VAL([svn_cv_ruby_sitedir],[
> +      svn_cv_ruby_sitedir="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitedir))'`"
> +    ])
> +    AC_ARG_WITH([ruby-sitedir],
> +    AC_HELP_STRING([--with-ruby-sitedir=SITEDIR],
> +                               [install Ruby bindings in SITEDIR
> +                                (default is same as ruby's one)]),
> +    [svn_ruby_installdir="$withval"],
> +    [svn_ruby_installdir="$svn_cv_ruby_sitedir"])
> +
> +    AC_MSG_CHECKING([where to install Ruby scripts])
> +    AC_CACHE_VAL([svn_cv_ruby_sitedir_libsuffix],[
> +      svn_cv_ruby_sitedir_libsuffix="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitelibdir)).sub(/^#{Config::CONFIG.fetch(%q(sitedir))}/, %q())'`"
> +    ])
> +    SWIG_RB_SITE_LIB_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_libsuffix}"
> +    AC_MSG_RESULT([$SWIG_RB_SITE_LIB_DIR])
> +
> +    AC_MSG_CHECKING([where to install Ruby extensions])
> +    AC_CACHE_VAL([svn_cv_ruby_sitedir_archsuffix],[
> +      svn_cv_ruby_sitedir_archsuffix="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(sitearchdir)).sub(/^#{Config::CONFIG.fetch(%q(sitedir))}/, %q())'`"
> +    ])
> +    SWIG_RB_SITE_ARCH_DIR="${svn_ruby_installdir}${svn_cv_ruby_sitedir_archsuffix}"
> +    AC_MSG_RESULT([$SWIG_RB_SITE_ARCH_DIR])
> +
> +    AC_MSG_CHECKING([how to use output level for Ruby bindings tests])
> +    AC_CACHE_VAL([svn_cv_ruby_test_verbose],[
> +      svn_cv_ruby_test_verbose="normal"
> +    ])
> +    AC_ARG_WITH([ruby-test-verbose],
> +    AC_HELP_STRING([--with-ruby-test-verbose=LEVEL],
> +                               [how to use output level for Ruby bindings tests
> +                                (default is normal)]),
> +    [svn_ruby_test_verbose="$withval"],
>                   [svn_ruby_test_verbose="$svn_cv_ruby_test_verbose"])
>        SWIG_RB_TEST_VERBOSE="$svn_ruby_test_verbose"
>        AC_MSG_RESULT([$SWIG_RB_TEST_VERBOSE])
> -    fi
> -
>    fi
>    AC_SUBST(SWIG_CLEAN_RULES)
> -  AC_SUBST(SWIG_NORUNTIME_FLAG)
>    AC_SUBST(SWIG_PY_INCLUDES)
>    AC_SUBST(SWIG_PY_COMPILE)
>    AC_SUBST(SWIG_PY_LINK)
> @@ -272,8 +182,4 @@
>    AC_SUBST(SWIG_RB_SITE_LIB_DIR)
>    AC_SUBST(SWIG_RB_SITE_ARCH_DIR)
>    AC_SUBST(SWIG_RB_TEST_VERBOSE)
> -  AC_SUBST(SWIG_LIBSWIG_DIR)
> -  AC_SUBST(LSWIGPL)
> -  AC_SUBST(LSWIGPY)
> -  AC_SUBST(SWIG_LDFLAGS)
>  ])
> 
> Modified: trunk/build/generator/gen_base.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/build/generator/gen_base.py?rev=15848&p1=trunk/build/generator/gen_base.py&p2=trunk/build/generator/gen_base.py&r1=15847&r2=15848
> ==============================================================================
> --- trunk/build/generator/gen_base.py   (original)
> +++ trunk/build/generator/gen_base.py   Sat Aug 20 12:36:30 2005
> @@ -52,6 +52,8 @@
>      # Read in the global options
>      self.includes = \
>          _collect_paths(parser.get('options', 'includes'))
> +    self.swig_includes = \
> +        _collect_paths(parser.get('options', 'swig-includes'))
>      self.apache_files = \
>          _collect_paths(parser.get('options', 'static-apache-files'))
>      self.scripts = \
> @@ -59,7 +61,15 @@
>      self.bdb_scripts = \
>          _collect_paths(parser.get('options', 'bdb-test-scripts'))
> 
> +    self.include_dirs = parser.get('options','include-dirs')
> +    self.swig_include_dirs = parser.get('options','swig-include-dirs')
> +    self.swig_python_opts = parser.get('options','swig-python-opts')
> +    self.swig_perl_opts = parser.get('options','swig-perl-opts')
> +    self.swig_ruby_opts = parser.get('options','swig-ruby-opts')
> +    self.include_wildcards = \
> +      string.split(parser.get('options', 'include-wildcards'))
>      self.swig_lang = string.split(parser.get('options', 'swig-languages'))
> +    self.swig_proxy_dir = parser.get('options', 'swig-proxy-dir')
>      self.swig_dirs = string.split(parser.get('options', 'swig-dirs'))
> 
>      # Visual C++ projects - contents are either TargetProject instances,
> @@ -121,13 +131,19 @@
>              self.graph.bulk_add(dep_type, target.name,
>                                  dep_section.get_dep_targets(target))
> 
> -  def compute_hdr_deps(self):
> -    all_includes = map(native_path, self.includes)
> +  def compute_hdrs(self):
> +    """Get a list of the header files"""
> +    all_includes = map(native_path, self.includes + self.swig_includes)
>      for d in unique(self.target_dirs):
> -      hdrs = glob.glob(os.path.join(native_path(d), '*.h'))
> -      all_includes.extend(hdrs)
> +      for wildcard in self.include_wildcards:
> +        hdrs = glob.glob(os.path.join(native_path(d), wildcard))
> +        all_includes.extend(hdrs)
> +    return all_includes
> +
> +  def compute_hdr_deps(self):
> +    """Compute the dependencies of each header file"""
> 
> -    include_deps = IncludeDependencyInfo(all_includes)
> +    include_deps = IncludeDependencyInfo(self.compute_hdrs())
> 
>      for objectfile, sources in self.graph.get_deps(DT_OBJECT):
>        assert len(sources) == 1
> @@ -485,6 +501,9 @@
>      self.link_cmd = '$(LINK_%s_WRAPPER)' % string.upper(lang_abbrev[lang])
> 
>    def add_dependencies(self):
> +    # Look in source directory for dependencies
> +    self.gen_obj.target_dirs.append(self.path)
> +
>      sources = _collect_paths(self.sources, self.path)
>      assert len(sources) == 1  ### simple assertions for now
> 
> @@ -509,6 +528,8 @@
> 
>      self.name = self.lang + '_' + module_name
>      self.path = build_path_join(self.path, self.lang)
> +    if self.lang == "perl":
> +      self.path = build_path_join(self.path, "native")
>      self.filename = build_path_join(self.path, lib_filename)
> 
>      ifile = SWIGSource(ipath)
> @@ -882,7 +903,7 @@
>        hdrs.update(self._deps[h])
>      return (len(keys) != len(hdrs))
> 
> -  _re_include = re.compile(r'^#\s*include\s*[<"]([^<"]+)[>"]')
> +  _re_include = re.compile(r'^\s*[#%]\s*(?:include|import)\s*[<"]?([^<">;\s]+)')
>    def _scan_for_includes(self, fname):
>      """Scan C source file FNAME and return the basenames of any headers
>      which are directly included, and within the set defined when this
> 
> Modified: trunk/build/generator/gen_make.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/build/generator/gen_make.py?rev=15848&p1=trunk/build/generator/gen_make.py&p2=trunk/build/generator/gen_make.py&r1=15847&r2=15848
> ==============================================================================
> --- trunk/build/generator/gen_make.py   (original)
> +++ trunk/build/generator/gen_make.py   Sat Aug 20 12:36:30 2005
> @@ -420,6 +420,9 @@
>            self.ofile.write('\t%s %s\n\n' % (cmd, sources[0]))
>        else:
>          self.ofile.write('\n')
> +
> +
> +    self.ofile.close()
> 
> 
>  class UnknownDependency(Exception):
> 
> Modified: trunk/build/generator/gen_win.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/build/generator/gen_win.py?rev=15848&p1=trunk/build/generator/gen_win.py&p2=trunk/build/generator/gen_win.py&r1=15847&r2=15848
> ==============================================================================
> --- trunk/build/generator/gen_win.py    (original)
> +++ trunk/build/generator/gen_win.py    Sat Aug 20 12:36:30 2005
> @@ -252,6 +252,14 @@
>                      ))
>      return configs
> 
> +  def _swig_build_opts(self, lang):
> +    """Options to pass in to SWIG for a specified language"""
> +    return {
> +      "python": self.swig_python_opts,
> +      "ruby": self.swig_ruby_opts,
> +      "perl": self.swig_perl_opts
> +    }[lang]
> +
>    def get_proj_sources(self, quote_path, target):
>      "Get the list of source files for each project"
>      sources = [ ]
> @@ -301,45 +309,9 @@
>                                   custom_build=cbuild, custom_target=jarfile))
> 
>      if isinstance(target, gen_base.TargetSWIG):
> -      swig_options = ["-" + target.lang]
> +      swig_options = string.split(self._swig_build_opts(target.lang))
>        swig_deps = []
> 
> -      if self.swig_vernum >= 103024:
> -        pass
> -      elif self.swig_vernum >= 103020:
> -        if target.include_runtime:
> -          swig_options.append("-runtime")
> -        else:
> -          swig_options.append("-noruntime")
> -      else:
> -        if not target.include_runtime:
> -          swig_options.append("-c")
> -
> -      if target.lang == "perl":
> -        if self.swig_vernum >= 103020:
> -          swig_options.append("-noproxy")
> -        swig_options.append("-nopm")
> -
> -        objects = (("svn_delta_editor_t", "svn_delta.h", "delta_editor.hi"),
> -                   ("svn_ra_plugin_t", "svn_ra.h", "ra_plugin.hi"),
> -                   ("svn_ra_reporter_t", "svn_ra.h", "ra_reporter.hi"))
> -
> -        pfile = self.path("subversion/bindings/swig/perl/native/h2i.pl")
> -
> -        for objname, header, output in objects:
> -          ifile = self.path("subversion/include", header)
> -          ofile = self.path("subversion/bindings/swig", output)
> -
> -          obuild = "perl %s %s %s > %s" % (pfile, ifile, objname,
> -                                           ofile)
> -
> -          sources.append(ProjectItem(path=ifile, reldir=None,
> -                                     custom_build=obuild,
> -                                     custom_target=ofile,
> -                                     user_deps=()))
> -
> -          swig_deps.append(ofile)
> -
>        for include_dir in self.get_win_includes(target):
>          swig_options.append("-I%s" % self.quote(include_dir))
> 
> @@ -349,14 +321,7 @@
>              if isinstance(cobj, gen_base.SWIGObject):
>                csrc = self.path(cobj.filename)
> 
> -              if self.swig_vernum < 103020 and target.lang == "python":
> -                # workaround for a bug in the python module of old swigs.
> -                # output path passed to swig has to use forward slashes,
> -                # otherwise the generated python files (for shadow
> -                # classes) will be saved to the wrong directory
> -                cout = string.replace(csrc, '\\', '/')
> -              else:
> -                cout = csrc
> +              cout = csrc
> 
>                # included header files that the generated c file depends on
>                user_deps = swig_deps[:]
> @@ -631,6 +596,8 @@
>                        % (target.lang,
>                           gen_base.lang_utillib_suffix[target.lang])
>        fakeincludes = [ self.path("subversion/bindings/swig"),
> +                       self.path("subversion/bindings/swig/proxy"),
> +                       self.path("subversion/bindings/swig/include"),
>                         self.path("subversion/include"),
>                         self.path(util_includes),
>                         self.apath(self.apr_path, "include"),
> @@ -642,6 +609,7 @@
>                         self.apath(self.apr_util_path, "xml/expat/lib"),
>                         self.apath(self.neon_path, "src"),
>                         self.apath(self.bdb_path, "include"),
> +                       self.path("subversion/bindings/swig/proxy"),
>                         self.path("subversion") ]
> 
>      if self.libintl_path:
> @@ -827,9 +795,11 @@
>        fp.close()
> 
>    def _find_swig(self):
> -    # Require (and assume) version 1.3.19
> -    base_version = '1.3.19'
> -    vernum = base_vernum = 103019
> +    # Require 1.3.24. If not found, assume 1.3.25.
> +    default_version = '1.3.25'
> +    minimum_version = '1.3.24'
> +    vernum = 103025
> +    minimum_vernum = 103024
>      libdir = ''
> 
>      infp, outfp = os.popen4('swig -version')
> @@ -849,14 +819,14 @@
>          # build/ac-macros/swig.m4 explains the next incantation
>          vernum = int('%d%02d%03d' % version)
>          sys.stderr.write('Found installed SWIG version %d.%d.%d\n' % version)
> -        if vernum < base_vernum:
> +        if vernum < minimum_vernum:
>            sys.stderr.write('WARNING: Subversion requires version %s\n'
> -                           % base_version)
> +                           % minimum_version)
> 
>          libdir = self._find_swig_libdir()
>        else:
>          sys.stderr.write('Could not find installed SWIG,'
> -                         ' assuming version %s\n' % base_version)
> +                         ' assuming version %s\n' % default_version)
>          self.swig_libdir = ''
>      finally:
>        outfp.close()
> 
> Modified: trunk/gen-make.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/gen-make.py?rev=15848&p1=trunk/gen-make.py&p2=trunk/gen-make.py&r1=15847&r2=15848
> ==============================================================================
> --- trunk/gen-make.py   (original)
> +++ trunk/gen-make.py   Sat Aug 20 12:36:30 2005
> @@ -16,6 +16,7 @@
>  # for getversion
>  sys.path.insert(1, 'build')
> 
> +import gen_swig
> 
>  gen_modules = {
>    'make' : ('gen_make', 'Makefiles for POSIX systems'),
> @@ -28,6 +29,13 @@
>    if verfname is None:
>      verfname = os.path.join('subversion', 'include', 'svn_version.h')
> 
> +  swig_generator = gen_swig.Generator(fname, verfname, other_options)
> +
> +  if not skip_depends:
> +    swig_generator.compute_hdr_deps()
> +
> +  swig_generator.write()
> +
>    gen_module = __import__(gen_modules[gentype][0])
> 
>    generator = gen_module.Generator(fname, verfname, other_options)
> @@ -36,6 +44,9 @@
>      generator.compute_hdr_deps()
> 
>    generator.write()
> +
> +  if gentype == "make":
> +    swig_generator.write_swig_deps()
> 
>    if other_options and ('--debug', '') in other_options:
>      for dep_type, target_dict in generator.graph.deps.items():
> @@ -113,6 +124,9 @@
>    print "           tell neon to look for OpenSSL headers"
>    print "           and libs in DIR"
>    print
> +  print "  --with-swig=PATH"
> +  print "           look for SWIG in PATH"
> +  print
>    print "  --with-zlib=DIR"
>    print "           tell neon to look for ZLib headers and"
>    print "           libs in DIR"
> @@ -168,6 +182,7 @@
>                                  'with-httpd=',
>                                  'with-libintl=',
>                                  'with-openssl=',
> +                                'with-swig=',
>                                  'with-zlib=',
>                                  'with-junit=',
>                                  'enable-pool-debug',
> 
> Modified: trunk/subversion/bindings/swig/INSTALL
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/INSTALL?rev=15848&p1=trunk/subversion/bindings/swig/INSTALL&p2=trunk/subversion/bindings/swig/INSTALL&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/INSTALL      (original)
> +++ trunk/subversion/bindings/swig/INSTALL      Sat Aug 20 12:36:30 2005
> @@ -16,14 +16,14 @@
> 
>    The Ruby bindings are a recent development, and are only partially
>    implemented. The Ruby bindings API may change incompatibly as development
> -  proceeds. They require SWIG 1.3.24 or later.
> +  proceeds.
> 
> 
>  BUILDING SWIG BINDINGS FOR SVN ON UNIX
> 
> 
>  Step 1:  Install a suitable version of SWIG (which is
> -         currently swig versions 1.3.19 - 1.3.21, or 1.3.24 or above).
> +         currently swig version 1.3.24 or above).
> 
>      * Perhaps your distribution packages a suitable version - if it does
>        install it, and skip to the last bullet point in this section.
> @@ -50,29 +50,11 @@
> 
>      * Build and install.
> 
> -        For SWIG 1.3.24 or above:
> -          Run 'make && make install'
> -
> -        For SWIG 1.3.19 - 1.3.21:
> -          Run 'make && make runtime && make install && make install-runtime'
> -
> -    * To verify you have SWIG installed correctly, check that these things
> -      were created, assuming your $PREFIX was /usr/local:
> -
> -        For SWIG 1.3.24 or above:
> -          - /usr/local/bin/swig
> -          - /usr/local/share/swig/1.3.xx/ (containing lots of .i files)
> -
> -        For SWIG 1.3.19 - 1.3.21:
> -          - /usr/local/bin/swig
> -          - /usr/local/lib/swig1.3/ (containing lots of .i files)
> -          - /usr/local/lib/libswigpy.so (for Python)
> -          - /usr/local/lib/libswigpl.so (for Perl)
> -
> -          In particular, you want to make sure that
> -          libswigpy.so (if you want to use Python) and/or
> -          libswigpl.so (if you want to use Perl) was/were built and installed.
> +        Run 'make && make install'
> 
> +    * To verify you have SWIG installed correctly, run "swig -version"
> +      from the command line. SWIG should report that it is version 1.3.24
> +      or newer.
> 
>  Step 2:  Build and Install Subversion.
> 
> 
> Deleted: trunk/subversion/bindings/swig/apr.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/apr.i?rev=15847
> 
> Modified: trunk/subversion/bindings/swig/core.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/core.i?rev=15848&p1=trunk/subversion/bindings/swig/core.i&p2=trunk/subversion/bindings/swig/core.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/core.i       (original)
> +++ trunk/subversion/bindings/swig/core.i       Sat Aug 20 12:36:30 2005
> @@ -24,26 +24,15 @@
>  %module core
>  #endif
> 
> +%include svn_global.swg
>  %include typemaps.i
> 
>  %{
>  #include <apr.h>
>  #include <apr_general.h>
> 
> -#include "svn_io.h"
> -#include "svn_pools.h"
> -#include "svn_version.h"
> -#include "svn_time.h"
> -#include "svn_props.h"
> -#include "svn_opt.h"
> -#include "svn_auth.h"
> -#include "svn_config.h"
> -#include "svn_version.h"
>  #include "svn_md5.h"
>  #include "svn_diff.h"
> -#include "svn_error_codes.h"
> -#include "svn_utf.h"
> -#include "svn_nls.h"
> 
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
> @@ -84,24 +73,24 @@
>     before anything else does.
>  */
> 
> -%include svn_error_codes.h
> +%include svn_error_codes_h.swg
> 
>  /* -----------------------------------------------------------------------
> -   Include svn_types.i early. Other .i files will import svn_types.i which
> +   Include svn_types.swg early. Other .i files will import svn_types.swg which
>     then includes svn_types.h, making further includes get skipped. We want
>     to actually generate wrappers for svn_types.h, so do an _include_ right
>     now, before any _import_ has happened.
>  */
> 
> -%include svn_types.i
> +%include svn_types.swg
> 
> 
>  /* -----------------------------------------------------------------------
>     moving along...
>  */
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%import apr.swg
> +%import svn_types.swg
> +%import svn_string.swg
> 
>  /* -----------------------------------------------------------------------
>     completely ignore a number of functions. the presumption is that the
> @@ -237,13 +226,13 @@
>      if (!PyInt_Check($input)) {
>          PyErr_SetString(PyExc_TypeError,
>                          "expecting an integer for the buffer size");
> -        return NULL;
> +        SWIG_fail;
>      }
>      temp = PyInt_AsLong($input);
>      if (temp < 0) {
>          PyErr_SetString(PyExc_ValueError,
>                          "buffer size must be a positive integer");
> -        return NULL;
> +        SWIG_fail;
>      }
>      $1 = malloc(temp);
>      $2 = ($2_ltype)&temp;
> @@ -285,7 +274,7 @@
>      if (!PyString_Check($input)) {
>          PyErr_SetString(PyExc_TypeError,
>                          "expecting a string for the buffer");
> -        return NULL;
> +        SWIG_fail;
>      }
>      $1 = PyString_AS_STRING($input);
>      temp = PyString_GET_SIZE($input);
> @@ -319,7 +308,8 @@
>     auth provider convertors
>  */
>  %typemap(perl5, in) apr_array_header_t *providers {
> -    $1 = (apr_array_header_t *) svn_swig_pl_objs_to_array($input, SWIGTYPE_p_svn_auth_provider_object_t, _global_pool);
> +    $1 = (apr_array_header_t *) svn_swig_pl_objs_to_array($input,
> +      $descriptor(svn_auth_provider_object_t *), _global_pool);
>  }
> 
>  %typemap(python, in) apr_array_header_t *providers {
> @@ -327,16 +317,17 @@
>      int targlen;
>      if (!PySequence_Check($input)) {
>          PyErr_SetString(PyExc_TypeError, "not a sequence");
> -        return NULL;
> +        SWIG_fail;
>      }
>      targlen = PySequence_Length($input);
>      $1 = apr_array_make(_global_pool, targlen, sizeof(provider));
>      ($1)->nelts = targlen;
>      while (targlen--) {
> -        SWIG_ConvertPtr(PySequence_GetItem($input, targlen),
> -                        (void **)&provider,
> -                        $descriptor(svn_auth_provider_object_t *),
> -                        SWIG_POINTER_EXCEPTION | 0);
> +        provider = svn_swig_MustGetPtr(PySequence_GetItem($input, targlen),
> +          $descriptor(svn_auth_provider_object_t *), $svn_argnum, NULL);
> +        if (PyErr_Occurred()) {
> +          SWIG_fail;
> +        }
>          APR_ARRAY_IDX($1, targlen, svn_auth_provider_object_t *) = provider;
>      }
>  }
> @@ -363,7 +354,7 @@
>      }
>      else {
>          PyErr_SetString(PyExc_TypeError, "not a known type");
> -        return NULL;
> +        SWIG_fail;
>      }
>  }
> 
> @@ -408,7 +399,7 @@
>      $1 = PyFile_AsFile($input);
>      if ($1 == NULL) {
>          PyErr_SetString(PyExc_ValueError, "Must pass in a valid file object");
> -        return NULL;
> +        SWIG_fail;
>      }
>  }
>  %typemap(perl5, in) FILE * {
> @@ -493,7 +484,7 @@
> 
>  %typemap(perl5,in,numinputs=0) apr_hash_t **cfg_hash = apr_hash_t **OUTPUT;
>  %typemap(perl5,argout) apr_hash_t **cfg_hash {
> -    ST(argvi++) = svn_swig_pl_convert_hash(*$1, SWIGTYPE_p_svn_config_t);
> +    ST(argvi++) = svn_swig_pl_convert_hash(*$1, $descriptor(svn_config_t *));
>  }
> 
>  %typemap(perl5, in) (svn_config_enumerator_t callback, void *baton) {
> @@ -510,7 +501,8 @@
>  %typemap(python,argout,fragment="t_output_helper") apr_hash_t **cfg_hash {
>      $result = t_output_helper(
>          $result,
> -        SWIG_NewPointerObj(*$1, SWIGTYPE_p_apr_hash_t, 0));
> +        svn_swig_NewPointerObj(*$1, $descriptor(apr_hash_t *),
> +                               _global_svn_swig_py_pool));
>  }
> 
>  /* Allow None to be passed as config_dir argument */
> @@ -557,39 +549,44 @@
> 
>  /* ----------------------------------------------------------------------- */
> 
> -%include svn_types.h
> -%include svn_pools.h
> -%include svn_version.h
> -%include svn_time.h
> +%include svn_types_h.swg
> +%include svn_pools_h.swg
> +%include svn_version_h.swg
> +%include svn_time_h.swg
>  #ifdef SWIGRUBY
>  %immutable name;
>  %immutable value;
>  #endif
> -%include svn_props.h
> +%include svn_props_h.swg
>  #ifdef SWIGRUBY
>  %mutable name;
>  %mutable value;
>  #endif
> -%include svn_opt.h
> -%include svn_auth.h
> -%include svn_config.h
> -%include svn_version.h
> -%include svn_utf.h
> -%include svn_nls.h
> +%include svn_opt_h.swg
> +%include svn_auth_h.swg
> +%include svn_config_h.swg
> +%include svn_version_h.swg
> +%include svn_utf_h.swg
> +%include svn_nls_h.swg
> 
> 
>  /* SWIG won't follow through to APR's defining this to be empty, so we
>     need to do it manually, before SWIG sees this in svn_io.h. */
>  #define __attribute__(x)
> 
> -%include svn_io.h
> +%include svn_io_h.swg
> 
>  #ifdef SWIGPERL
> -%include svn_diff.h
> -%include svn_error.h
> +%include svn_diff_h.swg
> +%include svn_error_h.swg
>  #endif
> 
>  #ifdef SWIGPYTHON
> +
> +void svn_swig_py_set_application_pool(PyObject *py_pool, apr_pool_t *pool);
> +void svn_swig_py_clear_application_pool();
> +PyObject *svn_swig_py_register_cleanup(PyObject *py_pool, apr_pool_t *pool);
> +
>  %init %{
>  /* This is a hack.  I dunno if we can count on SWIG calling the module "m" */
>  PyModule_AddObject(m, "SubversionException",
> @@ -599,6 +596,10 @@
>  %pythoncode %{
>  SubversionException = _core.SubversionException
>  %}
> +
> +/* Proxy classes for APR classes */
> +%include proxy_apr.swg
> +
>  #endif
> 
>  #ifdef SWIGRUBY
> @@ -620,7 +621,7 @@
>    }
>  };
> 
> -%include svn_diff.h
> +%include svn_diff_h.swg
> 
>  %inline %{
>  static VALUE
> @@ -637,3 +638,4 @@
>  %}
> 
>  #endif
> +
> 
> Modified: trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=15848&p1=trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c&p2=trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c  (original)
> +++ trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c  Sat Aug 20 12:36:30 2005
> @@ -29,14 +29,7 @@
>  #include "svn_pools.h"
>  #include "svn_opt.h"
> 
> -#if SVN_SWIG_VERSION >= 103024
> -#if SVN_SWIG_VERSION >= 103025
> -#include <swiglabels.swg>
> -#endif
> -#include <swigrun.swg>
> -#include <perl5/perlrun.swg>
> -#include <runtime.swg>
> -#endif
> +#include "swig_perl_external_runtime.swg"
> 
>  #include "swigutil_pl.h"
> 
> 
> Modified: trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h?rev=15848&p1=trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h&p2=trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h  (original)
> +++ trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h  Sat Aug 20 12:36:30 2005
> @@ -50,39 +50,6 @@
> 
> 
> 
> -#if SVN_SWIG_VERSION < 103024
> -/* If this file is being included outside of a wrapper file, then need to
> -   create stubs for some of the SWIG types. */
> -
> -/* if SWIGEXPORT is defined, then we're in a wrapper. otherwise, we need
> -   the prototypes and type definitions. */
> -#ifndef SWIGEXPORT
> -#define SVN_NEED_SWIG_TYPES
> -#endif
> -
> -#ifdef SVN_NEED_SWIG_TYPES
> -
> -#if SVN_SWIG_VERSION >= 103020
> -#include "perl5/precommon.swg"
> -/* The following two aren't handled by the precommon.swg.  */
> -#ifndef SWIG_MakePtr
> -#define SWIG_MakePtr SWIG_Perl_MakePtr
> -#endif
> -#ifndef SWIG_ConvertPtr
> -#define SWIG_ConvertPtr SWIG_Perl_ConvertPtr
> -#endif
> -#endif
> -
> -typedef struct _unnamed swig_type_info;
> -
> -swig_type_info *SWIG_TypeQuery(const char *name);
> -int SWIG_ConvertPtr(SV *, void **, swig_type_info *, int flags);
> -void SWIG_MakePtr(SV *, void *, swig_type_info *, int flags);
> -
> -#endif /* SVN_NEED_SWIG_TYPES */
> -#endif /* SVN_SWIG_VERSION < 103024 */
> -
> -
>  apr_pool_t *svn_swig_pl_make_pool (SV *obj);
> 
>  typedef enum perl_func_invoker {
> 
> Modified: trunk/subversion/bindings/swig/perl/native/Makefile.PL.in
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in?rev=15848&p1=trunk/subversion/bindings/swig/perl/native/Makefile.PL.in&p2=trunk/subversion/bindings/swig/perl/native/Makefile.PL.in&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/perl/native/Makefile.PL.in   (original)
> +++ trunk/subversion/bindings/swig/perl/native/Makefile.PL.in   Sat Aug 20 12:36:30 2005
> @@ -15,9 +15,6 @@
>  my $swig_srcdir = "${svnlib_srcdir}/bindings/swig";
>  my $swig_builddir = "${svnlib_builddir}/bindings/swig";
> 
> -my $swig_version = @SWIG_VERSION@;
> -my $swig = '@SWIG@';
> -
>  my @modules = qw/client delta fs ra repos wc/;
>  my @ldpaths = ("$swig_builddir/perl/libsvn_swig_perl/.libs",
>                 map {"$svnlib_builddir/libsvn_$_/.libs"} (@modules, qw/diff subr
> @@ -68,7 +65,7 @@
>                              "\$(INST_MAN3DIR)/SVN::$_.\$(MAN3EXT)") }
>           map { perlish $_ }
>           ('base', 'core', @modules)},
> -        clean => { FILES => "*.hi *.c *.bs".
> +        clean => { FILES => "*.c *.bs".
>                           join(' Makefile.','',@modules) }
>         );
> 
> @@ -88,31 +85,6 @@
>     my $module_c_files = join (' ',map { "svn_$_.c"} @modules);
>     my $module_make_commands = join ('',map {"\t\$(MAKE) -f Makefile.$_\n"} @modules);
> 
> -   my $flags;
> -   if ($swig_version >= 103024) {
> -     $flags = '-noproxy';
> -   } elsif ($swig_version >= 103020) {
> -     $flags = '-noruntime -noproxy';
> -   } else {
> -     $flags = '-c';
> -   }
> -
> -   my $swig_command = "$swig $flags -nopm -perl " .
> -                      "-I$swig_srcdir " .
> -                      "-I$swig_srcdir/perl/libsvn_swig_perl".
> -                      " -I$svnlib_srcdir/include" .
> -                      $apr_cflags;
> -
> -   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".
> -                                   " -o svn_$_.c $swig_srcdir/svn_$_.i\n"}
> -                                   @modules
> -                                 );
> -
>    my $fullperlrun = "$apr_shlib_path_var=" . join(':',@ldpaths);
> 
>     return <<"EOPOST";
> @@ -123,25 +95,8 @@
>  par :: all
>  \t$perl_path -MPAR::Dist -e"blip_to_par(name=>'SVN",version=>'`$perl_path -Mblib -MSVN::Core -e 'print $SVN::Core::VERSION'`')"
> 
> -ra_plugin.hi: $svnlib_srcdir/include/svn_ra.h
> -\t$perl_path $swig_srcdir/perl/native/h2i.pl \\
> -$svnlib_srcdir/include/svn_ra.h svn_ra_plugin_t > \$@
> -
> -ra_reporter.hi: $svnlib_srcdir/include/svn_ra.h
> -\t$perl_path $swig_srcdir/perl/native/h2i.pl \\
> -$svnlib_srcdir/include/svn_ra.h svn_ra_reporter2_t > \$@
> -
> -delta_editor.hi: $svnlib_srcdir/include/svn_delta.h
> -\t$perl_path $swig_srcdir/perl/native/h2i.pl \\
> -$svnlib_srcdir/include/svn_delta.h svn_delta_editor_t > \$@
> -
>  modules :: $module_c_files
>  $module_make_commands\t\$(NOECHO) \$(TOUCH) \$\@
> -
> -core.c :: $swig_srcdir/core.i
> -\t$swig_command -o core.c $swig_srcdir/core.i
> -
> -$swig_modules_command
> 
>  FULLPERLRUN=$fullperlrun \$(FULLPERL)
> 
> 
> Deleted: trunk/subversion/bindings/swig/perl/native/h2i.pl
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/perl/native/h2i.pl?rev=15847
> 
> Modified: trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=15848&p1=trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c&p2=trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c  (original)
> +++ trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c  Sat Aug 20 12:36:30 2005
> @@ -35,15 +35,7 @@
> 
>  #include "svn_private_config.h" /* for SVN_APR_INT64_T_PYCFMT */
> 
> -#if SVN_SWIG_VERSION >= 103024
> -#if SVN_SWIG_VERSION >= 103025
> -#include <swiglabels.swg>
> -#endif
> -#include <swigrun.swg>
> -#include <python/pyrun.swg>
> -#include <runtime.swg>
> -#endif
> -
> +#include "swig_python_external_runtime.swg"
>  #include "swigutil_py.h"
> 
> 
> @@ -109,6 +101,191 @@
> 
> 
> 
> +/*** Automatic Pool Management Functions ***/
> +
> +/* The application pool */
> +static apr_pool_t *_global_pool = NULL;
> +static PyObject *_global_svn_swig_py_pool = NULL;
> +int _global_svn_swig_py_is_local_pool = 0;
> +static char assertValid[] = "assert_valid";
> +static char parentPool[] = "_parent_pool";
> +static char isValid[] = "_is_valid";
> +static char setParentPool[] = "set_parent_pool";
> +static char emptyTuple[] = "()";
> +static char objectTuple[] = "(O)";
> +
> +
> +/* Set the application pool */
> +void svn_swig_py_set_application_pool(PyObject *py_pool, apr_pool_t *pool)
> +{
> +  _global_pool = pool;
> +  _global_svn_swig_py_pool = py_pool;
> +}
> +
> +/* Clear the application pool */
> +void svn_swig_py_clear_application_pool()
> +{
> +  _global_pool = NULL;
> +  _global_svn_swig_py_pool = NULL;
> +}
> +
> +/* Mark a pool as deleted after it is destroyed */
> +static apr_status_t svn_swig_py_pool_destroyed(void *ptr)
> +{
> +  PyObject *pool = (PyObject *) ptr;
> +  svn_swig_py_acquire_py_lock();
> +  PyObject_DelAttrString(pool, isValid);
> +  svn_swig_py_release_py_lock();
> +  return APR_SUCCESS;
> +}
> +
> +/* Decrease a pool's reference count after it is destroyed */
> +static apr_status_t svn_swig_py_pool_decref(void *ptr)
> +{
> +  PyObject *pool = (PyObject *) ptr;
> +  svn_swig_py_acquire_py_lock();
> +  Py_DECREF(pool);
> +  svn_swig_py_release_py_lock();
> +  return APR_SUCCESS;
> +}
> +
> +/* Register cleanup function */
> +PyObject * svn_swig_py_register_cleanup(PyObject *py_pool, apr_pool_t *pool)
> +{
> +  PyObject *result;
> +
> +  svn_swig_py_acquire_py_lock();
> +
> +  /* Check that the pool object is valid */
> +  result = PyObject_CallMethod(py_pool, assertValid, emptyTuple);
> +  if (result == NULL) {
> +    return NULL;
> +  }
> +  Py_DECREF(result);
> +  svn_swig_py_release_py_lock();
> +
> +  /* Delete the "_isvalid" member when the pool is destroyed */
> +  apr_pool_cleanup_register(pool, py_pool, svn_swig_py_pool_destroyed,
> +                            apr_pool_cleanup_null);
> +
> +  /* Return None */
> +  Py_INCREF(Py_None);
> +  return Py_None;
> +}
> +
> +/* Get the application pool */
> +void svn_swig_get_application_pool(PyObject **py_pool, apr_pool_t **pool)
> +{
> +  *pool = _global_pool;
> +  *py_pool = _global_svn_swig_py_pool;
> +}
> +
> +/* Set the parent pool of a proxy object */
> +static int proxy_set_pool(PyObject *proxy, PyObject *pool)
> +{
> +  PyObject *result;
> +
> +  if (proxy != NULL && PyObject_HasAttrString(proxy, setParentPool)) {
> +
> +    if (pool == NULL) {
> +      result = PyObject_CallMethod(proxy, setParentPool, emptyTuple);
> +    } else {
> +      result = PyObject_CallMethod(proxy, setParentPool, objectTuple, pool);
> +    }
> +
> +    if (result == NULL) {
> +      return 1;
> +    }
> +    Py_DECREF(result);
> +
> +    result = PyObject_CallMethod(proxy, assertValid, emptyTuple);
> +    if (result == NULL) {
> +      return 1;
> +    }
> +    Py_DECREF(result);
> +
> +  }
> +
> +  return 0;
> +}
> +
> +/* Wrapper for SWIG_TypeQuery */
> +#define svn_swig_TypeQuery(x) SWIG_TypeQuery(x)
> +
> +/** Wrapper for SWIG_NewPointerObj */
> +PyObject *svn_swig_NewPointerObj(void *obj, swig_type_info *type,
> +                                 PyObject *pool)
> +{
> +  PyObject *proxy = SWIG_NewPointerObj(obj, type, 0);
> +
> +  if (proxy == NULL) {
> +    return NULL;
> +  }
> +
> +  if (proxy_set_pool(proxy, pool)) {
> +    Py_DECREF(proxy);
> +    return NULL;
> +  }
> +
> +  return proxy;
> +}
> +
> +/** svn_swig_NewPointerObj, except a string is used to describe the type */
> +static PyObject *svn_swig_NewPointerObjString(void *ptr, const char *type,
> +                                              PyObject *py_pool)
> +{
> +  swig_type_info *typeinfo = svn_swig_TypeQuery(type);
> +  if (typeinfo == NULL) {
> +    PyErr_SetString(PyExc_TypeError, "Cannot find required typeobject");
> +    return NULL;
> +  }
> +  /* ### cache the swig_type_info at some point? */
> +  return svn_swig_NewPointerObj(ptr, typeinfo, py_pool);
> +}
> +
> +/** Wrapper for SWIG_ConvertPtr */
> +int svn_swig_ConvertPtr(PyObject *input, void **obj, swig_type_info *type)
> +{
> +  if (PyObject_HasAttrString(input, assertValid)) {
> +    PyObject *result = PyObject_CallMethod(input, assertValid, emptyTuple);
> +    if (result == NULL) {
> +      return 1;
> +    }
> +    Py_DECREF(result);
> +  }
> +  return SWIG_ConvertPtr(input, obj, type, SWIG_POINTER_EXCEPTION | 0);
> +}
> +
> +/** svn_swig_ConvertPtr, except a string is used to describe the type */
> +static int svn_swig_ConvertPtrString(PyObject *input,
> +    void **obj, const char *type)
> +{
> +  return svn_swig_ConvertPtr(input, obj, svn_swig_TypeQuery(type));
> +}
> +
> +/** Wrapper for SWIG_MustGetPtr */
> +void *svn_swig_MustGetPtr(void *input, swig_type_info *type, int argnum,
> +                          PyObject **py_pool)
> +{
> +  if (PyObject_HasAttrString(input, assertValid)) {
> +    PyObject *result = PyObject_CallMethod(input, assertValid, emptyTuple);
> +    if (result == NULL) {
> +      return NULL;
> +    }
> +    Py_DECREF(result);
> +  }
> +  if (py_pool != NULL) {
> +    if (PyObject_HasAttrString(input, parentPool)) {
> +      *py_pool = PyObject_GetAttrString(input, parentPool);
> +      Py_DECREF(*py_pool);
> +    } else {
> +      *py_pool = _global_svn_swig_py_pool;
> +    }
> +  }
> +  return SWIG_MustGetPtr(input, type, argnum, SWIG_POINTER_EXCEPTION | 0);
> +}
> +
> +
>  /*** Custom SubversionException stuffs. ***/
> 
>  /* Global SubversionException class object. */
> @@ -177,36 +354,49 @@
> 
>  /*** Helper/Conversion Routines ***/
> 
> -static PyObject *make_pointer(const char *typename, void *ptr)
> +/* Functions for making Python wrappers around Subversion structs */
> +static PyObject *make_ob_pool(void *pool)
>  {
> -  /* ### cache the swig_type_info at some point? */
> -  return SWIG_NewPointerObj(ptr, SWIG_TypeQuery(typename), 0);
> -}
> +  PyObject *py_pool = SWIG_NewPointerObj(pool,
> +    svn_swig_TypeQuery("apr_pool_t *"), 0);
> 
> -/* Functions for use with the "O&" format specifier */
> -static PyObject *make_ob_pool(void *ptr)
> -{
> -  return make_pointer("apr_pool_t *", ptr);
> +  if (py_pool == NULL) {
> +    return NULL;
> +  }
> +
> +  apr_pool_cleanup_register((apr_pool_t *)pool, py_pool,
> +    svn_swig_py_pool_decref, apr_pool_cleanup_null);
> +
> +  if (proxy_set_pool(py_pool, NULL)) {
> +    Py_DECREF(py_pool);
> +    return NULL;
> +  }
> +
> +  Py_INCREF(py_pool);
> +
> +  return py_pool;
>  }
> -static PyObject *make_ob_window(void *ptr)
> +static PyObject *make_ob_window(svn_txdelta_window_t *ptr, PyObject *py_pool)
>  {
> -  return make_pointer("svn_txdelta_window_t *", ptr);
> +  return svn_swig_NewPointerObjString(ptr, "svn_txdelta_window_t *", py_pool);
>  }
> -static PyObject *make_ob_status(void *ptr)
> +static PyObject *make_ob_status(svn_wc_status_t *ptr, PyObject *py_pool)
>  {
> -  return make_pointer("svn_wc_status_t *", ptr);
> +  return svn_swig_NewPointerObjString(ptr, "svn_wc_status_t *", py_pool);
>  }
> -static PyObject *make_ob_lock(void *ptr)
> +static PyObject *make_ob_lock(svn_lock_t *ptr, PyObject *py_pool)
>  {
> -  return make_pointer("svn_lock_t *", ptr);
> +  return svn_swig_NewPointerObjString(ptr, "svn_lock_t *", py_pool);
>  }
> -static PyObject *make_ob_fs_root(void *ptr)
> +static PyObject *make_ob_fs_root(svn_fs_root_t *ptr, PyObject *py_pool)
>  {
> -  return make_pointer("svn_fs_root_t *", ptr);
> +  return svn_swig_NewPointerObjString(ptr, "svn_fs_root_t *", py_pool);
>  }
> -static PyObject *make_ob_server_cert_info(void *ptr)
> +static PyObject *make_ob_server_cert_info(
> +  const svn_auth_ssl_server_cert_info_t *ptr, PyObject *py_pool)
>  {
> -  return make_pointer("svn_auth_ssl_server_cert_info_t *", ptr);
> +  return svn_swig_NewPointerObjString((void *)ptr,
> +    "svn_auth_ssl_server_cert_info_t *", py_pool);
>  }
>  /***/
> 
> @@ -238,8 +428,9 @@
> 
>  static PyObject *convert_hash(apr_hash_t *hash,
>                                PyObject * (*converter_func)(void *value,
> -                                                           void *ctx),
> -                              void *ctx)
> +                                                           void *ctx,
> +                                                           PyObject *py_pool),
> +                              void *ctx, PyObject *py_pool)
>  {
>      apr_hash_index_t *hi;
>      PyObject *dict = PyDict_New();
> @@ -253,7 +444,7 @@
>          PyObject *value;
> 
>          apr_hash_this(hi, &key, NULL, &val);
> -        value = (*converter_func)(val, ctx);
> +        value = (*converter_func)(val, ctx, py_pool);
>          if (value == NULL) {
>              Py_DECREF(dict);
>              return NULL;
> @@ -270,23 +461,21 @@
>      return dict;
>  }
> 
> -static PyObject *convert_to_swigtype(void *value, void *ctx)
> +static PyObject *convert_to_swigtype(void *value, void *ctx, PyObject *py_pool)
>  {
>    /* ctx is a 'swig_type_info *' */
> -  return SWIG_NewPointerObj(value, ctx, 0);
> +  return svn_swig_NewPointerObj(value, ctx, py_pool);
>  }
> 
> -static PyObject *convert_svn_string_t(void *value, void *ctx)
> +static PyObject *convert_svn_string_t(void *value, void *ctx,
> +                                      PyObject *py_pool)
>  {
>    /* ctx is unused */
> 
>    const svn_string_t *s = value;
> 
> -  /* ### borrowing from value in the pool. or should we copy? note
> -     ### that copying is "safest" */
> -
>    /* ### gotta cast this thing cuz Python doesn't use "const" */
> -  return PyBuffer_FromMemory((void *)s->data, s->len);
> +  return PyString_FromStringAndSize((void *)s->data, s->len);
>  }
> 
>  static PyObject *convert_svn_client_commit_item_t(void *value, void *ctx)
> @@ -350,7 +539,7 @@
> 
>  PyObject *svn_swig_py_prophash_to_dict(apr_hash_t *hash)
>  {
> -  return convert_hash(hash, convert_svn_string_t, NULL);
> +  return convert_hash(hash, convert_svn_string_t, NULL, NULL);
>  }
> 
> 
> @@ -395,9 +584,10 @@
>      return dict;
>  }
> 
> -PyObject *svn_swig_py_convert_hash(apr_hash_t *hash, swig_type_info *type)
> +PyObject *svn_swig_py_convert_hash(apr_hash_t *hash, swig_type_info *type,
> +                                   PyObject *py_pool)
>  {
> -  return convert_hash(hash, convert_to_swigtype, type);
> +  return convert_hash(hash, convert_to_swigtype, type, py_pool);
>  }
> 
>  PyObject *svn_swig_py_c_strings_to_list(char **strings)
> @@ -1276,14 +1466,17 @@
>    PyObject *py_io = baton;
>    svn_error_t *err = SVN_NO_ERROR;
> 
> -  svn_swig_py_acquire_py_lock();
> -  if ((result = PyObject_CallMethod(py_io, (char *)"write",
> -                                    (char *)"s#", data, *len)) == NULL)
> +  if (data != NULL)
>      {
> -      err = callback_exception_error();
> +      svn_swig_py_acquire_py_lock();
> +      if ((result = PyObject_CallMethod(py_io, (char *)"write",
> +                                        (char *)"s#", data, *len)) == NULL)
> +        {
> +          err = callback_exception_error();
> +        }
> +      Py_XDECREF(result);
> +      svn_swig_py_release_py_lock();
>      }
> -  Py_XDECREF(result);
> -  svn_swig_py_release_py_lock();
> 
>    return err;
>  }
> @@ -1422,16 +1615,27 @@
>                                              apr_pool_t *pool)
>  {
>    PyObject *function = baton;
> -  PyObject *result;
> +  PyObject *result, *py_pool, *py_lock;
>    svn_error_t *err = SVN_NO_ERROR;
> 
>    if (function == NULL || function == Py_None)
>      return SVN_NO_ERROR;
> 
>    svn_swig_py_acquire_py_lock();
> -  if ((result = PyObject_CallFunction(function, (char *)"O&O&",
> -                                      make_ob_lock, lock,
> -                                      make_ob_pool, pool)) == NULL)
> +  py_pool = make_ob_pool(pool);
> +  if (py_pool == NULL) {
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +  py_lock = make_ob_lock(lock, py_pool);
> +  if (py_lock == NULL) {
> +    Py_DECREF(py_pool);
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +
> +  if ((result = PyObject_CallFunction(function, (char *)"OO",
> +                                      py_lock, py_pool)) == NULL)
>      {
>        err = callback_exception_error();
>      }
> @@ -1443,6 +1647,10 @@
>        Py_DECREF(result);
>      }
> 
> +  Py_DECREF(py_lock);
> +  Py_DECREF(py_pool);
> +
> +finished:
>    svn_swig_py_release_py_lock();
>    return err;
>  }
> @@ -1522,18 +1730,31 @@
>  {
>    PyObject *function = baton;
>    PyObject *result;
> +  PyObject *py_pool, *py_root;
>    svn_error_t *err = SVN_NO_ERROR;
> 
>    if (function == NULL || function == Py_None)
>      return SVN_NO_ERROR;
> 
> +  svn_swig_py_acquire_py_lock();
> +
> +  py_pool = make_ob_pool(pool);
> +  if (py_pool == NULL) {
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +  py_root = make_ob_fs_root(root, py_pool);
> +  if (py_root == NULL) {
> +    Py_DECREF(py_pool);
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +
>    *allowed = TRUE;
> 
> -  svn_swig_py_acquire_py_lock();
>    if ((result = PyObject_CallFunction(function,
> -                                      (char *)"O&sO&",
> -                                      make_ob_fs_root, root,
> -                                      path, make_ob_pool, pool)) == NULL)
> +                                      (char *)"OsO",
> +                                      py_root, path, py_pool)) == NULL)
>      {
>        err = callback_exception_error();
>      }
> @@ -1547,6 +1768,9 @@
>          err = callback_bad_return_error("Not an integer");
>        Py_DECREF(result);
>      }
> +  Py_DECREF(py_root);
> +  Py_DECREF(py_pool);
> +finished:
>    svn_swig_py_release_py_lock();
>    return err;
>  }
> @@ -1592,7 +1816,7 @@
>                                        apr_pool_t *pool)
>  {
>    PyObject *receiver = baton;
> -  PyObject *result;
> +  PyObject *result, *py_pool;
>    PyObject *chpaths;
>    svn_error_t *err = SVN_NO_ERROR;
> 
> @@ -1601,10 +1825,16 @@
> 
>    svn_swig_py_acquire_py_lock();
> 
> +  py_pool = make_ob_pool(pool);
> +  if (py_pool == NULL) {
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +
>    if (changed_paths)
>      {
> -      swig_type_info *tinfo = SWIG_TypeQuery("svn_log_changed_path_t *");
> -      chpaths = svn_swig_py_convert_hash (changed_paths, tinfo);
> +      swig_type_info *tinfo = svn_swig_TypeQuery("svn_log_changed_path_t *");
> +      chpaths = svn_swig_py_convert_hash (changed_paths, tinfo, py_pool);
>      }
>    else
>      {
> @@ -1613,9 +1843,9 @@
>      }
> 
>    if ((result = PyObject_CallFunction(receiver,
> -                                      (char *)"OlsssO&",
> +                                      (char *)"OlsssO",
>                                        chpaths, rev, author, date, msg,
> -                                      make_ob_pool, pool)) == NULL)
> +                                      py_pool)) == NULL)
>      {
>        err = callback_exception_error();
>      }
> @@ -1627,6 +1857,8 @@
>      }
> 
>    Py_DECREF(chpaths);
> +  Py_DECREF(py_pool);
> +finished:
>    svn_swig_py_release_py_lock();
>    return err;
>  }
> @@ -1699,8 +1931,8 @@
>        if (result != Py_None)
>          {
>            svn_auth_cred_simple_t *tmp_creds = NULL;
> -          if (SWIG_ConvertPtr(result, (void **)&tmp_creds,
> -                              SWIG_TypeQuery("svn_auth_cred_simple_t *"), 0))
> +          if (svn_swig_ConvertPtrString(result, (void **)&tmp_creds,
> +                "svn_auth_cred_simple_t *"))
>              {
>                err = type_conversion_error("svn_auth_cred_simple_t *");
>              }
> @@ -1750,8 +1982,8 @@
>        if (result != Py_None)
>          {
>            svn_auth_cred_username_t *tmp_creds = NULL;
> -          if (SWIG_ConvertPtr(result, (void **)&tmp_creds,
> -                              SWIG_TypeQuery("svn_auth_cred_username_t *"), 0))
> +          if (svn_swig_ConvertPtrString(result, (void **)&tmp_creds,
> +                "svn_auth_cred_username_t *"))
>              {
>                err = type_conversion_error("svn_auth_cred_username_t *");
>              }
> @@ -1782,7 +2014,7 @@
>      apr_pool_t *pool)
>  {
>    PyObject *function = baton;
> -  PyObject *result;
> +  PyObject *result, *py_pool, *py_cert_info;
>    svn_auth_cred_ssl_server_trust_t *creds = NULL;
>    svn_error_t *err = SVN_NO_ERROR;
> 
> @@ -1790,12 +2022,23 @@
>      return SVN_NO_ERROR;
> 
>    svn_swig_py_acquire_py_lock();
> +  py_pool = make_ob_pool(pool);
> +  if (py_pool == NULL) {
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> +  py_cert_info = make_ob_server_cert_info(cert_info, py_pool);
> +  if (py_pool == NULL) {
> +    Py_DECREF(py_pool);
> +    err = callback_exception_error();
> +    goto finished;
> +  }
> 
>    if ((result = PyObject_CallFunction(function,
> -                                      (char *)"slO&lO&",
> +                                      (char *)"slOlO",
>                                        realm, failures,
> -                                      make_ob_server_cert_info, cert_info,
> -                                      may_save, make_ob_pool, pool)) == NULL)
> +                                      py_cert_info,
> +                                      may_save, py_pool)) == NULL)
>      {
>        err = callback_exception_error();
>      }
> @@ -1804,9 +2047,9 @@
>        if (result != Py_None)
>          {
>            svn_auth_cred_ssl_server_trust_t *tmp_creds = NULL;
> -          if (SWIG_ConvertPtr
> +          if (svn_swig_ConvertPtrString
>                (result, (void **)&tmp_creds,
> -               SWIG_TypeQuery("svn_auth_cred_ssl_server_trust_t *"), 0))
> +               "svn_auth_cred_ssl_server_trust_t *"))
>              {
>                err = type_conversion_error
>                  ("svn_auth_cred_ssl_server_trust_t *");
> @@ -1819,6 +2062,10 @@
>          }
>        Py_DECREF(result);
>      }
> + Py_DECREF(py_cert_info);
> + Py_DECREF(py_pool);
> +
> +finished:
>    svn_swig_py_release_py_lock();
>    *cred = creds;
>    return err;
> @@ -1854,9 +2101,9 @@
>        if (result != Py_None)
>          {
>            svn_auth_cred_ssl_client_cert_t *tmp_creds = NULL;
> -          if (SWIG_ConvertPtr
> +          if (svn_swig_ConvertPtrString
>                (result, (void **)&tmp_creds,
> -               SWIG_TypeQuery("svn_auth_cred_ssl_client_cert_t *"), 0))
> +               "svn_auth_cred_ssl_client_cert_t *"))
>              {
>                err = type_conversion_error("svn_auth_cred_ssl_client_cert_t *");
>              }
> @@ -1905,9 +2152,9 @@
>        if (result != Py_None)
>          {
>            svn_auth_cred_ssl_client_cert_pw_t *tmp_creds = NULL;
> -          if (SWIG_ConvertPtr
> +          if (svn_swig_ConvertPtrString
>                (result, (void **)&tmp_creds,
> -               SWIG_TypeQuery("svn_auth_cred_ssl_client_cert_pw_t *"), 0))
> +               "svn_auth_cred_ssl_client_cert_pw_t *"))
>              {
>                err = type_conversion_error
>                  ("svn_auth_cred_ssl_client_cert_pw_t *");
> 
> Modified: trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h?rev=15848&p1=trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h&p2=trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h  (original)
> +++ trunk/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h  Sat Aug 20 12:36:30 2005
> @@ -40,43 +40,40 @@
> 
> 
> 
> -#if SVN_SWIG_VERSION < 103024
> -/* If this file is being included outside of a wrapper file, then need to
> -   create stubs for some of the SWIG types. */
> -
> -/* if SWIGEXPORT is defined, then we're in a wrapper. otherwise, we need
> -   the prototypes and type definitions. */
> -#ifndef SWIGEXPORT
> -#define SVN_NEED_SWIG_TYPES
> -#endif
> -
> -#ifdef SVN_NEED_SWIG_TYPES
> -
> -#if SVN_SWIG_VERSION >= 103020
> -#include "python/precommon.swg"
> -#ifndef SWIG_ConvertPtr
> -#define SWIG_ConvertPtr SWIG_Python_ConvertPtr
> -#endif
> -#ifndef SWIG_NewPointerObj
> -#define SWIG_NewPointerObj SWIG_Python_NewPointerObj
> -#endif
> -#endif
> -
> -typedef struct _unnamed swig_type_info;
> -
> -PyObject *SWIG_NewPointerObj(void *, swig_type_info *, int own);
> -swig_type_info *SWIG_TypeQuery(const char *name);
> -int SWIG_ConvertPtr(PyObject *, void **, swig_type_info *, int flags);
> -
> -#endif /* SVN_NEED_SWIG_TYPES */
> -#endif /* SVN_SWIG_VERSION < 103024 */
> -
> -
>  /* Functions to manage python's global interpreter lock */
>  void svn_swig_py_release_py_lock(void);
>  void svn_swig_py_acquire_py_lock(void);
> 
> 
> +/*** Automatic Pool Management Functions ***/
> +extern int _global_svn_swig_py_is_local_pool;
> +
> +/* Set the application pool */
> +void svn_swig_py_set_application_pool(PyObject *py_pool, apr_pool_t *pool);
> +
> +/* Clear the application pool */
> +void svn_swig_py_clear_application_pool(void);
> +
> +/* Get the application pool */
> +void svn_swig_get_application_pool(PyObject **py_pool, apr_pool_t **pool);
> +
> +/* Register cleanup function */
> +PyObject * svn_swig_py_register_cleanup(PyObject *py_pool, apr_pool_t *pool);
> +
> +
> +/*** SWIG Wrappers ***/
> +
> +/* Wrapper for SWIG_NewPointerObj */
> +PyObject *svn_swig_NewPointerObj(void *obj, swig_type_info *type,
> +                                 PyObject *pool);
> +
> +/* Wrapper for SWIG_ConvertPtr */
> +int svn_swig_ConvertPtr(PyObject *input, void **obj, swig_type_info *type);
> +
> +/* Wrapper for SWIG_MustGetPtr */
> +void *svn_swig_MustGetPtr(void *input, swig_type_info *type, int argnum,
> +                          PyObject **py_pool);
> +
>  /*** Functions to expose a custom SubversionException ***/
> 
>  /* register a new subversion exception class */
> @@ -99,7 +96,8 @@
>  PyObject *svn_swig_py_locationhash_to_dict(apr_hash_t *hash);
> 
>  /* convert a hash of 'const char *' -> TYPE into a Python dict */
> -PyObject *svn_swig_py_convert_hash(apr_hash_t *hash, swig_type_info *type);
> +PyObject *svn_swig_py_convert_hash(apr_hash_t *hash, swig_type_info *type,
> +                                   PyObject *py_pool);
> 
>  /* helper function to convert a 'char **' into a Python list of string
>     objects */
> 
> Modified: trunk/subversion/bindings/swig/python/svn/core.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/python/svn/core.py?rev=15848&p1=trunk/subversion/bindings/swig/python/svn/core.py&p2=trunk/subversion/bindings/swig/python/svn/core.py&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/python/svn/core.py   (original)
> +++ trunk/subversion/bindings/swig/python/svn/core.py   Sat Aug 20 12:36:30 2005
> @@ -17,32 +17,23 @@
>  ######################################################################
> 
>  from libsvn.core import *
> +import libsvn.core as _core
> 
>  def _unprefix_names(symbol_dict, from_prefix, to_prefix = ''):
>    for name, value in symbol_dict.items():
>      if name.startswith(from_prefix):
>        symbol_dict[to_prefix + name[len(from_prefix):]] = value
> 
> -# some minor patchups
> -svn_pool_destroy = apr_pool_destroy
> -svn_pool_clear = apr_pool_clear
> 
> -def run_app(func, *args, **kw):
> -  '''Run a function as an "APR application".
> +Pool = svn_pool_create
> 
> -  APR is initialized, and an application pool is created. Cleanup is
> -  performed as the function exits (normally or via an exception.
> -  '''
> -  apr_initialize()
> -  try:
> -    pool = svn_pool_create(None)
> -    try:
> -      return apply(func, (pool,) + args, kw)
> -    finally:
> -      svn_pool_destroy(pool)
> -  finally:
> -    apr_terminate()
> +# Initialize application-level pool
> +Pool()
> 
> +# Hide raw pool management functions.
> +# If you still want to use these, use libsvn.core instead.
> +del apr_pool_destroy
> +del apr_pool_clear
> 
>  def svn_path_compare_paths(path1, path2):
>    path1_len = len (path1);
> @@ -166,3 +157,60 @@
> 
>      return _string.join(map(escape_shell_arg, argv), " ")
>  # ============================================================================
> +# Deprecated functions
> +
> +def apr_initialize():
> +  """Deprecated. APR is now initialized automatically. This is
> +  a compatibility wrapper providing the interface of the
> +  Subversion 1.2.x and earlier bindings."""
> +  pass
> +
> +def apr_terminate():
> +  """Deprecated. APR is now terminated automatically. This is
> +  a compatibility wrapper providing the interface of the
> +  Subversion 1.2.x and earlier bindings."""
> +  pass
> +
> +def svn_pool_create(parent_pool=None):
> +  """Deprecated. Use Pool() instead. This is a compatibility
> +  wrapper providing the interface of the Subversion 1.2.x and
> +  earlier bindings."""
> +  return Pool(parent_pool)
> +
> +def svn_pool_destroy(pool):
> +  """Deprecated. Pools are now destroyed automatically. If you
> +  want to manually destroy a pool, use Pool.destroy. This is
> +  a compatibility wrapper providing the interface of the
> +  Subversion 1.2.x and earlier bindings."""
> +
> +  assert pool is not None
> +
> +  if hasattr(pool,"destroy"):
> +    pool.destroy()
> +  else:
> +    _core.apr_pool_destroy(pool)
> +
> +def svn_pool_clear(pool):
> +  """Deprecated. Use Pool.clear instead. This is a compatibility
> +  wrapper providing the interface of the Subversion 1.2.x and
> +  earlier bindings."""
> +
> +  assert pool is not None
> +
> +  if hasattr(pool,"clear"):
> +    pool.clear()
> +  else:
> +    _core.apr_pool_clear(pool)
> +
> +def run_app(func, *args, **kw):
> +  '''Deprecated: Application-level pools are now created
> +  automatically. APR is also initialized and terminated
> +  automatically. This is a compatibility wrapper providing the
> +  interface of the Subversion 1.2.x and earlier bindings.
> +
> +  Run a function as an "APR application".
> +
> +  APR is initialized, and an application pool is created. Cleanup is
> +  performed as the function exits (normally or via an exception).
> +  '''
> +  return apply(func, (_core.application_pool,) + args, kw)
> 
> Modified: trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=15848&p1=trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c&p2=trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c  (original)
> +++ trunk/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c  Sat Aug 20 12:36:30 2005
> @@ -1,18 +1,8 @@
> +#include "rubyhead.swg"
> +#include "swig_ruby_external_runtime.swg"
>  #include "swigutil_rb.h"
>  #include <st.h>
> 
> -#if SVN_SWIG_VERSION >= 103025
> -#  include <swiglabels.swg>
> -#endif
> -#include <ruby/rubyhead.swg>
> -#include <swigrun.swg>
> -#if SVN_SWIG_VERSION < 103025
> -#  include <common.swg>
> -#endif
> -#include <ruby/rubydef.swg>
> -#if SVN_SWIG_VERSION >= 103025
> -#  include <runtime.swg>
> -#endif
> 
>  #define POOL_P(obj) (RTEST(rb_obj_is_kind_of(obj, rb_svn_core_pool())))
>  #define CONTEXT_P(obj) (RTEST(rb_obj_is_kind_of(obj, rb_svn_client_context())))
> 
> Modified: trunk/subversion/bindings/swig/svn_client.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_client.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_client.i&p2=trunk/subversion/bindings/swig/svn_client.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_client.i (original)
> +++ trunk/subversion/bindings/swig/svn_client.i Sat Aug 20 12:36:30 2005
> @@ -26,9 +26,11 @@
> 
>  %include typemaps.i
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import core.i
> +%import apr.swg
> +%import svn_types.swg
> +%import svn_string.swg
>  %import svn_delta.i
>  %import svn_wc.i
> 
> @@ -87,7 +89,7 @@
>      int nelts = (*$1)->nelts;
>      PyObject *list = PyList_New(nelts);
>      if (list == NULL)
> -        return NULL;
> +        SWIG_fail;
>      ppitem = (svn_client_proplist_item_t **)(*$1)->elts;
>      for (i = 0; i < nelts; ++i, ++ppitem) {
>          PyObject *item = PyTuple_New(2);
> @@ -100,7 +102,7 @@
>              Py_XDECREF(name);
>              Py_XDECREF(hash);
>              Py_DECREF(list);
> -            return NULL;
> +            SWIG_fail;
>          }
>          PyTuple_SET_ITEM(item, 0, name);
>          PyTuple_SET_ITEM(item, 1, hash);
> @@ -121,8 +123,8 @@
>  }
> 
>  %typemap(perl5,argout) apr_array_header_t **props {
> -    $result = svn_swig_pl_convert_array(*$1,SWIG_TypeQuery(
> -                                              "svn_client_proplist_item_t *"));
> +    $result = svn_swig_pl_convert_array(*$1,
> +      $descriptor(svn_client_proplist_item_t *));
>      argvi++;
>  }
> 
> @@ -345,7 +347,8 @@
>  }
> 
>  %typemap(perl5, out) apr_hash_t *config {
> -  $result = svn_swig_pl_convert_hash($1, SWIG_TypeQuery("svn_config_t *"));
> +  $result = svn_swig_pl_convert_hash($1,
> +    $descriptor(svn_config_t *));
>    argvi++;
>  }
> 
> @@ -417,7 +420,8 @@
>   * converted back and forth from an array */
> 
>  %typemap(perl5, out) apr_array_header_t *wcprop_changes {
> -    $result = svn_swig_pl_convert_array($1,SWIG_TypeQuery("svn_prop_t *"));
> +    $result = svn_swig_pl_convert_array($1,
> +      $descriptor(svn_prop_t *));
>      argvi++;
>  }
> 
> @@ -455,9 +459,6 @@
>  /* ----------------------------------------------------------------------- */
> 
>  %{
> -#include "svn_client.h"
> -#include "svn_time.h"
> -
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
>  #endif
> @@ -473,4 +474,5 @@
>  #endif
>  %}
> 
> -%include svn_client.h
> +%include svn_time_h.swg
> +%include svn_client_h.swg
> 
> Modified: trunk/subversion/bindings/swig/svn_delta.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_delta.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_delta.i&p2=trunk/subversion/bindings/swig/svn_delta.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_delta.i  (original)
> +++ trunk/subversion/bindings/swig/svn_delta.i  Sat Aug 20 12:36:30 2005
> @@ -26,9 +26,11 @@
> 
>  %include "typemaps.i"
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import apr.swg
> +%import core.i
> +%import svn_types.swg
> +%import svn_string.swg
> 
>  /* -----------------------------------------------------------------------
>     %apply-ing of typemaps defined elsewhere
> @@ -77,7 +79,6 @@
> 
>  %{
>  #include "svn_md5.h"
> -#include "svn_delta.h"
> 
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
> @@ -92,7 +93,7 @@
>  #endif
>  %}
> 
> -%include svn_delta.h
> +%include svn_delta_h.swg
> 
>  /* -----------------------------------------------------------------------
>     editor callback invokers
> @@ -102,6 +103,3 @@
>     if editor. */
>  %typemap(perl5, in) (const svn_delta_editor_t *editor, void *edit_baton);
> 
> -#ifdef SWIGPERL
> -%include delta_editor.hi
> -#endif
> 
> Modified: trunk/subversion/bindings/swig/svn_fs.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_fs.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_fs.i&p2=trunk/subversion/bindings/swig/svn_fs.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_fs.i     (original)
> +++ trunk/subversion/bindings/swig/svn_fs.i     Sat Aug 20 12:36:30 2005
> @@ -26,9 +26,11 @@
> 
>  %include typemaps.i
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import apr.swg
> +%import core.i
> +%import svn_types.swg
> +%import svn_string.swg
>  %import svn_delta.i
> 
>  /* -----------------------------------------------------------------------
> @@ -91,11 +93,13 @@
>  %typemap(python,argout,fragment="t_output_helper") apr_hash_t **entries_p {
>      $result = t_output_helper(
>          $result,
> -        svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_fs_dirent_t));
> +        svn_swig_py_convert_hash(*$1, $descriptor(svn_fs_dirent_t *),
> +          _global_svn_swig_py_pool));
>  }
>  %typemap(perl5,in,numinputs=0) apr_hash_t **entries_p = apr_hash_t **OUTPUT;
>  %typemap(perl5,argout) apr_hash_t **entries_p {
> -    ST(argvi++) = svn_swig_pl_convert_hash(*$1, SWIGTYPE_p_svn_fs_dirent_t);
> +    ST(argvi++) = svn_swig_pl_convert_hash(*$1,
> +      $descriptor(svn_fs_dirent_t *));
>  }
>  %typemap(ruby,in,numinputs=0) apr_hash_t **entries_p = apr_hash_t **OUTPUT;
>  %typemap(ruby,argout) apr_hash_t **entries_p {
> @@ -111,12 +115,14 @@
>  %typemap(python, argout, fragment="t_output_helper") apr_hash_t **changed_paths_p {
>      $result = t_output_helper(
>          $result,
> -        svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_fs_path_change_t));
> +        svn_swig_py_convert_hash(*$1, $descriptor(svn_fs_path_change_t *),
> +          _global_svn_swig_py_pool));
>  }
> 
>  %typemap(perl5, in,numinputs=0) apr_hash_t **changed_paths_p = apr_hash_t **OUTPUT;
>  %typemap(perl5, argout) apr_hash_t **changed_paths_p {
> -    ST(argvi++) = svn_swig_pl_convert_hash(*$1, SWIGTYPE_p_svn_fs_path_change_t);
> +    ST(argvi++) = svn_swig_pl_convert_hash(*$1,
> +      $descriptor(svn_fs_path_change_t *));
>  }
> 
>  /* -----------------------------------------------------------------------
> @@ -147,7 +153,6 @@
> 
>  %{
>  #include "svn_md5.h"
> -#include "svn_fs.h"
> 
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
> @@ -162,4 +167,4 @@
>  #endif
>  %}
> 
> -%include svn_fs.h
> +%include svn_fs_h.swg
> 
> Modified: trunk/subversion/bindings/swig/svn_ra.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_ra.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_ra.i&p2=trunk/subversion/bindings/swig/svn_ra.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_ra.i     (original)
> +++ trunk/subversion/bindings/swig/svn_ra.i     Sat Aug 20 12:36:30 2005
> @@ -26,9 +26,11 @@
> 
>  %include typemaps.i
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import apr.swg
> +%import core.i
> +%import svn_types.swg
> +%import svn_string.swg
>  %import svn_delta.i
> 
>  /* bad pool convention, also these should not be public interface at all
> @@ -92,8 +94,6 @@
>  /* ----------------------------------------------------------------------- */
> 
>  %{
> -#include "svn_ra.h"
> -
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
>  #endif
> @@ -107,8 +107,5 @@
>  #endif
>  %}
> 
> -%include svn_ra.h
> +%include svn_ra_h.swg
> 
> -#ifdef SWIGPERL
> -%include ra_reporter.hi
> -#endif
> 
> Modified: trunk/subversion/bindings/swig/svn_repos.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_repos.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_repos.i&p2=trunk/subversion/bindings/swig/svn_repos.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_repos.i  (original)
> +++ trunk/subversion/bindings/swig/svn_repos.i  Sat Aug 20 12:36:30 2005
> @@ -26,9 +26,11 @@
> 
>  %include typemaps.i
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import apr.swg
> +%import core.i
> +%import svn_types.swg
> +%import svn_string.swg
>  %import svn_delta.i
>  %import svn_fs.i
> 
> @@ -69,7 +71,7 @@
>      $1 = (apr_array_header_t *) svn_swig_py_revnums_to_array($input,
>                                                               _global_pool);
>      if ($1 == NULL)
> -        return NULL;
> +        SWIG_fail;
>  }
> 
>  /* -----------------------------------------------------------------------
> @@ -103,7 +105,8 @@
>  %typemap(python,argout,fragment="t_output_helper") apr_hash_t **locks {
>      $result = t_output_helper(
>          $result,
> -        svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_lock_t));
> +        svn_swig_py_convert_hash(*$1, $descriptor(svn_lock_t *),
> +          _global_svn_swig_py_pool));
>  }
> 
> 
> @@ -162,8 +165,6 @@
>  /* ----------------------------------------------------------------------- */
> 
>  %{
> -#include "svn_repos.h"
> -
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
>  #endif
> @@ -177,4 +178,4 @@
>  #endif
>  %}
> 
> -%include svn_repos.h
> +%include svn_repos_h.swg
> 
> Deleted: trunk/subversion/bindings/swig/svn_string.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_string.i?rev=15847
> 
> Deleted: trunk/subversion/bindings/swig/svn_types.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_types.i?rev=15847
> 
> Modified: trunk/subversion/bindings/swig/svn_wc.i
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/bindings/swig/svn_wc.i?rev=15848&p1=trunk/subversion/bindings/swig/svn_wc.i&p2=trunk/subversion/bindings/swig/svn_wc.i&r1=15847&r2=15848
> ==============================================================================
> --- trunk/subversion/bindings/swig/svn_wc.i     (original)
> +++ trunk/subversion/bindings/swig/svn_wc.i     Sat Aug 20 12:36:30 2005
> @@ -26,10 +26,13 @@
> 
>  %include typemaps.i
> 
> -%import apr.i
> -%import svn_types.i
> -%import svn_string.i
> +%include svn_global.swg
> +%import apr.swg
> +%import core.i
> +%import svn_types.swg
> +%import svn_string.swg
>  %import svn_delta.i
> +%import svn_ra.i
> 
>  /* -----------------------------------------------------------------------
>     ### these functions require a pool, which we don't have immediately
> @@ -65,7 +68,8 @@
>  %typemap(python, argout, fragment="t_output_helper") apr_hash_t **entries {
>      $result = t_output_helper(
>          $result,
> -        svn_swig_py_convert_hash(*$1, SWIGTYPE_p_svn_wc_entry_t));
> +        svn_swig_py_convert_hash(*$1, $descriptor(svn_wc_entry_t *),
> +          _global_svn_swig_py_pool));
>  }
> 
>  /* -----------------------------------------------------------------------
> @@ -123,8 +127,6 @@
>  /* ----------------------------------------------------------------------- */
> 
>  %{
> -#include "svn_wc.h"
> -
>  #ifdef SWIGPYTHON
>  #include "swigutil_py.h"
>  #endif
> @@ -138,4 +140,4 @@
>  #endif
>  %}
> 
> -%include svn_wc.h
> +%include svn_wc_h.swg
> 
> Modified: trunk/tools/test-scripts/svntest/svntest-bindings.sh
> Url: http://svn.collab.net/viewcvs/svn/trunk/tools/test-scripts/svntest/svntest-bindings.sh?rev=15848&p1=trunk/tools/test-scripts/svntest/svntest-bindings.sh&p2=trunk/tools/test-scripts/svntest/svntest-bindings.sh&r1=15847&r2=15848
> ==============================================================================
> --- trunk/tools/test-scripts/svntest/svntest-bindings.sh        (original)
> +++ trunk/tools/test-scripts/svntest/svntest-bindings.sh        Sat Aug 20 12:36:30 2005
> @@ -61,15 +61,9 @@
>  test "$TEST_BINDINGS_SWIG_PYTHON" = "yes" && {
>      $NICE $EXEC_PATH/svntest-bindings-generic.sh \
>         "$BUILD_TYPE" "$BINDING_NAME" \
> -       "swig-py" "install-swig-py" ""
> +       "swig-py" "install-swig-py" "check-swig-py"
>      if test $? = 0
>      then
> -        cat >> "$LOG_FILE_DIR/LOG_${BINDING_NAME}.$BUILD_TYPE" <<EOF
> -
> -Hey!  My friends have got beautiful and shining unit tests,
> -but I have been left out in the cold. This is soooo unfair!
> -
> -EOF
>          send_bindings_email "$BINDING_NAME" "PASS"
>      else
>          send_bindings_email "$BINDING_NAME" "FAIL"
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
> 
> 


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 20, 2005 12:32:21 PM -0700 Garrett Rooney 
<ro...@electricjellyfish.net> wrote:

> I doubt it.  Actually, I'm pretty sure the regular svn unit tests won't
> work without a make install either, it's not just the bindings that have
> the problem.

Yup.  I also need to also install the svn_test and svn_test_fs libraries to 
get make check to work on Darwin.

Based upon all of my research into Darwin's linker docs, I'm fairly 
convinced that the Mac OS X linker can't do this.  Fred or someone who can 
poke the Darwin team could likely find out for sure.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Michael Brouwer <mi...@tlaloc.net>.
Actually the fix for darwin isn't that hard.   You just need to make  
sure than each shared library directly links against every other  
shared library that it directly uses symbols from.  (This allows you  
to keep two level namespaces enabled).  And this shouldn't negatively  
affect any other platforms.

Then if you set DYLD_LIBRARY_PATH at runtime of the tests, the tests  
can be installed anywhere you like.

In particular I recall that some of the swig bindings needed access  
to the apr libraries.  However the apr libs themselves didn't get  
built to the location than the makefiles ended up searching on OS X.   
If I recall correctly it was libs v/s .libs on the apr dir.  I tried  
submitting a patch for this about a year ago but was told to just  
make install apr before building the bindings.  If I can find some  
time I can try looking into why things don't currently work for  
trunk, but that might not be for another few weeks ;-(


Michael

On Aug 23, 2005, at 2:12 PM, Justin Erenkrantz wrote:

> --On August 21, 2005 5:27:37 PM +0100 Malcolm Rowe <malcolm-svn- 
> dev@farside.org.uk> wrote:
>
>
>> Everything seemed to work fine, including the tests, and there  
>> wasn't any
>> previous Subversion installation lying around, so it must have  
>> picked up
>> the just-built libraries. (The ~/usr directory didn't even exist  
>> until the
>> make install step ran).
>>
>
> So, if you use particular versions of GNU libtool, it'll cheat and  
> build two sets of libraries and executables on Darwin: one that is  
> built at 'make' that refers internally to the build directory time  
> and one that is built at 'install' time that refers to the  
> installed location.
>
> The cost of this means that the build is twice as slow on Darwin as  
> everything must be compiled twice.  I find that unacceptable; but I  
> have also lots of other reasons why I think libtool is the  
> scourge.  -- justin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 21, 2005 5:27:37 PM +0100 Malcolm Rowe 
<ma...@farside.org.uk> wrote:

> Everything seemed to work fine, including the tests, and there wasn't any
> previous Subversion installation lying around, so it must have picked up
> the just-built libraries. (The ~/usr directory didn't even exist until the
> make install step ran).

So, if you use particular versions of GNU libtool, it'll cheat and build 
two sets of libraries and executables on Darwin: one that is built at 
'make' that refers internally to the build directory time and one that is 
built at 'install' time that refers to the installed location.

The cost of this means that the build is twice as slow on Darwin as 
everything must be compiled twice.  I find that unacceptable; but I have 
also lots of other reasons why I think libtool is the scourge.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Sun, Aug 21, 2005 at 01:13:36AM -0700, Garrett Rooney wrote:
> >>I doubt it.  Actually, I'm pretty sure the regular svn unit tests won't 
> >>work without a make install either, it's not just the bindings that have 
> >>the problem.
> >'make check' works fine for me without a make install on Mac OS X here.
> If you already have a version of Subversion installed into the prefix 
> you're building in that could explain why it works for you, the tests 
> would be picking up the installed libraries, not the ones that were just 
> built.

Well, it certainly _seems_ to work fine. Just to be clear, this is what I've
just tried:

$ pwd
/Users/malcolm
$ curl -Ss -O http://fornix.brain.org/subversion/subversion-1.2.3.tar.bz2
$ md5 subversion-1.2.3.tar.bz2
$ tar jxf subversion-1.2.3.tar.bz2
$ cd subversion-1.2.3
$ ./configure --prefix=/Users/malcolm/usr
$ make
$ make check
$ make install

Everything seemed to work fine, including the tests, and there wasn't any
previous Subversion installation lying around, so it must have picked up
the just-built libraries. (The ~/usr directory didn't even exist until the
make install step ran).

This is a pretty stock Mac OS 10.4.2/Xcode 2.1 installation, so it complained
about Apache, Ruby, and BDB dependencies (and wouldn't build mod_dav_svn,
Ruby bindings, and BDB support respectively), but the resulting tests seemed
to be doing _something_.

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Malcolm Rowe wrote:
> On Sat, Aug 20, 2005 at 12:32:21PM -0700, Garrett Rooney wrote:
> 
>>>I'd like to make this feature work on Mac OS X, if possible. Does the
>>>Java, Perl, and Ruby in-build-dir testing work in Mac OS X?
>>
>>I doubt it.  Actually, I'm pretty sure the regular svn unit tests won't 
>>work without a make install either, it's not just the bindings that have 
>>the problem.
> 
> 
> 'make check' works fine for me without a make install on Mac OS X here.
> (Is that what you meant by 'svn unit tests'?)

If you already have a version of Subversion installed into the prefix 
you're building in that could explain why it works for you, the tests 
would be picking up the installed libraries, not the ones that were just 
built.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Sat, Aug 20, 2005 at 12:32:21PM -0700, Garrett Rooney wrote:
> >I'd like to make this feature work on Mac OS X, if possible. Does the
> >Java, Perl, and Ruby in-build-dir testing work in Mac OS X?
> I doubt it.  Actually, I'm pretty sure the regular svn unit tests won't 
> work without a make install either, it's not just the bindings that have 
> the problem.

'make check' works fine for me without a make install on Mac OS X here.
(Is that what you meant by 'svn unit tests'?)

I'm not building mod_dav_svn, though, so I don't know if that makes a
difference.

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
David James wrote:
> On 8/20/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> 
>>> * In-build-directory testing (r15478)
>>
>>This doesn't seem to work on Mac OS X.  The tests appear to be referring
>>to the installed location of the various subversion libraries, not the
>>build location.  I don't think this is a problem with the python
>>bindings themselves, since we've seen similar behavior in APR on OS X
>>lately, but just in case anyone is trying to run the tests and wonders
>>why it doesn't work on OS X, you just have to do a 'make install' then a
>>'make install-swig-py' and it'll work.
> 
> I'd like to make this feature work on Mac OS X, if possible. Does the
> Java, Perl, and Ruby in-build-dir testing work in Mac OS X?

I doubt it.  Actually, I'm pretty sure the regular svn unit tests won't 
work without a make install either, it's not just the bindings that have 
the problem.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/20/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> >  * In-build-directory testing (r15478)
> This doesn't seem to work on Mac OS X.  The tests appear to be referring
> to the installed location of the various subversion libraries, not the
> build location.  I don't think this is a problem with the python
> bindings themselves, since we've seen similar behavior in APR on OS X
> lately, but just in case anyone is trying to run the tests and wonders
> why it doesn't work on OS X, you just have to do a 'make install' then a
> 'make install-swig-py' and it'll work.
I'd like to make this feature work on Mac OS X, if possible. Does the
Java, Perl, and Ruby in-build-dir testing work in Mac OS X?

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
David James wrote:
> I've committed some major upgrades to SWIG/Python bindings in r15848
> (Merged from the python-bindings-improvements branch).
> 
> Details below:

>  * In-build-directory testing (r15478)

This doesn't seem to work on Mac OS X.  The tests appear to be referring 
to the installed location of the various subversion libraries, not the 
build location.  I don't think this is a problem with the python 
bindings themselves, since we've seen similar behavior in APR on OS X 
lately, but just in case anyone is trying to run the tests and wonders 
why it doesn't work on OS X, you just have to do a 'make install' then a 
'make install-swig-py' and it'll work.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/27/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> On Sun, Aug 21, 2005 at 02:50:23AM -0400, David James wrote:
> > Philip, I've addressed your concerns in r15855 on the
> > python-bindings-improvements branch. Does this look good to merge to
> > trunk?
> 
> What is on the branch is far better than what's in trunk right now.
> 
> +1 to merge.
> 
> There's still problems with the code sitting in the branch; but I'll
> post about that in a separate email.  But, the merge needs to happen
> before my other problems can be resolved.  -- justin
Committed in r15940. 

Thanks Justin!

David


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Sun, Aug 21, 2005 at 02:50:23AM -0400, David James wrote:
> Philip, I've addressed your concerns in r15855 on the
> python-bindings-improvements branch. Does this look good to merge to
> trunk?

What is on the branch is far better than what's in trunk right now.

+1 to merge.

There's still problems with the code sitting in the branch; but I'll
post about that in a separate email.  But, the merge needs to happen
before my other problems can be resolved.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/20/05, David James <ja...@gmail.com> wrote:
> On 8/20/05, Philip Martin <ph...@codematters.co.uk> wrote:
> > Given that I run gen-make.py, with a particular version of swig, in
> > the source directory it's not clear how I can have multiple build
> > directories using different versions of swig.
> Ah, I understand now. This is not possible.
> 
> > I don't do that sort of
> > thing very often, in fact I rarely build the bindings at all, but I
> > have done it in the past when experimenting with new versions of swig.
> I'll add back the "--with-swig" configure option, so that you can
> continue doing this.

Philip, I've addressed your concerns in r15855 on the
python-bindings-improvements branch. Does this look good to merge to
trunk?

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/20/05, Philip Martin <ph...@codematters.co.uk> wrote:
> Given that I run gen-make.py, with a particular version of swig, in
> the source directory it's not clear how I can have multiple build
> directories using different versions of swig. 
Ah, I understand now. This is not possible.

> I don't do that sort of
> thing very often, in fact I rarely build the bindings at all, but I
> have done it in the past when experimenting with new versions of swig.
I'll add back the "--with-swig" configure option, so that you can
continue doing this.

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Philip Martin <ph...@codematters.co.uk>.
David James <ja...@gmail.com> writes:

> On 8/20/05, Philip Martin <ph...@codematters.co.uk> wrote:
>> Taking a guess, is that's because I now need to pass the swig location
>> to gen-make.py rather than to configure?
> Yes. If SWIG is not in your path, then you have two choices:
> 1. Add the directory for the swig binary to your path (so autogen.sh
> can find it)
> 2. Specify the path directly using the following command:
>     python gen-make.py --with-swig=/usr/local/swig-1.3.24

I run this in the source directory.

> In order to make the build process easier, we should also allow users
> to specify their SWIG path in "configure" using the --with-swig
> option. I am working on this feature. (This feature will only apply to
> non-release builds, because SWIG files are generated during the source
> tarball release process now)
>
>> That seems like a step
>> backwards, I can no longer have multiple build directories using
>> different swig configurations.
> You can still do this (see above).

Given that I run gen-make.py, with a particular version of swig, in
the source directory it's not clear how I can have multiple build
directories using different versions of swig.  I don't do that sort of
thing very often, in fact I rarely build the bindings at all, but I
have done it in the past when experimenting with new versions of swig.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/20/05, Philip Martin <ph...@codematters.co.uk> wrote:
> Running gen-make.py creates a load of generated files.  Is there some
> reason these aren't created by a make?  Since they get created by
> gen-make.py rather than make they exist in the source directory rather
> than the build directory and they show up in 'svn status', that's bad.
It would be better if we generated the files using "make", and stored
them in the build dir. I am working on this feature. (This feature
will only apply to non-release builds, because SWIG files are
generated during the source tarball release process now)

> Taking a guess, is that's because I now need to pass the swig location
> to gen-make.py rather than to configure?
Yes. If SWIG is not in your path, then you have two choices:
1. Add the directory for the swig binary to your path (so autogen.sh
can find it)
2. Specify the path directly using the following command:
    python gen-make.py --with-swig=/usr/local/swig-1.3.24

In order to make the build process easier, we should also allow users
to specify their SWIG path in "configure" using the --with-swig
option. I am working on this feature. (This feature will only apply to
non-release builds, because SWIG files are generated during the source
tarball release process now)

> That seems like a step
> backwards, I can no longer have multiple build directories using
> different swig configurations.
You can still do this (see above).

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by David James <ja...@gmail.com>.
On 8/20/05, Philip Martin <ph...@codematters.co.uk> wrote:
> Running gen-make.py creates a load of generated files.  Is there some
> reason these aren't created by a make?  Since they get created by
> gen-make.py rather than make they exist in the source directory rather
> than the build directory and they show up in 'svn status', that's bad.
Fixed in r15865 on the python-bindings-improvements branch. Let me
know whether this is good to merge to trunk.

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Philip Martin <ph...@codematters.co.uk>.
David James <ja...@gmail.com> writes:

> I've committed some major upgrades to SWIG/Python bindings in r15848
> (Merged from the python-bindings-improvements branch).
>
> As gstein says, "It works on my machine" ;) Let me know if you run
> into any issues.

Running gen-make.py creates a load of generated files.  Is there some
reason these aren't created by a make?  Since they get created by
gen-make.py rather than make they exist in the source directory rather
than the build directory and they show up in 'svn status', that's bad.

I configure using --with-swig=/usr/local/swig-1.3.24 and it worked in
the past, but it no longer works:

configure: Configuring python swig binding
checking for Python includes... -I/usr/include/python2.3
checking for compiling Python extensions... gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
checking for linking Python extensions... gcc -pthread -shared
checking for linking Python libraries... 
checking for apr_int64_t Python/C API format string... L

$ make swig-py
python -c "raise 'Cannot find SWIG 1.3.24 or better. Please install SWIG, add it to your PATH,\nand rerun ./autogen.sh'"
Traceback (most recent call last):
  File "<string>", line 1, in ?
Cannot find SWIG 1.3.24 or better. Please install SWIG, add it to your PATH,
and rerun ./autogen.sh
make: *** [wrong-swig] Error 1

Taking a guess, is that's because I now need to pass the swig location
to gen-make.py rather than to configure?  That seems like a step
backwards, I can no longer have multiple build directories using
different swig configurations.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Christopher Ness <ch...@nesser.org>.
On Sat, 2005-08-20 at 14:05 -0400, David James wrote:
> I've committed some major upgrades to SWIG/Python bindings in r15848
> (Merged from the python-bindings-improvements branch).

I took r15848 for a spin on my older machine (python 2.2) and everything
seems to work just fine.  Although I'm not sure what tests were
performed - since I didn't look under the hood - they all came back
OK.  

I prefer the perl check output where they group tests into categories.
Anyway, that's just sugar, not substance.

Cheers,
Chris


Some info for those interested:

[nesscg@jackd python-bindings-improvements]$ make check-swig-py
cd /home/nesscg/sandbox/python-bindings-improvements/subversion/bindings/swig/python; \
  /usr/bin/python2 /home/nesscg/sandbox/python-bindings-improvements/subversion/bindings/swig/python/tests/run_all.py
...........................
----------------------------------------------------------------------
Ran 27 tests in 2.307s

OK
[nesscg@jackd python-bindings-improvements]$ svnversion .
15848
[nesscg@jackd python-bindings-improvements]$ /usr/local/apache2/bin/apr-config --version
0.9.5
[nesscg@jackd python-bindings-improvements]$ /usr/local/bin/swig -version

SWIG Version 1.3.24
<snip>
[nesscg@jackd python-bindings-improvements]$ python -V
Python 2.2.3

-- 
PGP Public Key: http://www.nesser.org/pgp-key/
23:10:30 up 7:58, 3 users, load average: 0.27, 0.23, 0.13

Re: [PATCH] Link Python bindings against platform-specific library directory v4 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by David James <ja...@gmail.com>.
On 8/29/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> --On August 28, 2005 5:19:29 PM -0400 David James <ja...@gmail.com> wrote:
> 
> > Hi Justin,
> >
> > I've upgraded my patch to follow your advice. This patch should work
> > in all of our build scenarios now. Does this work for you?
> 
> Yup.  It looks right in my three setups.  Please feel free to commit to trunk.
> 
> Thanks!  -- justin

Great! I've committed this in r15967.

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Link Python bindings against platform-specific library directory v4 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 28, 2005 5:19:29 PM -0400 David James <ja...@gmail.com> wrote:

> Hi Justin,
>
> I've upgraded my patch to follow your advice. This patch should work
> in all of our build scenarios now. Does this work for you?

Yup.  It looks right in my three setups.  Please feel free to commit to trunk.

Thanks!  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Link Python bindings against platform-specific library directory v4 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by David James <ja...@gmail.com>.
On 8/28/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> Yup, if we meet all of these scenarios with the same code, we'll be
> doin' good.  =)
Hi Justin,

I've upgraded my patch to follow your advice. This patch should work
in all of our build scenarios now. Does this work for you?

[[[
Fix python library options when we have separate platform-specific
library directories, or when we are compiling on Mac OS X without a
framework.

* build/get-py-info.py:
 (string): Remove include.
 (ldshared_process): Remove function.
 (add_option): New function. Adds an option to a list of options.
 (add_option_if_missing): New function. Adds an option to a list of
 options, if it is not already present.
 (link_options): New function. Gets a list of the Python linker options.
 (lib_options): New function. Gets a list of the Python library options.
 (__main__): Use link_options and lib_options instead of ldshared_process.
]]

Thanks for your help!

David


> On Sun, Aug 28, 2005 at 02:02:04PM -0400, David James wrote:
> > On 8/28/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> > > > Justin, does this patch work better?
> > >
> > > Nope.  Here's some pointers as to what I'm getting and what's incorrect with
> > > each output with your patch.  (Trunk emits correct output in each case for me.)
> > Thanks! This is very helpful. Before I write another patch, I'll have
> > to figure out what I'm supposed to be outputting on each platform.
> > I'll do this below. Let me know whether you think the proposed output
> > is good.
> >
> > > Mac OS X 10.4:
> > >
> > > % python ./build/get-py-info.py --link
> > > gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup
> > > -Wl,-F/System/Library/Frameworks -framework Python
> > > % python ./build/get-py-info.py --libs
> > > -Wl,-F. -Wl,-F. -bundle -Wl,-F/System/Library/Frameworks -framework
> > >
> > > We don't need -F/System/Library/Frameworks, but that's minor.
> > Currently, I add in a "-F" statement with the framework prefix. Is
> > this ever necessary?
> 
> Only if it isn't /System/Library/Frameworks - it's like /usr/lib in the
> sense that it's in the 'default' lookup path.
> 
> > Here's a few examples where the trunk code doesn't work. I'll show the
> > output of "get-py-info.py --libs" in each case.
> >
> > ---
> > Linux, architecture-dependent library directory, no DSO:
> > NOTE: Static library is stored in /pkgs/python-2.3.4/linux/lib/config
> > Trunk (doesn't work):
> >   -L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
> > Proposed output (works):
> >   -L/pkgs/python-2.3.4/linux/lib/config -lpython2.3
> >
> > ---
> > Solaris, architecture-dependent library directory, no DSO:
> > NOTE: Static library is stored in /pkgs/python-2.3.4/sunos5/lib/python2.3/config
> > Trunk (I assume this doesn't work):
> >   -L/cs/src/ddd-3.3.1/readline
> > -L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
> > Proposed output (I assume this works):
> >   -L/cs/src/ddd-3.3.1/readline
> > -L/pkgs/python-2.3.4/sunos5/lib/python2.3/config -lpython2.3
> >
> > ---
> > Mac OS X, no framework:
> >
> > Trunk (doesn't work, because there is no python2.2 library):
> >   -L/usr/lib/python2.2/config -lpython2.2
> > Proposed output (works):
> >   -bundle -flat_namespace -undefined suppress -bundle_loader /usr/bin/python
> >
> > ("-bundle -flat_namespace -undefined suppress" is unnecessary, but
> > these arguments are specified in the Python LDSHARED linker options
> > for Python 2.2, so I figure it's a good idea to leave them alone.)
> 
> Yah, let's not try to second-guess what is in LDSHARED in the Makefile.
> 
> > ---
> > Mac OS X 10.4:
> > NOTE: Framework prefix is /pkgs/python-2.3.4/framework
> > Trunk (This works, but it's missing the dynamic_lookup option):
> >   -framework Python
> > Proposed output (Better?):
> >    -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup -framework Python
> >
> > ("-Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup" are specified by
> > the LDSHARED linker options, and I believe they allow for better
> > portability.)
> 
> *nod*
> 
> > ---
> > Linux, home dir install, no DSO:
> > NOTE: Static library is stored in /h/46/james/lib/python2.4/config
> > Trunk (works):
> >   -L/h/46/james/lib/python2.4/config -lpython2.4
> > Proposed output: Same output.
> >
> > ---
> > Linux, full install, no DSO:
> > NOTE: Static library is stored in /usr/lib/python2.2/config
> > Trunk (works):
> >   -L/usr/lib/python2.2/config -lpython2.2
> > Proposed output: Same output.
> 


-- 
David James -- http://www.cs.toronto.edu/~james

Re: [PATCH] Link Python bindings against platform-specific library directory v3 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Sun, Aug 28, 2005 at 02:02:04PM -0400, David James wrote:
> On 8/28/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> > > Justin, does this patch work better?
> > 
> > Nope.  Here's some pointers as to what I'm getting and what's incorrect with
> > each output with your patch.  (Trunk emits correct output in each case for me.)
> Thanks! This is very helpful. Before I write another patch, I'll have
> to figure out what I'm supposed to be outputting on each platform.
> I'll do this below. Let me know whether you think the proposed output
> is good.
> 
> > Mac OS X 10.4:
> > 
> > % python ./build/get-py-info.py --link
> > gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup
> > -Wl,-F/System/Library/Frameworks -framework Python
> > % python ./build/get-py-info.py --libs
> > -Wl,-F. -Wl,-F. -bundle -Wl,-F/System/Library/Frameworks -framework
> > 
> > We don't need -F/System/Library/Frameworks, but that's minor. 
> Currently, I add in a "-F" statement with the framework prefix. Is
> this ever necessary?

Only if it isn't /System/Library/Frameworks - it's like /usr/lib in the
sense that it's in the 'default' lookup path.

> Here's a few examples where the trunk code doesn't work. I'll show the
> output of "get-py-info.py --libs" in each case.
> 
> ---
> Linux, architecture-dependent library directory, no DSO:
> NOTE: Static library is stored in /pkgs/python-2.3.4/linux/lib/config
> Trunk (doesn't work): 
>   -L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
> Proposed output (works):
>   -L/pkgs/python-2.3.4/linux/lib/config -lpython2.3
> 
> ---
> Solaris, architecture-dependent library directory, no DSO:
> NOTE: Static library is stored in /pkgs/python-2.3.4/sunos5/lib/python2.3/config
> Trunk (I assume this doesn't work): 
>   -L/cs/src/ddd-3.3.1/readline
> -L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
> Proposed output (I assume this works):
>   -L/cs/src/ddd-3.3.1/readline
> -L/pkgs/python-2.3.4/sunos5/lib/python2.3/config -lpython2.3
> 
> ---
> Mac OS X, no framework:
> 
> Trunk (doesn't work, because there is no python2.2 library):
>   -L/usr/lib/python2.2/config -lpython2.2
> Proposed output (works):
>   -bundle -flat_namespace -undefined suppress -bundle_loader /usr/bin/python
> 
> ("-bundle -flat_namespace -undefined suppress" is unnecessary, but
> these arguments are specified in the Python LDSHARED linker options
> for Python 2.2, so I figure it's a good idea to leave them alone.)

Yah, let's not try to second-guess what is in LDSHARED in the Makefile.

> ---
> Mac OS X 10.4:
> NOTE: Framework prefix is /pkgs/python-2.3.4/framework
> Trunk (This works, but it's missing the dynamic_lookup option):
>   -framework Python
> Proposed output (Better?):
>    -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup -framework Python
> 
> ("-Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup" are specified by
> the LDSHARED linker options, and I believe they allow for better
> portability.)

*nod*

> ---
> Linux, home dir install, no DSO:
> NOTE: Static library is stored in /h/46/james/lib/python2.4/config
> Trunk (works):
>   -L/h/46/james/lib/python2.4/config -lpython2.4
> Proposed output: Same output.
> 
> ---
> Linux, full install, no DSO:
> NOTE: Static library is stored in /usr/lib/python2.2/config
> Trunk (works):
>   -L/usr/lib/python2.2/config -lpython2.2
> Proposed output: Same output.

Yup, if we meet all of these scenarios with the same code, we'll be
doin' good.  =)

Thanks.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Link Python bindings against platform-specific library directory v3 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by David James <ja...@gmail.com>.
On 8/28/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> > Justin, does this patch work better?
> 
> Nope.  Here's some pointers as to what I'm getting and what's incorrect with
> each output with your patch.  (Trunk emits correct output in each case for me.)
Thanks! This is very helpful. Before I write another patch, I'll have
to figure out what I'm supposed to be outputting on each platform.
I'll do this below. Let me know whether you think the proposed output
is good.

> Mac OS X 10.4:
> 
> % python ./build/get-py-info.py --link
> gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup
> -Wl,-F/System/Library/Frameworks -framework Python
> % python ./build/get-py-info.py --libs
> -Wl,-F. -Wl,-F. -bundle -Wl,-F/System/Library/Frameworks -framework
> 
> We don't need -F/System/Library/Frameworks, but that's minor. 
Currently, I add in a "-F" statement with the framework prefix. Is
this ever necessary?

> The big problem is that --libs doesn't have '-framework Python'
Oops. I'll fix this in my next patch.

> Solaris 10:
> 
> % python get-py-info.py --link
> cc -G -L/pkg/python-2.4/lib -L/pkg/python-2.4/lib/python2.4/config -lpython2.4
> % python get-py-info.py --libs
> -L/pkg/python-2.4/lib -L/pkg/python-2.4/lib/python2.4/config -lpython2.4
> 
> We don't need '-L/pkg/python-2.4/lib' as there's nothing in there.
Okay, I'll implement this.

> % python get-py-info.py --link
> gcc -pthread -shared -L/usr/lib/python2.4/config -lpython2.4
> % python get-py-info.py --libs
> -L/usr/lib/python2.4/config -lpython2.4
> 
> Again, this is wrong.  It should prefer the DSO sitting in /usr/lib.  The
> 'correct' output for Ubuntu would be (and this is what trunk emits):
> % python ./build/get-py-info.py --link
> gcc -pthread -shared -lpython2.4
> % python ./build/get-py-info.py --libs
> -lpython2.4
Okay, I'll implement this.

> The version of get-py-info.py in trunk has some stat()'s to try to prevent us
> from emitting bogus paths and to explicitly prefer DSOs over .a files.
Here's a few examples where the trunk code doesn't work. I'll show the
output of "get-py-info.py --libs" in each case.

---
Linux, architecture-dependent library directory, no DSO:
NOTE: Static library is stored in /pkgs/python-2.3.4/linux/lib/config
Trunk (doesn't work): 
  -L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
Proposed output (works):
  -L/pkgs/python-2.3.4/linux/lib/config -lpython2.3

---
Solaris, architecture-dependent library directory, no DSO:
NOTE: Static library is stored in /pkgs/python-2.3.4/sunos5/lib/python2.3/config
Trunk (I assume this doesn't work): 
  -L/cs/src/ddd-3.3.1/readline
-L/pkgs/python-2.3.4/lib/python2.3/config -lpython2.3
Proposed output (I assume this works):
  -L/cs/src/ddd-3.3.1/readline
-L/pkgs/python-2.3.4/sunos5/lib/python2.3/config -lpython2.3

---
Mac OS X, no framework:

Trunk (doesn't work, because there is no python2.2 library):
  -L/usr/lib/python2.2/config -lpython2.2
Proposed output (works):
  -bundle -flat_namespace -undefined suppress -bundle_loader /usr/bin/python

("-bundle -flat_namespace -undefined suppress" is unnecessary, but
these arguments are specified in the Python LDSHARED linker options
for Python 2.2, so I figure it's a good idea to leave them alone.)

---
Mac OS X 10.4:
NOTE: Framework prefix is /pkgs/python-2.3.4/framework
Trunk (This works, but it's missing the dynamic_lookup option):
  -framework Python
Proposed output (Better?):
   -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup -framework Python

("-Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup" are specified by
the LDSHARED linker options, and I believe they allow for better
portability.)

---
Linux, home dir install, no DSO:
NOTE: Static library is stored in /h/46/james/lib/python2.4/config
Trunk (works):
  -L/h/46/james/lib/python2.4/config -lpython2.4
Proposed output: Same output.

---
Linux, full install, no DSO:
NOTE: Static library is stored in /usr/lib/python2.2/config
Trunk (works):
  -L/usr/lib/python2.2/config -lpython2.2
Proposed output: Same output.


-- 
David James -- http://www.cs.toronto.edu/~james

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Link Python bindings against platform-specific library directory v3 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 28, 2005 2:29:33 AM -0400 David James <ja...@gmail.com> wrote:

> Justin, does this patch work better?

Nope.  Here's some pointers as to what I'm getting and what's incorrect with 
each output with your patch.  (Trunk emits correct output in each case for me.)

Mac OS X 10.4:

% python ./build/get-py-info.py --link
gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup 
-Wl,-F/System/Library/Frameworks -framework Python
% python ./build/get-py-info.py --libs
-Wl,-F. -Wl,-F. -bundle -Wl,-F/System/Library/Frameworks -framework

We don't need -F/System/Library/Frameworks, but that's minor.  The big problem 
is that --libs doesn't have '-framework Python'

Solaris 10:

% python get-py-info.py --link
cc -G -L/pkg/python-2.4/lib -L/pkg/python-2.4/lib/python2.4/config -lpython2.4
% python get-py-info.py --libs
-L/pkg/python-2.4/lib -L/pkg/python-2.4/lib/python2.4/config -lpython2.4

We don't need '-L/pkg/python-2.4/lib' as there's nothing in there.

% python get-py-info.py --link
gcc -pthread -shared -L/usr/lib/python2.4/config -lpython2.4
% python get-py-info.py --libs
-L/usr/lib/python2.4/config -lpython2.4

Again, this is wrong.  It should prefer the DSO sitting in /usr/lib.  The 
'correct' output for Ubuntu would be (and this is what trunk emits):

% python ./build/get-py-info.py --link
gcc -pthread -shared -lpython2.4
% python ./build/get-py-info.py --libs
-lpython2.4

The version of get-py-info.py in trunk has some stat()'s to try to prevent us 
from emitting bogus paths and to explicitly prefer DSOs over .a files.

HTH.  Thanks.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Link Python bindings against platform-specific library directory v3 (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by David James <ja...@gmail.com>.
On 8/27/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> On Sat, Aug 27, 2005 at 05:07:48PM -0400, David James wrote:
> > Great work, Justin! Your code works great on Linux and Cygwin. I also
> > tested on Solaris and Linux with separate platform-specific library
> > directories -- this caused a few problems. I've attached a patch to
> > fix this.
> >
> > I've checked the output of "get-py-info.py" on the following platforms:
> > - Shared libpython DSO / Python 2.2 (Redhat Linux 2.4)
> > - Shared libpython DLL / Python 2.4 (Cygwin)
> > - Custom-built Python 2.4 (Redhat Linux 2.4)
> > - Shared libpython DSO in separate platform-specific library
> > directories (Solaris / Python 2.2, Solaris / Python 2.3, Linux /
> > Python 2.3)
> >
> > The "Shared libpython DSO in separate platform-specific library
> > directories" test case only works with the following patch.
> 
> This breaks on Ubuntu as it stores the DSO in $libdir/libpython2.4.so
> not in $libdir/python2.4/config/libpython2.4.so.  (LIBP is set to
> $libdir/python2.4/config on Ubuntu.)
> 
> Any thoughts?  -- justin

Justin, does this patch work better?

[[[
Fix python library options when we have separate platform-specific
library directories, or when we are compiling on Mac OS X without a
framework.

Tested on:
- Shared libpython DSO / Python 2.2 (Redhat Linux 2.4)
- Shared libpython DLL / Python 2.4 (Cygwin)
- Custom-built Python 2.4 (Redhat Linux 2.4)
- Shared libpython DSO in separate platform-specific library
  directories (Solaris / Python 2.2, Solaris / Python 2.3, Linux /
  Python 2.3)
- Mac OS X without a framework (Mac OS X 10.2 / Python 2.2)

* build/get-py-info.py:
  (string): Remove include.
  (ldshared_process): Remove function.
  (remove_option): New function. Removes an option from a list of options.
  (add_option): New function. Adds an option to a list of options.
  (link_options): New function. Gets a list of the Python linker options.
	(lib_options): New function. Gets a list of the Python library options.
  (__main__): Use link_options and lib_options instead of ldshared_process.
]]

Cheers,

David


-- 
David James -- http://www.cs.toronto.edu/~james

Re: [PATCH] Link Python bindings against platform-specific library directory (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Sat, Aug 27, 2005 at 05:07:48PM -0400, David James wrote:
> Great work, Justin! Your code works great on Linux and Cygwin. I also
> tested on Solaris and Linux with separate platform-specific library
> directories -- this caused a few problems. I've attached a patch to
> fix this.
> 
> I've checked the output of "get-py-info.py" on the following platforms:
> - Shared libpython DSO / Python 2.2 (Redhat Linux 2.4)
> - Shared libpython DLL / Python 2.4 (Cygwin)
> - Custom-built Python 2.4 (Redhat Linux 2.4)
> - Shared libpython DSO in separate platform-specific library
> directories (Solaris / Python 2.2, Solaris / Python 2.3, Linux /
> Python 2.3)
> 
> The "Shared libpython DSO in separate platform-specific library
> directories" test case only works with the following patch.

This breaks on Ubuntu as it stores the DSO in $libdir/libpython2.4.so
not in $libdir/python2.4/config/libpython2.4.so.  (LIBP is set to
$libdir/python2.4/config on Ubuntu.)

Any thoughts?  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Link Python bindings against platform-specific library directory (was: Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848))

Posted by David James <ja...@gmail.com>.
On 8/27/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> --On August 27, 2005 1:10:14 PM -0400 David James <ja...@gmail.com> wrote:
> 
> > It looks like "get-py-info.py" does not explicitly link Subversion
> > against libpython. For most people, this works fine, but it's still a
> > bug. Previously, this bug was hidden because we indirectly link to
> > libpython when we use the SWIG 1.3.19-1.3.21 runtime libraries.
> >
> > In r10450, Max Bowsher patched "get-py-info.py" to explicitly link
> > Subversion against libpython on the Cygwin platform. In this patch, I
> > have upgraded Max's code to run on all platforms. I have also upgraded
> > Max's code to be compatible with Python 2.2.
> >
> > Justin, does this solve your problem?
> 
> It pointed me in the right direction as to how you thought it should be
> solved.  I committed this patch with my modifications in r15943 to trunk.
> 
> get-py-info.py outputs the right info for me on Solaris (self-compiled Python
> & /usr/sfw/python), Ubuntu Linux (which provides a shared libpython DSO), and
> Mac OS X (which uses frameworks).  I confirmed it now builds and links
> correctly on Solaris.
> 
> Please give it a go on your platforms to make sure I didn't bust something
> else.  ;-)

Great work, Justin! Your code works great on Linux and Cygwin. I also
tested on Solaris and Linux with separate platform-specific library
directories -- this caused a few problems. I've attached a patch to
fix this.

I've checked the output of "get-py-info.py" on the following platforms:
- Shared libpython DSO / Python 2.2 (Redhat Linux 2.4)
- Shared libpython DLL / Python 2.4 (Cygwin)
- Custom-built Python 2.4 (Redhat Linux 2.4)
- Shared libpython DSO in separate platform-specific library
directories (Solaris / Python 2.2, Solaris / Python 2.3, Linux /
Python 2.3)

The "Shared libpython DSO in separate platform-specific library
directories" test case only works with the following patch.

[[[
build/get-py-info.py:
* (ldshared_process): Update libdir to contain the Python standard library
  directory, as calculated using the "LIBPL" config variable. Use
  -lpython2.x to import python libraries on all platforms.
]]]

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james

Re: [PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848)

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 27, 2005 1:10:14 PM -0400 David James <ja...@gmail.com> wrote:

> It looks like "get-py-info.py" does not explicitly link Subversion
> against libpython. For most people, this works fine, but it's still a
> bug. Previously, this bug was hidden because we indirectly link to
> libpython when we use the SWIG 1.3.19-1.3.21 runtime libraries.
>
> In r10450, Max Bowsher patched "get-py-info.py" to explicitly link
> Subversion against libpython on the Cygwin platform. In this patch, I
> have upgraded Max's code to run on all platforms. I have also upgraded
> Max's code to be compatible with Python 2.2.
>
> Justin, does this solve your problem?

It pointed me in the right direction as to how you thought it should be 
solved.  I committed this patch with my modifications in r15943 to trunk.

get-py-info.py outputs the right info for me on Solaris (self-compiled Python 
& /usr/sfw/python), Ubuntu Linux (which provides a shared libpython DSO), and 
Mac OS X (which uses frameworks).  I confirmed it now builds and links 
correctly on Solaris.

Please give it a go on your platforms to make sure I didn't bust something 
else.  ;-)

Thanks.  -- justin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Explicitly link the python bindings against libpython (was: Re: Major upgrades to SWIG/Python bindings in r15848)

Posted by David James <ja...@gmail.com>.
On 8/27/05, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> On Sat, Aug 20, 2005 at 02:05:43PM -0400, David James wrote:
> > I've committed some major upgrades to SWIG/Python bindings in r15848
> > (Merged from the python-bindings-improvements branch).
> 
> Given that trunk didn't do squat for me (I ran into similar problems as
> Philip did), I switched back to the branch.
> 
> However, there's a problem here (both in trunk and the branch): how is
> the SWIG generated code supposed to link to anything?
> 
> In my setups, linking consistently fails because of undefined symbols
> that are defined by Python's libraries.  Nowhere do I see any mention of
> linking to libpython.  Manually defining -lpython2.4 to LSWIGPY works.
> (Note that SWIG_PY_LIBS doesn't get used anywhere, AFAICT.)
> 
> With previous SWIG versions, we'd link against libswigpy (defined at
> configure time as LSWIGPY) - which would link in turn to libpython.
> However, with our current setup, I don't see how that is being done.
> 
> I don't know if get-py-info.py needs to be 'spruced' up or something
> else.  (It wasn't touched at all as part of this work; so perhaps it is
> not useful anymore?)
> 
> % python ./get-py-info.py --libs
> 
> % python ./get-py-info.py --link
> gcc -pthread -shared
> 
> Philip's post contained a configure snippet that is almost identical to
> what I get.  So, unless I'm missing something, if he tries the branch
> (or trunk after merge), I think he's going to get the same problem.
> 
> I'm kinda stumped as I feel there's some pieces missing that I'm not
> sure where they go or if they are present.  -- justin

Hi Justin, Max:

It looks like "get-py-info.py" does not explicitly link Subversion
against libpython. For most people, this works fine, but it's still a
bug. Previously, this bug was hidden because we indirectly link to
libpython when we use the SWIG 1.3.19-1.3.21 runtime libraries.

In r10450, Max Bowsher patched "get-py-info.py" to explicitly link
Subversion against libpython on the Cygwin platform. In this patch, I
have upgraded Max's code to run on all platforms. I have also upgraded
Max's code to be compatible with Python 2.2.

Justin, does this solve your problem?

[[[
* build/get-py-info.py:
  (ldshared_process): Explicitly link the python bindings against
  libpython.

]]]

Cheers,

David



-- 
David James -- http://www.cs.toronto.edu/~james

Re: Major upgrades to SWIG/Python bindings in r15848

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Sat, Aug 20, 2005 at 02:05:43PM -0400, David James wrote:
> I've committed some major upgrades to SWIG/Python bindings in r15848
> (Merged from the python-bindings-improvements branch).

Given that trunk didn't do squat for me (I ran into similar problems as
Philip did), I switched back to the branch.

However, there's a problem here (both in trunk and the branch): how is
the SWIG generated code supposed to link to anything?

In my setups, linking consistently fails because of undefined symbols
that are defined by Python's libraries.  Nowhere do I see any mention of
linking to libpython.  Manually defining -lpython2.4 to LSWIGPY works.
(Note that SWIG_PY_LIBS doesn't get used anywhere, AFAICT.)

With previous SWIG versions, we'd link against libswigpy (defined at
configure time as LSWIGPY) - which would link in turn to libpython.
However, with our current setup, I don't see how that is being done.

I don't know if get-py-info.py needs to be 'spruced' up or something
else.  (It wasn't touched at all as part of this work; so perhaps it is
not useful anymore?)

% python ./get-py-info.py --libs

% python ./get-py-info.py --link
gcc -pthread -shared

Philip's post contained a configure snippet that is almost identical to
what I get.  So, unless I'm missing something, if he tries the branch
(or trunk after merge), I think he's going to get the same problem.

I'm kinda stumped as I feel there's some pieces missing that I'm not
sure where they go or if they are present.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org