summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdb/Makefile.in5
-rw-r--r--source4/lib/tdb/configure.ac4
-rwxr-xr-xsource4/lib/tdb/setup.py11
-rw-r--r--source4/lib/tdb/tdb.mk18
4 files changed, 18 insertions, 20 deletions
diff --git a/source4/lib/tdb/Makefile.in b/source4/lib/tdb/Makefile.in
index 9730dffe60..f900469afa 100644
--- a/source4/lib/tdb/Makefile.in
+++ b/source4/lib/tdb/Makefile.in
@@ -22,8 +22,11 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PICFLAG = @PICFLAG@
SHLIBEXT = @SHLIBEXT@
SWIG = swig
+PYTHON_CONFIG = @PYTHON_CONFIG@
PYTHON_BUILD_TARGET = @PYTHON_BUILD_TARGET@
PYTHON_INSTALL_TARGET = @PYTHON_INSTALL_TARGET@
+PYTHON_CHECK_TARGET = @PYTHON_CHECK_TARGET@
+LIB_PATH_VAR = @LIB_PATH_VAR@
tdbdir = @tdbdir@
TDB_OBJ = @TDB_OBJ@ @LIBREPLACEOBJ@
@@ -39,7 +42,7 @@ $(SOLIB): $(TDB_OBJ)
check: test
-test::
+test:: $(PYTHON_CHECK_TARGET)
installcheck:: test install
clean::
diff --git a/source4/lib/tdb/configure.ac b/source4/lib/tdb/configure.ac
index 5747107f38..36d409ac11 100644
--- a/source4/lib/tdb/configure.ac
+++ b/source4/lib/tdb/configure.ac
@@ -11,15 +11,19 @@ AC_LD_PICFLAG
AC_LD_SHLIBEXT
AC_LIBREPLACE_SHLD
AC_LIBREPLACE_SHLD_FLAGS
+AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
m4_include(libtdb.m4)
AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
PYTHON_BUILD_TARGET="build-python"
PYTHON_INSTALL_TARGET="install-python"
+PYTHON_CHECK_TARGET="check-python"
AC_SUBST(PYTHON_BUILD_TARGET)
AC_SUBST(PYTHON_INSTALL_TARGET)
+AC_SUBST(PYTHON_CHECK_TARGET)
if test -z "$PYTHON_CONFIG"; then
PYTHON_BUILD_TARGET=""
PYTHON_INSTALL_TARGET=""
+ PYTHON_CHECK_TARGET=""
fi
AC_OUTPUT(Makefile tdb.pc)
diff --git a/source4/lib/tdb/setup.py b/source4/lib/tdb/setup.py
deleted file mode 100755
index 8be0c67e0b..0000000000
--- a/source4/lib/tdb/setup.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/python
-from distutils.core import setup
-from distutils.extension import Extension
-
-setup(name='tdb',
- version='1.0',
- url="http://tdb.samba.org/",
- py_modules=["tdb"],
- ext_modules=[Extension('_tdb', ['tdb_wrap.c'], include_dirs=['include'],
- library_dirs=["."], libraries=['tdb'])],
-)
diff --git a/source4/lib/tdb/tdb.mk b/source4/lib/tdb/tdb.mk
index d6118dd38f..10b7c6a92d 100644
--- a/source4/lib/tdb/tdb.mk
+++ b/source4/lib/tdb/tdb.mk
@@ -33,8 +33,13 @@ clean::
rm -f $(SONAME) $(SOLIB) libtdb.a libtdb.$(SHLIBEXT)
rm -f $(ALL_PROGS) tdb.pc
-build-python:: libtdb.$(SHLIBEXT) tdb_wrap.c
- $(tdbdir)/setup.py build
+build-python:: _tdb.$(SHLIBEXT)
+
+tdb_wrap.o: tdb_wrap.c
+ $(CC) -c $< $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
+
+_tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) tdb_wrap.o
+ $(SHLD) $(SHLD_FLAGS) -o $@ tdb_wrap.o -L. -ltdb `$(PYTHON_CONFIG) --libs`
install:: installdirs installbin installheaders installlibs \
$(PYTHON_INSTALL_TARGET)
@@ -43,15 +48,14 @@ installpython:: build-python
./setup.py install --prefix=$(DESTDIR)$(prefix)
check-python:: build-python
- # FIXME: Should be more portable:
- LD_LIBRARY_PATH=. PYTHONPATH=.:build/lib.linux-i686-2.4 trial python/tests/simple.py
+ $(LIB_PATH_VAR)=. PYTHONPATH=".:$(tdbdir)" trial $(tdbdir)/python/tests/simple.py
install-swig::
mkdir -p $(DESTDIR)`$(SWIG) -swiglib`
cp tdb.i $(DESTDIR)`$(SWIG) -swiglib`
-clean-python::
- ./setup.py clean
+clean::
+ rm -f _tdb.$(SHLIBEXT)
installdirs::
mkdir -p $(DESTDIR)$(bindir)
@@ -77,5 +81,3 @@ libtdb.$(SHLIBEXT): $(SOLIB)
$(SONAME): $(SOLIB)
ln -fs $< $@
-
-