From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <famz@redhat.com>
Subject: [Qemu-devel] [PULL 11/11] configure: Default to enable module build
Date: Fri, 30 Jan 2015 16:01:18 +0100 [thread overview]
Message-ID: <1422630078-18704-12-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1422630078-18704-1-git-send-email-pbonzini@redhat.com>
From: Fam Zheng <famz@redhat.com>
We have module build support around for a while, but also had it bitrot
several times. It probably makes sense to enable it by default so that
people can notice and use it.
Add --disable-modules as a counterpart to --enable-modules, which is
now turned on by default. If both are omitted, support is guessed as
usual.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
.travis.yml | 2 +-
configure | 95 ++++++++++++++++++++++++++++++++++++++++++-------------------
2 files changed, 67 insertions(+), 30 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0ac170b..12bf1db 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -99,5 +99,5 @@ matrix:
EXTRA_CONFIG="--enable-trace-backends=ust"
compiler: gcc
- env: TARGETS=i386-softmmu,x86_64-softmmu
- EXTRA_CONFIG="--enable-modules"
+ EXTRA_CONFIG="--disable-modules"
compiler: gcc
diff --git a/configure b/configure
index f185dd0..2c3a444 100755
--- a/configure
+++ b/configure
@@ -271,7 +271,7 @@ gcov_tool="gcov"
EXESUF=""
DSOSUF=".so"
LDFLAGS_SHARED="-shared"
-modules="no"
+modules=""
prefix="/usr/local"
mandir="\${prefix}/share/man"
datadir="\${prefix}/share"
@@ -768,6 +768,9 @@ for opt do
--enable-modules)
modules="yes"
;;
+ --disable-modules)
+ modules="no"
+ ;;
--cpu=*)
;;
--target-list=*) target_list="$optarg"
@@ -1259,7 +1262,8 @@ Advanced options (experts only):
--sysconfdir=PATH install config in PATH$confsuffix
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
- --enable-modules enable modules support
+ --enable-modules enable modules support (default)
+ --disable-modules enable modules support
--enable-debug-tcg enable TCG debugging
--disable-debug-tcg disable TCG debugging (default)
--enable-debug-info enable debugging information (default)
@@ -2725,22 +2729,25 @@ if test "$mingw32" = yes; then
else
glib_req_ver=2.12
fi
-glib_modules=gthread-2.0
-if test "$modules" = yes; then
- glib_modules="$glib_modules gmodule-2.0"
-fi
-for i in $glib_modules; do
- if $pkg_config --atleast-version=$glib_req_ver $i; then
- glib_cflags=`$pkg_config --cflags $i`
- glib_libs=`$pkg_config --libs $i`
- CFLAGS="$glib_cflags $CFLAGS"
- LIBS="$glib_libs $LIBS"
- libs_qga="$glib_libs $libs_qga"
- else
- error_exit "glib-$glib_req_ver $i is required to compile QEMU"
- fi
-done
+glib_pkg_config()
+{
+ if $pkg_config --atleast-version=$glib_req_ver $1; then
+ local probe_cflags=$($pkg_config --cflags $1)
+ local probe_libs=$($pkg_config --libs $1)
+ CFLAGS="$probe_cflags $CFLAGS"
+ LIBS="$probe_libs $LIBS"
+ libs_qga="$probe_libs $libs_qga"
+ glib_cflags="$probe_cflags $glib_cflags"
+ glib_libs="$probe_libs $glib_libs"
+ return 0
+ else
+ return 1
+ fi
+}
+
+glib_pkg_config gthread-2.0 || \
+ error_exit "glib-$glib_req_ver gthread-2.0 is required to compile QEMU"
# g_test_trap_subprocess added in 2.38. Used by some tests.
glib_subprocess=yes
@@ -2749,19 +2756,49 @@ if ! $pkg_config --atleast-version=2.38 glib-2.0; then
fi
##########################################
-# SHA command probe for modules
-if test "$modules" = yes; then
- shacmd_probe="sha1sum sha1 shasum"
- for c in $shacmd_probe; do
- if has $c; then
- shacmd="$c"
- break
- fi
- done
- if test "$shacmd" = ""; then
- error_exit "one of the checksum commands is required to enable modules: $shacmd_probe"
+# SHA command and gmodule-2.0 probe for modules
+# return 0 if probe succeeds
+# $1: true - force mode, exit if probe fail
+# false - optoinal mode, return 1 if probe fail
+module_try_enable()
+{
+ force=$1
+ shacmd_probe="sha1sum sha1 shasum"
+ for c in $shacmd_probe; do
+ if has $c; then
+ shacmd="$c"
+ break
fi
-fi
+ done
+ if test "$shacmd" = ""; then
+ if $force; then
+ error_exit "one of the checksum commands is required to enable modules: $shacmd_probe"
+ else
+ modules="no"
+ return
+ fi
+ fi
+ if ! glib_pkg_config gmodule-2.0; then
+ if $force; then
+ error_exit "glib-$glib_req_ver gmodule-2.0 is required to compile QEMU"
+ else
+ modules="no"
+ return
+ fi
+ fi
+ modules="yes"
+}
+
+case "$modules" in
+ yes)
+ module_try_enable true
+ ;;
+ "")
+ module_try_enable false
+ ;;
+ no)
+ ;;
+esac
##########################################
# pixman support probe
--
1.8.3.1
next prev parent reply other threads:[~2015-01-30 15:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 15:01 [Qemu-devel] [PULL 00/11] RCU, scsi, modules, icount changes for 2015-01-30 Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 01/11] rcu: add rcu library Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 02/11] rcu: add rcutorture Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 03/11] rcu: allow nesting of rcu_read_lock/rcu_read_unlock Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 04/11] rcu: add call_rcu Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 05/11] memory: remove assertion on memory_region_destroy Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 06/11] memory: protect current_map by RCU Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 07/11] memory: avoid ref/unref in memory_region_find Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 08/11] cpu-exec: simplify align_clocks Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 09/11] cpu-exec: simplify init_delay_params Paolo Bonzini
2015-01-30 15:01 ` [Qemu-devel] [PULL 10/11] scsi: Fix scsi_req_cancel_async for no aiocb req Paolo Bonzini
2015-01-30 15:01 ` Paolo Bonzini [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-01-30 15:19 [Qemu-devel] [PULL 00/11] RCU, scsi, modules, icount changes for 2015-01-30 Paolo Bonzini
2015-01-30 15:19 ` [Qemu-devel] [PULL 11/11] configure: Default to enable module build Paolo Bonzini
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=1422630078-18704-12-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).