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 <abarc...@ac.upc.edu> --- 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 <ucontext.h> 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