[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Make vm-top and the xenstat perl and python bindings conditional based on configuration variables from Config.mk, rather than disabling them if the needed headers are not found.



# HG changeset patch
# User josht@xxxxxxxxxx
# Node ID 59328ad2a7d43fb4a77b7ca23240776d8cfd87c4
# Parent  6893bc5cc2258499d334fd56e7f607b50b87d5e5
Make vm-top and the xenstat perl and python bindings conditional based on 
configuration variables from Config.mk, rather than disabling them if the 
needed headers are not found.

diff -r 6893bc5cc225 -r 59328ad2a7d4 Config.mk
--- a/Config.mk Fri Aug 12 18:36:54 2005
+++ b/Config.mk Sat Aug 13 00:44:00 2005
@@ -35,3 +35,8 @@
 
 # Choose the best mirror to download linux kernel
 KERNEL_REPO = http://www.kernel.org
+
+# Optional components
+XENSTAT_PERL_BINDINGS   ?= n
+XENSTAT_PYTHON_BINDINGS ?= y
+XENSTAT_VM_TOP          ?= y
diff -r 6893bc5cc225 -r 59328ad2a7d4 tools/xenstat/libxenstat/Makefile
--- a/tools/xenstat/libxenstat/Makefile Fri Aug 12 18:36:54 2005
+++ b/tools/xenstat/libxenstat/Makefile Sat Aug 13 00:44:00 2005
@@ -42,8 +42,6 @@
 CFLAGS+=-I$(LINUX_ROOT)/include/asm-xen/linux-public/
 LDFLAGS+=-Lsrc
 
-# Note that the bindings are not built by default, because they require a
-# number of external dependencies.
 all: $(LIB) $(LINKS)
 
 $(LIB): $(OBJECTS)
@@ -81,12 +79,16 @@
 BINDINGSRC=$(PYSRC) $(PERLSRC)
 
 # The all-bindings target builds all the language bindings
-all-bindings: $(BINDINGS)
+all-bindings: perl-bindings python-bindings
+
+# The install-bindings target installs all the language bindings
+install-bindings: install-perl-bindings install-python-bindings
 
 $(BINDINGS): $(LIB) $(LINKS) src/xenstat.h
 
 SWIG_FLAGS=-module xenstat -Isrc
 
+# Python bindings
 PYTHON_VERSION=2.3
 PYTHON_FLAGS=-I/usr/include/python$(PYTHON_VERSION) -lpython$(PYTHON_VERSION)
 $(PYSRC) $(PYMOD): bindings/swig/xenstat.i
@@ -95,6 +97,19 @@
 $(PYLIB): $(PYSRC)
        $(CC) $(CFLAGS) $(LDFLAGS) $(PYTHON_FLAGS) -shared -lxenstat -o $@ $<
 
+python-bindings: $(PYLIB) $(PYMOD)
+
+pythonlibdir=$(prefix)/lib/python$(PYTHON_VERSION)/site-packages
+install-python-bindings: $(PYLIB) $(PYMOD)
+       $(INSTALL_PROG) $(PYLIB) $(DESTDIR)$(pythonlibdir)/_xenstat.so
+       $(INSTALL_PROG) $(PYMOD) $(DESTDIR)$(pythonlibdir)/xenstat.py
+
+ifeq ($(XENSTAT_PYTHON_BINDINGS),y)
+all: python-bindings
+install: install-python-bindings
+endif
+
+# Perl bindings
 PERL_FLAGS=`perl -MConfig -e 'print "$$Config{ccflags} 
-I$$Config{archlib}/CORE";'`
 $(PERLSRC) $(PERLMOD): bindings/swig/xenstat.i
        swig -perl $(SWIG_FLAGS) -outdir $(@D) -o $(PERLSRC) $<
@@ -102,19 +117,18 @@
 $(PERLLIB): $(PERLSRC)
        $(CC) $(CFLAGS) $(LDFLAGS) $(PERL_FLAGS) -shared -lxenstat -o $@ $<
 
-# The install-bindings target installs all the language bindings
-install-bindings: install-perl-bindings install-python-bindings
+perl-bindings: $(PERLLIB) $(PERLMOD)
 
-pythonlibdir=$(prefix)/lib/python$(PYTHON_VERSION)/site-packages
-install-python-bindings: $(PYLIB) $(PYMOD)
-       $(INSTALL_PROG) $(PYLIB) $(pythonlibdir)/_xenstat.so
-       $(INSTALL_PROG) $(PYMOD) $(pythonlibdir)/xenstat.py
+perllibdir=$(prefix)/lib/perl5
+perlmoddir=$(prefix)/share/perl5
+install-perl-bindings: $(PERLLIB) $(PERLMOD)
+       $(INSTALL_PROG) $(PERLLIB) $(DESTDIR)$(perllibdir)/xenstat.so
+       $(INSTALL_PROG) $(PERLMOD) $(DESTDIR)$(perlmoddir)/xenstat.pm
 
-perllibdir=$(prefix)/lib/site_perl
-perlmoddir=$(prefix)/lib/site_perl
-install-perl-bindings: $(PERLLIB) $(PERLMOD)
-       $(INSTALL_PROG) $(PERLLIB) $(perllibdir)/xenstat.so
-       $(INSTALL_PROG) $(PERLMOD) $(perlmoddir)/xenstat.pm
+ifeq ($(XENSTAT_PERL_BINDINGS),y)
+all: perl-bindings
+install: install-perl-bindings
+endif
 
 clean:
        rm -f $(LIB) $(OBJECTS) $(LINKS) $(BINDINGS) $(BINDINGSRC)
diff -r 6893bc5cc225 -r 59328ad2a7d4 tools/xenstat/vm-top/Makefile
--- a/tools/xenstat/vm-top/Makefile     Fri Aug 12 18:36:54 2005
+++ b/tools/xenstat/vm-top/Makefile     Sat Aug 13 00:44:00 2005
@@ -10,15 +10,12 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-ifneq (,$(shell [ -e /usr/include/curses.h ] || echo no))
-all vm-top:
-       @echo "***********************************************************"
-       @echo "WARNING: Install ncurses to build vm-top."
-       @echo "***********************************************************"
-else
-
 XEN_ROOT=../../..
 include $(XEN_ROOT)/tools/Rules.mk
+
+ifneq ($(XENSTAT_VM_TOP),y)
+all install vm-top:
+else
 
 INSTALL         = install
 INSTALL_PROG    = $(INSTALL) -m0755 -D
@@ -36,12 +33,11 @@
 
 vm-top: vm-top.o
 
+install: vm-top vm-top.1
+       $(INSTALL_PROG) vm-top $(DESTDIR)$(sbindir)/vm-top
+       $(INSTALL_DATA) vm-top.1 $(DESTDIR)$(man1dir)/vm-top.1
+
 endif
-
-install: vm-top vm-top.1
-       [ -f vm-top ] && $(INSTALL_PROG) vm-top $(DESTDIR)$(sbindir)/vm-top
-       [ -f vm-top.1 ] && \
-           $(INSTALL_DATA) vm-top.1 $(DESTDIR)$(man1dir)/vm-top.1
 
 clean:
        rm -f vm-top vm-top.o

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.