mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-17 00:59:36 +03:00
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
This commit is contained in:
committed by
Daniel P. Berrange
parent
3878fbd548
commit
766f7433f0
16
setup.py
16
setup.py
@ -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'
|
||||
},
|
||||
|
Reference in New Issue
Block a user