summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Denemark <jdenemar@redhat.com>2016-01-18 14:54:10 +0100
committerJiri Denemark <jdenemar@redhat.com>2016-01-18 15:41:13 +0100
commita265fddf5d70ce28e544146f271cee667a9b797e (patch)
tree9d86457b1223944c99b9b74d66d765531e94bdcf
parenta0f43200916e6d108db210f8cc778aa741aa0c08 (diff)
downloadlibvirt-python-a265fddf5d70ce28e544146f271cee667a9b797e.tar.gz
setup: Use cflags and ldflags properly
The setup.py script reads cflags and ldflags from pkg-config and uses them when compiling/linking C modules. Since both cflags and ldflags may include multiple compiler arguments we need to split them rather than concatenating them into a single argument. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
-rwxr-xr-xsetup.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index 9bf583b..c44f84a 100755
--- a/setup.py
+++ b/setup.py
@@ -88,17 +88,15 @@ def get_module_lists():
c_modules = []
py_modules = []
- ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False)
- cflags = get_pkgconfig_data(["--cflags"], "libvirt", False)
+ ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False).split()
+ cflags = get_pkgconfig_data(["--cflags"], "libvirt", False).split()
module = Extension('libvirtmod',
sources = ['libvirt-override.c', 'build/libvirt.c', 'typewrappers.c', 'libvirt-utils.c'],
libraries = [ "virt" ],
include_dirs = [ "." ])
- if cflags != "":
- module.extra_compile_args.append(cflags)
- if ldflags != "":
- module.extra_link_args.append(ldflags)
+ module.extra_compile_args.extend(cflags)
+ module.extra_link_args.extend(ldflags)
c_modules.append(module)
py_modules.append("libvirt")
@@ -107,10 +105,8 @@ def get_module_lists():
sources = ['libvirt-qemu-override.c', 'build/libvirt-qemu.c', 'typewrappers.c', 'libvirt-utils.c'],
libraries = [ "virt-qemu" ],
include_dirs = [ "." ])
- if cflags != "":
- moduleqemu.extra_compile_args.append(cflags)
- if ldflags != "":
- moduleqemu.extra_link_args.append(ldflags)
+ moduleqemu.extra_compile_args.extend(cflags)
+ moduleqemu.extra_link_args.extend(ldflags)
c_modules.append(moduleqemu)
py_modules.append("libvirt_qemu")
@@ -120,10 +116,8 @@ def get_module_lists():
sources = ['libvirt-lxc-override.c', 'build/libvirt-lxc.c', 'typewrappers.c', 'libvirt-utils.c'],
libraries = [ "virt-lxc" ],
include_dirs = [ "." ])
- if cflags != "":
- modulelxc.extra_compile_args.append(cflags)
- if ldflags != "":
- modulelxc.extra_link_args.append(ldflags)
+ modulelxc.extra_compile_args.extend(cflags)
+ modulelxc.extra_link_args.extend(ldflags)
c_modules.append(modulelxc)
py_modules.append("libvirt_lxc")