buildsys: Move seccomp cflags/libs to per object
authorFam Zheng <famz@redhat.com>
Thu, 7 Sep 2017 08:53:16 +0000 (16:53 +0800)
committerEduardo Otubo <otubo@redhat.com>
Fri, 15 Sep 2017 08:16:05 +0000 (10:16 +0200)
Like many other libraries, libseccomp cflags and libs should only apply
to the building of necessary objects. Do so in the usual way with the
help of per object variables.

Signed-off-by: Fam Zheng <famz@redhat.com>
Makefile.objs
configure

index 24a4ea08b829af8fed60e6f8f5734929df332980..d9cf7ad79195e5e3371c4601844bdd2a370749b1 100644 (file)
@@ -70,6 +70,8 @@ common-obj-y += backends/
 common-obj-y += chardev/
 
 common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
+qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
+qemu-seccomp.o-libs := $(SECCOMP_LIBS)
 
 common-obj-$(CONFIG_FDT) += device_tree.o
 
index 9ee4559b54449a859b4a487e17ab76e42325f40b..94db2d103e8e994552d6ca1e4310584a89aa0fd3 100755 (executable)
--- a/configure
+++ b/configure
@@ -2035,8 +2035,8 @@ if test "$seccomp" != "no" ; then
 
     if test "$libseccomp_minver" != "" &&
        $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then
-        libs_softmmu="$libs_softmmu $($pkg_config --libs libseccomp)"
-        QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags libseccomp)"
+        seccomp_cflags="$($pkg_config --cflags libseccomp)"
+        seccomp_libs="$($pkg_config --libs libseccomp)"
         seccomp="yes"
     else
         if test "$seccomp" = "yes" ; then
@@ -5829,6 +5829,8 @@ fi
 
 if test "$seccomp" = "yes"; then
   echo "CONFIG_SECCOMP=y" >> $config_host_mak
+  echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
+  echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak
 fi
 
 # XXX: suppress that