mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Introduce python binding for libxl. The binding is not yet complete but serveral methods are implemented and tested. Those which are implemented provide examples of the two or three basic patterns that most future methods should follow. Over 5,000 lines of boilerplate is automatically generated to wrap and export all relevant libxl structure definitions. There are a few places where such code cannot be fully auto-generated and special hooks are declared and stubbed where, for example, conversion between libxl_file_reference and a python file object is required. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
138 lines
5.4 KiB
Python
138 lines
5.4 KiB
Python
|
|
from distutils.core import setup, Extension
|
|
import os
|
|
|
|
XEN_ROOT = "../.."
|
|
|
|
extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ]
|
|
|
|
include_dirs = [ XEN_ROOT + "/tools/libxc",
|
|
XEN_ROOT + "/tools/xenstore",
|
|
XEN_ROOT + "/tools/include",
|
|
XEN_ROOT + "/tools/libxl",
|
|
]
|
|
|
|
library_dirs = [ XEN_ROOT + "/tools/libxc",
|
|
XEN_ROOT + "/tools/xenstore",
|
|
XEN_ROOT + "/tools/libxl",
|
|
XEN_ROOT + "/tools/blktap2/control",
|
|
]
|
|
|
|
libraries = [ "xenctrl", "xenguest", "xenstore" ]
|
|
|
|
plat = os.uname()[0]
|
|
if plat == 'Linux':
|
|
uuid_libs = ["uuid"]
|
|
else:
|
|
uuid_libs = []
|
|
|
|
xc = Extension("xc",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/xc" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "xen/lowlevel/xc/xc.c" ])
|
|
|
|
xs = Extension("xs",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/xs" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "xen/lowlevel/xs/xs.c" ])
|
|
|
|
scf = Extension("scf",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/scf" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "xen/lowlevel/scf/scf.c" ])
|
|
|
|
process = Extension("process",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/process" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries + [ "contract" ],
|
|
sources = [ "xen/lowlevel/process/process.c" ])
|
|
|
|
acm = Extension("acm",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/acm" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "xen/lowlevel/acm/acm.c" ])
|
|
|
|
flask = Extension("flask",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/flask" ] +
|
|
[ "../flask/libflask/include" ],
|
|
library_dirs = library_dirs + [ "../flask/libflask" ],
|
|
libraries = libraries + [ "flask" ],
|
|
sources = [ "xen/lowlevel/flask/flask.c" ])
|
|
|
|
ptsname = Extension("ptsname",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "ptsname" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "ptsname/ptsname.c" ])
|
|
|
|
checkpoint = Extension("checkpoint",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs,
|
|
library_dirs = library_dirs,
|
|
libraries = libraries + [ "rt" ],
|
|
sources = [ "xen/lowlevel/checkpoint/checkpoint.c",
|
|
"xen/lowlevel/checkpoint/libcheckpoint.c"])
|
|
|
|
netlink = Extension("netlink",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs,
|
|
library_dirs = library_dirs,
|
|
libraries = libraries,
|
|
sources = [ "xen/lowlevel/netlink/netlink.c",
|
|
"xen/lowlevel/netlink/libnetlink.c"])
|
|
|
|
xl = Extension("xl",
|
|
extra_compile_args = extra_compile_args,
|
|
include_dirs = include_dirs + [ "xen/lowlevel/xl" ],
|
|
library_dirs = library_dirs,
|
|
libraries = libraries + ["xenlight", "blktapctl" ] + uuid_libs,
|
|
sources = [ "xen/lowlevel/xl/xl.c", "xen/lowlevel/xl/_pyxl_types.c" ])
|
|
|
|
modules = [ xc, xs, ptsname, acm, flask, xl ]
|
|
if plat == 'SunOS':
|
|
modules.extend([ scf, process ])
|
|
if plat == 'Linux':
|
|
modules.extend([ checkpoint, netlink ])
|
|
|
|
setup(name = 'xen',
|
|
version = '3.0',
|
|
description = 'Xen',
|
|
packages = ['xen',
|
|
'xen.lowlevel',
|
|
'xen.util',
|
|
'xen.util.xsm',
|
|
'xen.util.xsm.dummy',
|
|
'xen.util.xsm.flask',
|
|
'xen.util.xsm.acm',
|
|
'xen.xend',
|
|
'xen.xend.server',
|
|
'xen.xend.xenstore',
|
|
'xen.xm',
|
|
'xen.web',
|
|
'xen.sv',
|
|
'xen.xsview',
|
|
'xen.remus',
|
|
|
|
'xen.xend.tests',
|
|
'xen.xend.server.tests',
|
|
'xen.xend.xenstore.tests',
|
|
'xen.xm.tests'
|
|
],
|
|
ext_package = "xen.lowlevel",
|
|
ext_modules = modules
|
|
)
|
|
|
|
os.chdir('logging')
|
|
execfile('setup.py')
|