From patchwork Mon Feb 13 14:42:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Barcelo X-Patchwork-Id: 140912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0F7F1B6FBA for ; Tue, 14 Feb 2012 01:43:31 +1100 (EST) Received: from localhost ([::1]:39094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwx7p-0001Wn-01 for incoming@patchwork.ozlabs.org; Mon, 13 Feb 2012 09:43:29 -0500 Received: from eggs.gnu.org ([140.186.70.92]:37563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwx7Q-00018C-TZ for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:43:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwx7M-0004ru-7D for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:43:04 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:55821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwx7M-0004rh-2Z for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:43:00 -0500 Received: by eekd17 with SMTP id d17so1948234eek.4 for ; Mon, 13 Feb 2012 06:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=OFzNjmxkzVIIK5HjZBdT1+dp9NlQLyq61W0N2n5D3l0=; b=YdO0CJLtSLytT6sgSaR278HP8f31p5hgfN0fpZP+Sxem/6ZFf9hz4wsrPp2dtANOtR Ju76xFS+uPTZikYghqwlbaRkof6kDK1fK0LH8ySdfMd8O/zrg7NRkhe4rhqccK0WPtiX kbK4yoC2HeJxwu6aoVDeZA2oxe660Mi7pbYjw= Received: by 10.14.125.3 with SMTP id y3mr1549741eeh.9.1329144179090; Mon, 13 Feb 2012 06:42:59 -0800 (PST) Received: from localhost.localdomain (62.57.1.36.dyn.user.ono.com. [62.57.1.36]) by mx.google.com with ESMTPS id n52sm2314827eea.5.2012.02.13.06.42.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Feb 2012 06:42:58 -0800 (PST) From: Alex Barcelo To: qemu-devel@nongnu.org Date: Mon, 13 Feb 2012 15:42:29 +0100 Message-Id: <1329144150-7720-3-git-send-email-abarcelo@ac.upc.edu> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> References: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.45 Cc: Kevin Wolf , Alex Barcelo Subject: [Qemu-devel] [PATCH 2/3] coroutine: adding control flags (enable/disable) for ucontext compilation 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 Configure tries, as a default, ucontext functions for the coroutines. But now the user can force its use or disable it at all (enable and disable flags) Signed-off-by: Alex Barcelo --- configure | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 763db24..ed40da8 100755 --- a/configure +++ b/configure @@ -190,6 +190,7 @@ opengl="" zlib="yes" guest_agent="yes" libiscsi="" +ucontext="" # parse CC options first for opt do @@ -798,6 +799,10 @@ for opt do ;; --disable-guest-agent) guest_agent="no" ;; + --enable-ucontext) ucontext="yes" + ;; + --disable-ucontext) ucontext="no" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -1084,6 +1089,8 @@ echo " --disable-usb-redir disable usb network redirection support" echo " --enable-usb-redir enable usb network redirection support" echo " --disable-guest-agent disable building of the QEMU Guest Agent" echo " --enable-guest-agent enable building of the QEMU Guest Agent" +echo " --disable-ucontext disable ucontext functions for coroutines" +echo " --enable-ucontext enable ucontext functions for coroutines" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 @@ -2717,13 +2724,23 @@ fi # check if we have makecontext ucontext_coroutine=no -if test "$darwin" != "yes"; then - cat > $TMPC << EOF +if test "$ucontext" != "no"; then + if test "$darwin" != "yes"; then + cat > $TMPC << EOF #include int main(void) { makecontext(0, 0, 0); return 0; } EOF - if compile_prog "" "" ; then - ucontext_coroutine=yes + if compile_prog "" "" ; then + ucontext_coroutine=yes + elif test "$ucontext" = "yes" ; then + echo + echo "Error: ucontext check failed" + echo "Make sure that ucontext.h and its funcionts are supported" + echo + exit 1 + fi + else + echo "Silently ignoring ucontext coroutine method under darwin" fi fi @@ -2918,6 +2935,7 @@ echo "usb net redir $usb_redir" echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" +echo "ucontext coroutine support $ucontext_coroutine" if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support"