diff mbox series

[1/3] configure: Do not build TCG if not necessary

Message ID 20210120151916.1167448-2-philmd@redhat.com
State New
Headers show
Series configure: Do not build TCG or link with capstone if not necessary | expand

Commit Message

Philippe Mathieu-Daudé Jan. 20, 2021, 3:19 p.m. UTC
We don't want to check/build TCG when no system/user emulation
is requested. This is useful in particular when building only:
 - tools
 - documentation

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 configure | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 9f016b06b54..012c527e3cd 100755
--- a/configure
+++ b/configure
@@ -337,7 +337,7 @@  linux_io_uring="$default_feature"
 cap_ng="auto"
 attr="auto"
 xfs="$default_feature"
-tcg="enabled"
+tcg="auto"
 membarrier="$default_feature"
 vhost_net="$default_feature"
 vhost_crypto="$default_feature"
@@ -2282,6 +2282,15 @@  case " $target_list " in
   ;;
 esac
 
+if [ "$tcg" = "auto" ]; then
+    # if neither system nor user emulation requested, no need to build TCG
+    if [ "$softmmu" = "no" ] && [ "$linux_user" = "no" ] && [ "$bsd_user" = "no" ]; then
+        tcg="disabled"
+    else
+        tcg="enabled"
+    fi
+fi
+
 feature_not_found() {
   feature=$1
   remedy=$2