From patchwork Wed Oct 16 03:26:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 283833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1CEFB2C00BE for ; Wed, 16 Oct 2013 14:29:25 +1100 (EST) Received: from localhost ([::1]:45191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWHnX-0003FP-7m for incoming@patchwork.ozlabs.org; Tue, 15 Oct 2013 23:29:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWHmS-0001vp-Ik for qemu-devel@nongnu.org; Tue, 15 Oct 2013 23:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWHmM-0008RH-7e for qemu-devel@nongnu.org; Tue, 15 Oct 2013 23:28:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWHmL-0008RA-VS for qemu-devel@nongnu.org; Tue, 15 Oct 2013 23:28:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9G3S1oX003327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Oct 2013 23:28:01 -0400 Received: from T430s.nay.redhat.com (vpn1-5-39.sin2.redhat.com [10.67.5.39]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9G3QoDF031222; Tue, 15 Oct 2013 23:27:54 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 16 Oct 2013 11:26:48 +0800 Message-Id: <1381894008-29164-9-git-send-email-famz@redhat.com> In-Reply-To: <1381894008-29164-1-git-send-email-famz@redhat.com> References: <1381894008-29164-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, peter.maydell@linaro.org, stefanha@redhat.com, mjt@tls.msk.ru, xiawenc@linux.vnet.ibm.com, alex@alex.org.uk, pbonzini@redhat.com, vilanova@ac.upc.edu, rth@twiddle.net Subject: [Qemu-devel] [PATCH v14 8/8] block: convert block drivers linked with libs to modules X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The converted block drivers are: curl iscsi rbd ssh glusterfs together with object specific flags and libs change of: qcow linux-aio 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. Signed-off-by: Fam Zheng build: Add object specific link flags. qcow.o and linux-aio.o has their own library dependencies for building, add them to keep ld happy. Signed-off-by: Fam Zheng --- block/Makefile.objs | 13 ++++++++++++- configure | 33 +++++++++++++++------------------ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/block/Makefile.objs b/block/Makefile.objs index 3bb85b5..4b25902 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 5b09d9d..4592f7f 100755 --- a/configure +++ b/configure @@ -2251,8 +2251,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" @@ -2412,8 +2410,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" @@ -2430,9 +2426,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" @@ -2648,9 +2641,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 @@ -3018,11 +3008,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" @@ -4010,8 +3998,9 @@ if test "$bswap_h" = "yes" ; then echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak fi if test "$curl" = "yes" ; then - echo "CONFIG_CURL=y" >> $config_host_mak + echo "CONFIG_CURL=m" >> $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 @@ -4100,7 +4089,9 @@ if test "$glx" = "yes" ; then fi if test "$libiscsi" = "yes" ; then - echo "CONFIG_LIBISCSI=y" >> $config_host_mak + echo "CONFIG_LIBISCSI=m" >> $config_host_mak + echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak + echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak fi if test "$seccomp" = "yes"; then @@ -4121,7 +4112,9 @@ if test "$qom_cast_debug" = "yes" ; then echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak fi if test "$rbd" = "yes" ; then - echo "CONFIG_RBD=y" >> $config_host_mak + echo "CONFIG_RBD=m" >> $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 @@ -4164,7 +4157,9 @@ if test "$getauxval" = "yes" ; then fi if test "$glusterfs" = "yes" ; then - echo "CONFIG_GLUSTERFS=y" >> $config_host_mak + echo "CONFIG_GLUSTERFS=m" >> $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 @@ -4172,7 +4167,9 @@ if test "$glusterfs_discard" = "yes" ; then fi if test "$libssh2" = "yes" ; then - echo "CONFIG_LIBSSH2=y" >> $config_host_mak + echo "CONFIG_LIBSSH2=m" >> $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