Author: jelmer Date: 2008-01-10 15:36:35 +0000 (Thu, 10 Jan 2008) New Revision: 26701
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26701 Log: ldb: Build and install python modules when possible. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/lib/ldb/Makefile.in branches/SAMBA_4_0/source/lib/ldb/configure.ac Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/Makefile.in 2008-01-10 15:17:26 UTC (rev 26700) +++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in 2008-01-10 15:36:35 UTC (rev 26701) @@ -112,7 +112,8 @@ $(SOLIB): $(OBJS) $(SHLD) $(SHLD_FLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) $(TALLOC_LIBS) $(TDB_LIBS) $(LIBDL) $(LDAP_LIBS) @[EMAIL PROTECTED](SONAME) -all: showflags dirs $(OBJS) $(STATICLIB) $(SOLIB) $(BINS) $(EXAMPLES) manpages +all: showflags dirs $(OBJS) $(STATICLIB) $(SOLIB) $(BINS) $(EXAMPLES) manpages \ + @PYTHON_BUILD_TARGET@ showflags: @echo 'ldb will be compiled with flags:' @@ -212,12 +213,23 @@ installcheck: install test -install:: all +install:: all installdirs installheaders installlibs installbin installdoc \ + @PYTHON_INSTALL_TARGET@ + +installdirs: mkdir -p $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir)/pkgconfig + +installheaders: installdirs cp $(headers) $(DESTDIR)$(includedir) + +installlibs: installdirs cp $(STATICLIB) $(SOLIB) $(DESTDIR)$(libdir) + cp ldb.pc $(DESTDIR)$(libdir)/pkgconfig + +installbin: installdirs cp $(BINS) $(DESTDIR)$(bindir) - cp ldb.pc $(DESTDIR)$(libdir)/pkgconfig + +installdocs: installdirs $(srcdir)/docs/installdocs.sh $(DESTDIR)$(mandir) gcov: @@ -234,15 +246,17 @@ ctags: ctags `find $(srcdir) -name "*.[ch]"` -%_wrap.c %.py: %.i - $(SWIG) -O -Wall -python -keyword $< +.SUFFIXES: _wrap.c .i +.i_wrap.c: + [ "$(SWIG)" == "no" ] || $(SWIG) -O -Wall -python -keyword $< + # Python bindings -build-python: lib/libldb.$(SHLIBEXT) ldb_wrap.c ldb.py +build-python: lib/libldb.$(SHLIBEXT) ldb_wrap.c ./setup.py build install-python: build-python - ./setup.py install --prefix=$(prefix) + ./setup.py install --prefix=$(DESTDIR)$(prefix) install-swig: cp ldb.i `$(SWIG) -swiglib` Modified: branches/SAMBA_4_0/source/lib/ldb/configure.ac =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/configure.ac 2008-01-10 15:17:26 UTC (rev 26700) +++ branches/SAMBA_4_0/source/lib/ldb/configure.ac 2008-01-10 15:36:35 UTC (rev 26701) @@ -75,6 +75,19 @@ AC_LIBREPLACE_SHLD_FLAGS AC_LIBREPLACE_MDLD AC_LIBREPLACE_MDLD_FLAGS +AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR +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" +AC_SUBST(PYTHON_BUILD_TARGET) +AC_SUBST(PYTHON_INSTALL_TARGET) + +if test -z "$PYTHON_CONFIG"; then + PYTHON_BUILD_TARGET="" + PYTHON_INSTALL_TARGET="" +fi + m4_include(libldb.m4) AC_OUTPUT(Makefile ldb.pc)