From: Steve Muir Date: Tue, 1 Nov 2005 21:54:00 +0000 (+0000) Subject: Use new pybuild scheme that works with libtool X-Git-Tag: after-util-vserver-0_30_208-revert~79 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=73708328b2f53205367df5499d2b898b4e92203b;p=util-vserver.git Use new pybuild scheme that works with libtool --- diff --git a/python/.cvsignore b/python/.cvsignore new file mode 100644 index 0000000..9ca26d6 --- /dev/null +++ b/python/.cvsignore @@ -0,0 +1,2 @@ +.prep-done +build diff --git a/python/Makefile b/python/Makefile index 7ae69d7..cf2b468 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,53 +1,36 @@ # # GNUMakefile for util-vserver Python bindings # -# It's too hard to integrate distutils into the autoconf/libtool -# framework, so run this Makefile separately from and after the normal -# util-vserver build. -# # Steve Muir # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id: Makefile,v 1.7 2005/08/26 04:00:44 mlhuang Exp $ +# $Id: Makefile,v 1.8 2005/08/27 17:38:57 mlhuang Exp $ # -ALL := vserverimpl.so vduimpl.so util_vserver_vars.py +INCLUDES := -I.. -I../lib +LIBS = -L../lib -lvserver + +PY_MODS := vserver.py cpulimit.py bwlimit.py +PY_EXT_MODS := vduimpl.so vserverimpl.so + +LT_LINK = ../libtool --tag=CC --mode=link + + -# need command substitution -SHELL := /bin/bash +all: py-build -pythonlibdir := @libdir@/python@PYTHON_VERSION@/site-packages +# XXX - compatibility with util-vserver specfile +INSTALL_ROOT ?= $(DESTDIR) -all: $(ALL) +install: py-install -%.o: %.c - # builds object and incompletely linked library - python setup.py build_ext - # copy to current directory - cp -a build/temp.*/*.o . +clean: py-clean -vserverimpl.so vduimpl.so: %.so: %.o - # relink the object against libvserver with libtool - ../libtool --tag=CC --mode=link $(CC) -shared -o $@ $< ../lib/libvserver.la -util_vserver_vars.py: ../scripts/util-vserver-vars - # python does not export variables beginning with underscore - (. $< ; \ - while read var ; do eval echo $$var=\$${$$var} ; done < \ - <(sed -ne "s/\([^=]*\)=.*/\1/p" $<) \ - | sed -e "s/^_*//" -e "s/\([^=]*\)=\(.*\)/\1='\2'/") > $@ -install: $(ALL) - # install relinked libraries and byte-compiled scripts - python setup.py install --root="$(DESTDIR)" - # reinstall libraries with libtool so that the final path - # to libvserver is resolved - for so in $(filter %.so, $(ALL)) ; do \ - ../libtool --tag=CC --mode=install install "$$so" `find "$(DESTDIR)" -name "$$so"` ; \ - done +UTIL_PYTHON = ../../util-python -clean: - rm -rf $(ALL) *.o build +-include $(UTIL_PYTHON)/pybuild.mk .PHONY: all install clean