From patchwork Fri Jan 30 15:01:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 434921 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 5D2691402A3 for ; Sat, 31 Jan 2015 02:04:26 +1100 (AEDT) Received: from localhost ([::1]:37163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHD7Q-00087x-1J for incoming@patchwork.ozlabs.org; Fri, 30 Jan 2015 10:04:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHD4w-0003eT-IB for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:01:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHD4u-0005eq-4s for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:01:50 -0500 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]:50175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHD4t-0005ek-PR for qemu-devel@nongnu.org; Fri, 30 Jan 2015 10:01:48 -0500 Received: by mail-we0-f172.google.com with SMTP id q59so27586347wes.3 for ; Fri, 30 Jan 2015 07:01:47 -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=YXoItFfRAnko3+VIxv510Xi7yidRwqKWBsl90pPNsKsvWV2errAzJJg6rakZk1axLz Ew09wH72w/cOPFAMrcAVhAzOJVylRAOwRYP0sZS7RA8F0Z8gcMqg1J38BJ0AmrwAsdE2 tuWdkZbSIpNDKX5/lChm5cWrb3Un5WO+vj+yOUl2OF0PgK/V/3SwT6ES2VuTLDmy8xXk 1WhaV61cDU1/z92tqP7efIw7Ap9rlAB9CKPljA6tlwyHJutigM457/A+S139DNlcUN6d OQ/JoDfFhQ8dqmkN8A2aTbrU99cbEWscvx2r4itA6uDjnRXs8ibbBamsE6SiDzfzyuUh Opeg== X-Received: by 10.180.89.210 with SMTP id bq18mr5616907wib.45.1422630107148; Fri, 30 Jan 2015 07:01:47 -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 q10sm15273370wjr.41.2015.01.30.07.01.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2015 07:01:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 30 Jan 2015 16:01:18 +0100 Message-Id: <1422630078-18704-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1422630078-18704-1-git-send-email-pbonzini@redhat.com> References: <1422630078-18704-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:c03::22c 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