[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v12 8/8] block: convert block drivers linked with li
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v12 8/8] block: convert block drivers linked with libs to modules |
Date: |
Thu, 10 Oct 2013 19:26:16 +0800 |
The converted block drivers are:
curl
iscsi
rbd
ssh
glusterfs
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 <address@hidden>
---
block/Makefile.objs | 11 ++++++++++-
configure | 33 +++++++++++++++------------------
2 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 3bb85b5..f98d379 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -23,4 +23,13 @@ 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)
diff --git a/configure b/configure
index dd901ab..fab75ad 100755
--- a/configure
+++ b/configure
@@ -2257,8 +2257,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"
@@ -2418,8 +2416,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"
@@ -2436,9 +2432,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"
@@ -2654,9 +2647,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
@@ -3024,11 +3014,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"
@@ -4016,8 +4004,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
@@ -4106,7 +4095,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
@@ -4127,7 +4118,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
@@ -4170,7 +4163,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
@@ -4178,7 +4173,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
--
1.8.3.1
- [Qemu-devel] [PATCH v12 2/8] make.rule: fix $(obj) to a real relative path, (continued)
- [Qemu-devel] [PATCH v12 2/8] make.rule: fix $(obj) to a real relative path, Fam Zheng, 2013/10/10
- [Qemu-devel] [PATCH v12 3/8] rule.mak: allow per object cflags and libs, Fam Zheng, 2013/10/10
- [Qemu-devel] [PATCH v12 4/8] build-sys: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2013/10/10
- [Qemu-devel] [PATCH v12 6/8] Makefile: install modules with "make install", Fam Zheng, 2013/10/10
- [Qemu-devel] [PATCH v12 5/8] module: implement module loading, Fam Zheng, 2013/10/10
[Qemu-devel] [PATCH v12 7/8] .gitignore: ignore module related files (dll, so, mo), Fam Zheng, 2013/10/10
[Qemu-devel] [PATCH v12 8/8] block: convert block drivers linked with libs to modules,
Fam Zheng <=
Re: [Qemu-devel] [PATCH v12 0/8] Shared Library Module Support, Paolo Bonzini, 2013/10/10