From patchwork Fri Jan 30 15:19:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 434948 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2DC341402CA for ; Sat, 31 Jan 2015 02:26:53 +1100 (AEDT) Received: from localhost ([::1]:37346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDT9-0000ey-CC for incoming@patchwork.ozlabs.org; Fri, 30 Jan 2015 10:26:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDN3-00072R-2f for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:20:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHDMt-0005FD-JV for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:20:33 -0500 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:57866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHDMt-0005F6-9K for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:20:23 -0500 Received: by mail-wi0-f170.google.com with SMTP id bs8so3580687wib.1 for ; Fri, 30 Jan 2015 07:20:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=pl0JxwwUTDsrPCPWMHFe9svDiiYnLKy3eNvH0JNzNdc=; b=VMZ+b/rF7Ia4aDCZMNflw1ohGP2slXpN2gYLb9Cfd/fxHJC0JalBfrXWOPMx7kBcMb wdIjehZbD1I7gtdo7oJwQmbf1RL9fy4oRtxTCkB2VWJ08wv1/UaopIdtJoZ8GW93YvPY pxEERsh6b23bzTqttEa69cSX7nUtI+9GTYJY1JFOe/OEGVthFIaA3pSdK8eqmFas+yw5 td/kOSdWJ4RJ4e5wZ61Zioz2b/nLXrZtAzQwQPoHmIAxOFWJYty48sye12ccQHLKGzYd eYFeB2y8f6k8/M2jAhQoK+0AFs2PZSRsPnpE4yNhA6Ltk9zjov+v2ow9ecIkCb77rqb1 Vk2w== X-Received: by 10.181.13.232 with SMTP id fb8mr5569122wid.69.1422631222760; Fri, 30 Jan 2015 07:20:22 -0800 (PST) Received: from playground.station (net-93-66-105-136.cust.vodafonedsl.it. [93.66.105.136]) by mx.google.com with ESMTPSA id n6sm15341184wjy.8.2015.01.30.07.20.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2015 07:20:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 30 Jan 2015 16:19:57 +0100 Message-Id: <1422631197-26063-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1422631197-26063-1-git-send-email-pbonzini@redhat.com> References: <1422631197-26063-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22a Cc: Fam Zheng Subject: [Qemu-devel] [PULL 11/11] configure: Default to enable module build 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 From: Fam Zheng 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 Signed-off-by: Paolo Bonzini --- .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