[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Major upgrades to SWIG/Python bindings in r15848

From: David James <james82_at_gmail.com>
Date: 2005-08-20 20:05:43 CEST

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 <troy@resophonic.com>,
            Christian Boos <cboos@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 <djames@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 <troy@resophonic.com>,
> Christian Boos <cboos@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
Received on Sat Aug 20 20:07:34 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.