Commit 766f7433 authored by Doug Goldstein's avatar Doug Goldstein Committed by Daniel P. Berrange

Create array of modules to be built

Create an array of modules to be built to allow for flexibility to
enable or disable some modules in the future and allow for additional
modules to be added easily
parent 3878fbd5
......@@ -52,6 +52,9 @@ def get_pkgconfig_data(args, mod, required=True):
ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False)
cflags = get_pkgconfig_data(["--cflags"], "libvirt", False)
c_modules = []
py_modules = []
module = Extension('libvirtmod',
sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'],
libraries = [ "virt" ],
......@@ -61,6 +64,8 @@ if cflags != "":
if ldflags != "":
module.extra_link_args.append(ldflags)
c_modules.append(module)
py_modules.append("libvirt")
moduleqemu = Extension('libvirtmod_qemu',
sources = ['libvirt-qemu-override.c', 'build/libvirt-qemu.c', 'typewrappers.c', 'libvirt-utils.c'],
......@@ -71,6 +76,9 @@ if cflags != "":
if ldflags != "":
moduleqemu.extra_link_args.append(ldflags)
c_modules.append(moduleqemu)
py_modules.append("libvirt_qemu")
modulelxc = Extension('libvirtmod_lxc',
sources = ['libvirt-lxc-override.c', 'build/libvirt-lxc.c', 'typewrappers.c', 'libvirt-utils.c'],
libraries = [ "virt-lxc" ],
......@@ -80,6 +88,10 @@ if cflags != "":
if ldflags != "":
modulelxc.extra_link_args.append(ldflags)
c_modules.append(modulelxc)
py_modules.append("libvirt_lxc")
class my_build(build):
def get_api_xml_files(self):
......@@ -258,8 +270,8 @@ setup(name = 'libvirt-python',
maintainer = 'Libvirt Maintainers',
maintainer_email = 'libvir-list@redhat.com',
description = 'The libvirt virtualization API',
ext_modules = [module, modulelxc, moduleqemu],
py_modules = ["libvirt", "libvirt_qemu", "libvirt_lxc"],
ext_modules = c_modules,
py_modules = py_modules,
package_dir = {
'': 'build'
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment