summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tdb.mk
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/tdb/tdb.mk')
-rw-r--r--source4/lib/tdb/tdb.mk25
1 files changed, 15 insertions, 10 deletions
diff --git a/source4/lib/tdb/tdb.mk b/source4/lib/tdb/tdb.mk
index d6118dd38f..fe77a0492d 100644
--- a/source4/lib/tdb/tdb.mk
+++ b/source4/lib/tdb/tdb.mk
@@ -33,25 +33,32 @@ 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: $(tdbdir)/tdb_wrap.c
+ $(CC) -c $(tdbdir)/tdb_wrap.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)
-installpython:: build-python
- ./setup.py install --prefix=$(DESTDIR)$(prefix)
+install-python:: build-python
+ mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0, prefix='$(prefix)')"` \
+ $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
+ cp $(tdbdir)/tdb.py $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(0, prefix='$(prefix)')"`
+ cp _tdb.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(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)" $(PYTHON) $(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 +84,3 @@ libtdb.$(SHLIBEXT): $(SOLIB)
$(SONAME): $(SOLIB)
ln -fs $< $@
-
-