]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tpm: express dependencies with Kconfig
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 23 Jan 2019 06:56:07 +0000 (14:56 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Mar 2019 20:45:53 +0000 (21:45 +0100)
This automatically removes the TPM backends from the
binary altogether if no front-ends are selected.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure
hw/tpm/Kconfig

index 6942b7bad4af255ecf4bd804a277fc87463db117..f9177dc479f9d55adbbd8ec28bea4e9c926990bc 100755 (executable)
--- a/configure
+++ b/configure
@@ -466,7 +466,7 @@ gcrypt_hmac="no"
 auth_pam=""
 vte=""
 virglrenderer=""
-tpm="yes"
+tpm=""
 libssh2=""
 live_block_migration="yes"
 numa=""
@@ -3877,20 +3877,20 @@ EOF
 fi
 
 ##########################################
-# TPM passthrough is only on x86 Linux
+# TPM emulation is only on POSIX
 
-if test "$targetos" = Linux && { test "$cpu" = i386 || test "$cpu" = x86_64; }; then
-  tpm_passthrough=$tpm
-else
-  tpm_passthrough=no
+if test "$tpm" = ""; then
+  if test "$mingw32" = "yes"; then
+    tpm=no
+  else
+    tpm=yes
+  fi
+elif test "$tpm" = "yes"; then
+  if test "$mingw32" = "yes" ; then
+    error_exit "TPM emulation only available on POSIX systems"
+  fi
 fi
 
-# TPM emulator is for all posix systems
-if test "$mingw32" != "yes"; then
-  tpm_emulator=$tpm
-else
-  tpm_emulator=no
-fi
 ##########################################
 # attr probe
 
index f654f0fbcec1b07cd3b9e7336e9fdcc931536330..4c8ee87d67483d31a2300d2c54a15cdf10890ef8 100644 (file)
@@ -1,16 +1,24 @@
-config TPM
+config TPMDEV
     bool
+    depends on TPM
 
 config TPM_TIS
     bool
     depends on TPM && ISA_BUS
+    select TPMDEV
 
 config TPM_CRB
     bool
     depends on TPM && PC
+    select TPMDEV
 
 config TPM_PASSTHROUGH
     bool
+    default y
+    # FIXME: should check for x86 host as well
+    depends on TPMDEV && LINUX
 
 config TPM_EMULATOR
     bool
+    default y
+    depends on TPMDEV