The check is simply for a POSIX system.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-tpm_ss = ss.source_set()
-
-tpm_ss.add(files('tpm_backend.c'))
-tpm_ss.add(files('tpm_util.c'))
-tpm_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough.c'))
-tpm_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c'))
-
-softmmu_ss.add_all(when: 'CONFIG_TPM', if_true: tpm_ss)
+if have_tpm
+ softmmu_ss.add(files('tpm_backend.c'))
+ softmmu_ss.add(files('tpm_util.c'))
+ softmmu_ss.add(when: 'CONFIG_TPM_PASSTHROUGH', if_true: files('tpm_passthrough.c'))
+ softmmu_ss.add(when: 'CONFIG_TPM_EMULATOR', if_true: files('tpm_emulator.c'))
+endif
coroutine_pool="$default_feature"
debug_stack_usage="no"
tls_priority="NORMAL"
-tpm="$default_feature"
live_block_migration=${default_feature:-yes}
replication=${default_feature:-yes}
bochs=${default_feature:-yes}
;;
--disable-pvrdma) pvrdma="no"
;;
- --disable-tpm) tpm="no"
- ;;
- --enable-tpm) tpm="yes"
- ;;
--disable-live-block-migration) live_block_migration="no"
;;
--enable-live-block-migration) live_block_migration="yes"
vhost-vdpa vhost-vdpa kernel backend support
live-block-migration Block migration in the main migration stream
coroutine-pool coroutine freelist (better performance)
- tpm TPM support
replication replication support
opengl opengl support
qom-cast-debug cast debugging support
fi
fi
-##########################################
-# TPM emulation is only on POSIX
-
-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
-
##########################################
# fdt probe
echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
fi
-if test "$tpm" = "yes"; then
- echo 'CONFIG_TPM=y' >> $config_host_mak
-fi
-
if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
variable::
host_kconfig = \
- ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \
+ (have_tpm ? ['CONFIG_TPM=y'] : []) + \
('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
...
acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c'))
acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c'))
acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
-acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
+if have_tpm
+ acpi_ss.add(files('tpm.c'))
+endif
softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c'))
softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss)
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c',
.require(targetos == 'linux', error_message: 'Multiprocess QEMU is supported only on Linux') \
.allowed()
+have_tpm = get_option('tpm') \
+ .require(targetos != 'windows', error_message: 'TPM emulation only available on POSIX systems') \
+ .allowed()
+
# Target-specific libraries and flags
libm = cc.find_library('m', required: false)
threads = dependency('threads')
config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
config_host_data.set('CONFIG_SECCOMP', seccomp.found())
config_host_data.set('CONFIG_SNAPPY', snappy.found())
+config_host_data.set('CONFIG_TPM', have_tpm)
config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
config_host_data.set('CONFIG_VDE', vde.found())
config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
host_kconfig = \
(get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
- ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \
+ (have_tpm ? ['CONFIG_TPM=y'] : []) + \
(spice.found() ? ['CONFIG_SPICE=y'] : []) + \
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=y'] : []) + \
endif
summary_info += {'seccomp support': seccomp}
summary_info += {'GlusterFS support': glusterfs}
-summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
+summary_info += {'TPM support': have_tpm}
summary_info += {'libssh support': libssh}
summary_info += {'lzo support': lzo}
summary_info += {'snappy support': snappy}
description: 'Out of process device emulation support')
option('dbus_display', type: 'feature', value: 'auto',
description: '-display dbus support')
+option('tpm', type : 'feature', value : 'auto',
+ description: 'TPM support')
# Do not enable it by default even for Mingw32, because it doesn't
# work on Wine.
printf "%s\n" ' spice Spice server support'
printf "%s\n" ' spice-protocol Spice protocol support'
printf "%s\n" ' tcg TCG support'
+ printf "%s\n" ' tpm TPM support'
printf "%s\n" ' u2f U2F emulation support'
printf "%s\n" ' usb-redir libusbredir support'
printf "%s\n" ' vde vde network backend support'
--disable-tcg) printf "%s" -Dtcg=disabled ;;
--enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=true ;;
--disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=false ;;
+ --enable-tpm) printf "%s" -Dtpm=enabled ;;
+ --disable-tpm) printf "%s" -Dtpm=disabled ;;
--enable-trace-backends=*) quote_sh "-Dtrace_backends=$2" ;;
--enable-u2f) printf "%s" -Du2f=enabled ;;
--disable-u2f) printf "%s" -Du2f=disabled ;;
'qdev-monitor.c',
), sdl, libpmem, libdaxctl)
-softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
+if have_tpm
+ softmmu_ss.add(files('tpm.c'))
+endif
+
softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
softmmu_ss.add(when: fdt, if_true: files('device_tree.c'))