mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Manually compile python files rather than using setup.py.
This commit is contained in:
parent
35c8ebdca2
commit
94dfeb5e89
@ -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::
|
||||
|
@ -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)
|
||||
|
@ -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'])],
|
||||
)
|
@ -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 $< $@
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user