qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular


From: Michael Tokarev
Subject: [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
Date: Sun, 11 May 2014 17:07:00 +0400

nfs block module uses libnfs and uses pkg-config to determine
its build information.  Somehow it used only --libs, not --cflags,
and added those libs into global $LIBS, instead of using per-object
variable.

Use both --libs and --cflags, use them as per-object variable,
and finally make block/nfs.o to be modular.

Signed-off-by: Michael Tokarev <address@hidden>
---
 block/Makefile.objs |    2 ++
 configure           |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/Makefile.objs b/block/Makefile.objs
index fd88c03..38ddc0e 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -35,5 +35,7 @@ gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
 gluster.o-libs     := $(GLUSTERFS_LIBS)
 ssh.o-cflags       := $(LIBSSH2_CFLAGS)
 ssh.o-libs         := $(LIBSSH2_LIBS)
+nfs.o-cflags       := $(LIBNFS_CFLAGS)
+nfs.o-libs         := $(LIBNFS_LIBS)
 qcow.o-libs        := -lz
 linux-aio.o-libs   := -laio
diff --git a/configure b/configure
index ac2fa15..3bc91f6 100755
--- a/configure
+++ b/configure
@@ -3928,7 +3928,7 @@ if test "$libnfs" != "no" ; then
   if $pkg_config --atleast-version=1.9.3 libnfs; then
     libnfs="yes"
     libnfs_libs=$($pkg_config --libs libnfs)
-    LIBS="$LIBS $libnfs_libs"
+    libnfs_cflags=$($pkg_config --cflags libnfs)
   else
     if test "$libnfs" = "yes" ; then
       feature_not_found "libnfs"
@@ -4534,7 +4534,9 @@ if test "$libiscsi" = "yes" ; then
 fi
 
 if test "$libnfs" = "yes" ; then
-  echo "CONFIG_LIBNFS=y" >> $config_host_mak
+  echo "CONFIG_LIBNFS=m" >> $config_host_mak
+  echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
+  echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
 fi
 
 if test "$seccomp" = "yes"; then
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]