qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, famz@redhat.com, mjt@tls.msk.ru,
	alex@alex.org.uk, mrezanin@redhat.com, vilanova@ac.upc.edu,
	rth@twiddle.net
Subject: [Qemu-devel] [PATCH v15 3/9] block: use per-object cflags and libs
Date: Mon, 13 Jan 2014 17:59:48 +0100	[thread overview]
Message-ID: <1389632394-10130-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1389632394-10130-1-git-send-email-pbonzini@redhat.com>

From: Fam Zheng <famz@redhat.com>

No longer adds flags and libs for them to global variables, instead
create config-host.mak variables like FOO_CFLAGS and FOO_LIBS, which is
used as per object cflags and libs.

This removes unwanted dependencies from libcacard.

Signed-off-by: Fam Zheng <famz@redhat.com>
[Split from Fam's patch to enable modules. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/Makefile.objs |   13 ++++++++++++-
 configure           |   25 ++++++++++---------------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/block/Makefile.objs b/block/Makefile.objs
index 4e8c91e..a1db63f 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -23,4 +23,15 @@ common-obj-y += commit.o
 common-obj-y += mirror.o
 common-obj-y += backup.o
 
-$(obj)/curl.o: QEMU_CFLAGS+=$(CURL_CFLAGS)
+iscsi.o-cflags     := $(LIBISCSI_CFLAGS)
+iscsi.o-libs       := $(LIBISCSI_LIBS)
+curl.o-cflags      := $(CURL_CFLAGS)
+curl.o-libs        := $(CURL_LIBS)
+rbd.o-cflags       := $(RBD_CFLAGS)
+rbd.o-libs         := $(RBD_LIBS)
+gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
+gluster.o-libs     := $(GLUSTERFS_LIBS)
+ssh.o-cflags       := $(LIBSSH2_CFLAGS)
+ssh.o-libs         := $(LIBSSH2_LIBS)
+qcow.o-libs        := -lz
+linux-aio.o-libs   := -laio
diff --git a/configure b/configure
index 4990648..9d71867 100755
--- a/configure
+++ b/configure
@@ -2303,8 +2303,6 @@ EOF
   curl_libs=`$curlconfig --libs 2>/dev/null`
   if compile_prog "$curl_cflags" "$curl_libs" ; then
     curl=yes
-    libs_tools="$curl_libs $libs_tools"
-    libs_softmmu="$curl_libs $libs_softmmu"
   else
     if test "$curl" = "yes" ; then
       feature_not_found "curl"
@@ -2460,8 +2458,6 @@ EOF
   rbd_libs="-lrbd -lrados"
   if compile_prog "" "$rbd_libs" ; then
     rbd=yes
-    libs_tools="$rbd_libs $libs_tools"
-    libs_softmmu="$rbd_libs $libs_softmmu"
   else
     if test "$rbd" = "yes" ; then
       feature_not_found "rados block device"
@@ -2478,9 +2474,6 @@ if test "$libssh2" != "no" ; then
     libssh2_cflags=`$pkg_config libssh2 --cflags`
     libssh2_libs=`$pkg_config libssh2 --libs`
     libssh2=yes
-    libs_tools="$libssh2_libs $libs_tools"
-    libs_softmmu="$libssh2_libs $libs_softmmu"
-    QEMU_CFLAGS="$QEMU_CFLAGS $libssh2_cflags"
   else
     if test "$libssh2" = "yes" ; then
       error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2"
@@ -2526,8 +2519,6 @@ int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); retu
 EOF
   if compile_prog "" "-laio" ; then
     linux_aio=yes
-    libs_softmmu="$libs_softmmu -laio"
-    libs_tools="$libs_tools -laio"
   else
     if test "$linux_aio" = "yes" ; then
       feature_not_found "linux AIO"
@@ -2696,9 +2687,6 @@ if test "$glusterfs" != "no" ; then
     glusterfs="yes"
     glusterfs_cflags=`$pkg_config --cflags glusterfs-api`
     glusterfs_libs=`$pkg_config --libs glusterfs-api`
-    CFLAGS="$CFLAGS $glusterfs_cflags"
-    libs_tools="$glusterfs_libs $libs_tools"
-    libs_softmmu="$glusterfs_libs $libs_softmmu"
     if $pkg_config --atleast-version=5 glusterfs-api; then
       glusterfs_discard="yes"
     fi
@@ -3066,11 +3054,9 @@ EOF
     libiscsi="yes"
     libiscsi_cflags=$($pkg_config --cflags libiscsi)
     libiscsi_libs=$($pkg_config --libs libiscsi)
-    CFLAGS="$CFLAGS $libiscsi_cflags"
-    LIBS="$LIBS $libiscsi_libs"
   elif compile_prog "" "-liscsi" ; then
     libiscsi="yes"
-    LIBS="$LIBS -liscsi"
+    libiscsi_libs="-liscsi"
   else
     if test "$libiscsi" = "yes" ; then
       feature_not_found "libiscsi"
@@ -4068,6 +4054,7 @@ fi
 if test "$curl" = "yes" ; then
   echo "CONFIG_CURL=y" >> $config_host_mak
   echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
+  echo "CURL_LIBS=$curl_libs" >> $config_host_mak
 fi
 if test "$brlapi" = "yes" ; then
   echo "CONFIG_BRLAPI=y" >> $config_host_mak
@@ -4160,6 +4147,8 @@ if test "$libiscsi" = "yes" ; then
   if test "$libiscsi_version" = "1.4.0"; then
     echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak
   fi
+  echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
+  echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
 fi
 
 if test "$seccomp" = "yes"; then
@@ -4181,6 +4170,8 @@ if test "$qom_cast_debug" = "yes" ; then
 fi
 if test "$rbd" = "yes" ; then
   echo "CONFIG_RBD=y" >> $config_host_mak
+  echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
+  echo "RBD_LIBS=$rbd_libs" >> $config_host_mak
 fi
 
 echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
@@ -4224,6 +4215,8 @@ fi
 
 if test "$glusterfs" = "yes" ; then
   echo "CONFIG_GLUSTERFS=y" >> $config_host_mak
+  echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak
+  echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak
 fi
 
 if test "$glusterfs_discard" = "yes" ; then
@@ -4232,6 +4225,8 @@ fi
 
 if test "$libssh2" = "yes" ; then
   echo "CONFIG_LIBSSH2=y" >> $config_host_mak
+  echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak
+  echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak
 fi
 
 if test "$virtio_blk_data_plane" = "yes" ; then
-- 
1.7.1

  parent reply	other threads:[~2014-01-13 17:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 16:59 [Qemu-devel] [PATCH v15 0/9] Shared library module support Paolo Bonzini
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 1/9] rules.mak: fix $(obj) to a real relative path Paolo Bonzini
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 2/9] rules.mak: allow per object cflags and libs Paolo Bonzini
2014-01-13 16:59 ` Paolo Bonzini [this message]
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 4/9] darwin: do not use -mdynamic-no-pic Paolo Bonzini
2014-01-13 22:11   ` Peter Maydell
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 5/9] build-sys: introduce common-obj-m and block-obj-m for DSO Paolo Bonzini
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 6/9] module: implement module loading Paolo Bonzini
2014-01-13 22:05   ` Peter Maydell
2014-01-14  3:21     ` Fam Zheng
2014-01-13 22:09   ` Peter Maydell
2014-01-14  3:18     ` Fam Zheng
2014-01-13 22:15   ` Richard Henderson
2014-01-14  3:06     ` Fam Zheng
2014-01-14 14:47       ` Richard Henderson
2014-01-14 15:19         ` Paolo Bonzini
2014-01-14 15:25           ` Peter Maydell
2014-01-14 15:31             ` Paolo Bonzini
2014-01-14 15:43               ` Richard Henderson
2014-01-14 15:47               ` Daniel P. Berrange
2014-01-14 15:45           ` Daniel P. Berrange
2014-01-15  8:28             ` Fam Zheng
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 7/9] Makefile: install modules with "make install" Paolo Bonzini
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 8/9] .gitignore: ignore module related files (dll, so, mo) Paolo Bonzini
2014-01-13 16:59 ` [Qemu-devel] [PATCH v15 9/9] block: convert block drivers linked with libs to modules Paolo Bonzini
2014-01-13 22:01 ` [Qemu-devel] [PATCH v15 0/9] Shared library module support Peter Maydell
2014-01-14  7:47   ` Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1389632394-10130-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=famz@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mrezanin@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).