This is the first in a series of changes to get all the bindings built
by default. If you have the necessary headers/tools/etc on your box,
then we'll start building these extra pieces.
If it gets too annoying for people, then something like ./configure
--with-ctypesgen=no can turn it off.
The goal here is to make our bindings more of a first-class part of
our release. Our C APIs are part of our product, and (in the (long)
past) we've said the same about the bindings. But since they're
second-class, they don't get nearly the amount of attention and rigor
that our C APIs get.
My hope is to also *simplify* the build/test system by integrating the
bindings better, instead of being warts pasted on.
Cheers,
-g
On Wed, Apr 22, 2009 at 17:28, Greg Stein <gstein_at_gmail.com> wrote:
> Author: gstein
> Date: Wed Apr 22 08:28:24 2009
> New Revision: 37427
>
> Log:
> First step in integrating ctypesgen tighter into the build system. This
> adds a little script to invoke ctypesgen rather than relying on setup.py
> and distutils (don't get me started on that package).
>
> * build/run_ctypesgen.sh:
> (): new script to invoke ctypesgen, given a bunch of configuration
> parameters as arguments. take particular care that we only write to
> the build tree, not the source tree.
>
> * Makefile.in:
> (ctypes-python): use new helper script
>
> Added:
> trunk/build/run_ctypesgen.sh (contents, props changed)
> Modified:
> trunk/Makefile.in
>
> Modified: trunk/Makefile.in
> URL: http://svn.collab.net/viewvc/svn/trunk/Makefile.in?pathrev=37427&r1=37426&r2=37427
> ==============================================================================
> --- trunk/Makefile.in Wed Apr 22 06:39:50 2009 (r37426)
> +++ trunk/Makefile.in Wed Apr 22 08:28:24 2009 (r37427)
> @@ -800,11 +800,7 @@ CTYPESGEN = @CTYPESGEN@
> CTYPES_PYTHON_SRC_DIR = $(abs_srcdir)/subversion/bindings/ctypes-python
>
> ctypes-python: local-all
> - cd $(CTYPES_PYTHON_SRC_DIR); \
> - $(LT_EXECUTE) $(PYTHON) setup.py build --subversion="$(prefix)" \
> - --apr="$(SVN_APR_PREFIX)" --apr-util="$(SVN_APRUTIL_PREFIX)" \
> - --ctypesgen="$(CTYPESGEN)" --svn-headers="$(abs_srcdir)/subversion/include" \
> - --cppflags="$(CPPFLAGS)" --ldflags="$(EXTRA_CTYPES_LDFLAGS)"
> + $(abs_srcdir)/build/run_ctypesgen.sh "$(LT_EXECUTE)" "$(CPPFLAGS)" "$(EXTRA_CTYPES_LDFLAGS)" "$(PYTHON)" "$(CTYPESGEN)" "$(abs_srcdir)" "$(abs_builddir)" "$(prefix)" "$(SVN_APR_PREFIX)" "$(SVN_APRUTIL_PREFIX)"
>
> install-ctypes-python: ctypes-python
> cd $(CTYPES_PYTHON_SRC_DIR); \
>
> Added: trunk/build/run_ctypesgen.sh
> URL: http://svn.collab.net/viewvc/svn/trunk/build/run_ctypesgen.sh?pathrev=37427
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ trunk/build/run_ctypesgen.sh Wed Apr 22 08:28:24 2009 (r37427)
> @@ -0,0 +1,64 @@
> +#!/bin/sh
> +#
> +# Helper script to generate the ctypesgen wrappers
> +#
> +
> +LT_EXECUTE="$1"
> +
> +CPPFLAGS="$2"
> +EXTRA_CTYPES_LDFLAGS="$3"
> +PYTHON="$4"
> +CTYPESGEN="$5"
> +
> +abs_srcdir="$6"
> +abs_builddir="$7"
> +
> +svn_prefix="$8"
> +apr_prefix="$9"
> +apu_prefix="${10}"
> +
> +cp_relpath="subversion/bindings/ctypes-python"
> +### tempfile instead?
> +output="$abs_builddir/$cp_relpath/svn_all.py"
> +
> +svn_includes="$abs_srcdir/subversion/include"
> +
> +### most of this should be done at configure time and passed in
> +apr_config="$apr_prefix/bin/apr-1-config"
> +apu_config="$apr_prefix/bin/apu-1-config"
> +
> +apr_cppflags="`$apr_config --includes --cppflags`"
> +apr_include_dir="`$apr_config --includedir`"
> +apr_ldflags="`$apr_config --ldflags --link-ld`"
> +
> +apu_cppflags="`$apu_config --includes`" # no --cppflags
> +apu_include_dir="`$apu_config --includedir`"
> +apu_ldflags="`$apu_config --ldflags --link-ld`"
> +
> +cpp="`$apr_config --cpp`"
> +### end
> +
> +cppflags="$apr_cppflags $apu_cppflags -I$svn_includes"
> +ldflags="$apr_ldflags $apu_ldflags -L$svn_prefix/lib $EXTRA_CTYPES_LDFLAGS"
> +
> +
> +# This order is important. The resulting stubs will load libraries in
> +# this particular order.
> +### maybe have gen-make do this for us
> +for lib in subr diff delta fs repos wc ra client ; do
> + ldflags="$ldflags -lsvn_$lib-1"
> +done
> +
> +includes="$svn_includes/svn_*.h $apr_include_dir/ap[ru]_*.h"
> +if test "$apr_include_dir" != "$apu_include_dir" ; then
> + includes="$includes $apu_include_dir/ap[ru]_*.h"
> +fi
> +
> +
> +echo $LT_EXECUTE $PYTHON $CTYPESGEN --cpp "$cpp $CPPFLAGS $cppflags" $ldflags $includes -o $output --no-macro-warnings --strip-build-path=$abs_srcdir
> +$LT_EXECUTE $PYTHON $CTYPESGEN --cpp "$cpp $CPPFLAGS $cppflags" $ldflags $includes -o $output --no-macro-warnings --strip-build-path=$abs_srcdir
> +
> +(cat $abs_srcdir/$cp_relpath/csvn/core/functions.py.in; \
> + sed -e '/^FILE =/d' \
> + -e 's/restype = POINTER(svn_error_t)/restype = SVN_ERR/' $output \
> + ) > $abs_builddir/$cp_relpath/csvn/core/functions.py
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1862055
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1862132
Received on 2009-04-22 17:40:34 CEST