From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Alex Barcelo From: Alex Barcelo Date: Mon, 13 Feb 2012 15:42:29 +0100 Message-Id: <1329144150-7720-3-git-send-email-abarcelo@ac.upc.edu> In-Reply-To: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> References: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> Subject: [Qemu-devel] [PATCH 2/3] coroutine: adding control flags (enable/disable) for ucontext compilation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Alex Barcelo 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" -- 1.7.5.4