From 8463b9aff99d05a61048c8dc9dc249d544109bcd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 27 Nov 2007 23:28:23 +0100 Subject: r26177: Allow prebuilding swig wrapper, install ldb.py. (This used to be commit e61160dce4bdfc8ade8494c91c8bbec13d0afe4b) --- source4/lib/ldb/Makefile.in | 8 ++++++-- source4/lib/ldb/autogen.sh | 2 ++ source4/lib/ldb/setup.py | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/Makefile.in b/source4/lib/ldb/Makefile.in index 7e88ce2c5a..5ba70d77cd 100644 --- a/source4/lib/ldb/Makefile.in +++ b/source4/lib/ldb/Makefile.in @@ -15,6 +15,7 @@ VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@ srcdir = @srcdir@ builddir = @builddir@ SLAPD = @SLAPD@ +SWIG = swig EXTRA_OBJ=@EXTRA_OBJ@ TESTS=test-tdb.sh @TESTS@ @@ -232,11 +233,14 @@ etags: ctags: ctags `find $(srcdir) -name "*.[ch]"` +%_wrap.c %.py: %.i + $(SWIG) -python -keyword $< + # Python bindings -build-python: lib/libldb.$(SHLIBEXT) +build-python: lib/libldb.$(SHLIBEXT) ldb_wrap.c ldb.py ./setup.py build -install-python: +install-python: build-python ./setup.py install --prefix=$(prefix) check-python: build-python diff --git a/source4/lib/ldb/autogen.sh b/source4/lib/ldb/autogen.sh index aee9a6c2f7..921ef04d82 100755 --- a/source4/lib/ldb/autogen.sh +++ b/source4/lib/ldb/autogen.sh @@ -17,6 +17,8 @@ autoconf $IPATHS || exit 1 rm -rf autom4te.cache +swig -python ldb.i # Ignore errors, for now + echo "Now run ./configure and then make." exit 0 diff --git a/source4/lib/ldb/setup.py b/source4/lib/ldb/setup.py index 77b54f434d..2ec6d7b055 100755 --- a/source4/lib/ldb/setup.py +++ b/source4/lib/ldb/setup.py @@ -9,7 +9,7 @@ setup(name="ldb", author_email="ldb@samba.org", license="LGPLv3", keywords=["ldap","ldb","db","ldif"], - ext_modules=[Extension('_ldb', ['ldb.i'], include_dirs=['include'], - swig_opts=["-keyword"], + py_modules=["ldb"], + ext_modules=[Extension('_ldb', ['ldb_wrap.c'], include_dirs=['include'], library_dirs=["lib"], libraries=['ldb','ldap'])], ) -- cgit