From 06c0d7f28fa1842f9c52885b142a0d31ba60c8ae Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 6 Mar 2018 15:02:43 -0800 Subject: build: Make TPM2 support conditional * configure.ac (HAVE_LIBTSS): New acdefine and am_conditional. * agent/Makefile.am: (gpg_agent_SOURCES): Move tpm files to ... (gpg_agent_SOURCES) [HAVE_LIBTSS]: ... here. * agent/agent.h (divert_tpm2_pksign, divert_tpm2_pkdecrypt) (divert_tpm2_writekey) [!HAVE_LIBTSS]: Add stub functions. -- This adds a configure stanza to check for the necessary libtss to support TPM functions. If found, the library functions will be dynamically loaded, meaning that a system built with TPM2 support will still execute correctly (obviously minus TPM2 support) if installed without libtss being present. Signed-off-by: James Bottomley --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9dd9230c0..fe1078a00 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,7 @@ have_gnutls=no have_sqlite=no have_npth=no have_libusb=no +have_libtss=no have_system_resolver=no gnupg_have_ldap="n/a" @@ -1589,6 +1590,15 @@ fi AC_SUBST(NETLIBS) AC_SUBST(W32SOCKLIBS) +# +# TPM libtss library .. don't compile TPM support if we don't have it +# +AC_CHECK_LIB(tss, TSS_Create, [have_libtss=yes]) +if test "$have_libtss" = yes; then + AC_DEFINE(HAVE_LIBTSS, 1, [Defined if we have TPM2 support library]) +fi +AM_CONDITIONAL(HAVE_LIBTSS, test "$have_libtss" = yes) + # # Setup gcc specific options # @@ -2072,6 +2082,7 @@ echo " TLS support: $use_tls_library TOFU support: $use_tofu Tor support: $show_tor_support + TPM support: $have_libtss " if test x"$use_regex" != xyes ; then echo " -- cgit v1.2.3