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 --- agent/Makefile.am | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'agent/Makefile.am') diff --git a/agent/Makefile.am b/agent/Makefile.am index 4fe74f539..3abdde4fc 100644 --- a/agent/Makefile.am +++ b/agent/Makefile.am @@ -51,12 +51,15 @@ gpg_agent_SOURCES = \ protect.c \ trustlist.c \ divert-scd.c \ - divert-tpm2.c \ - tpm2.c tpm2.h \ cvt-openpgp.c cvt-openpgp.h \ call-scd.c \ learncard.c +if HAVE_LIBTSS +gpg_agent_SOURCES += tpm2.c tpm2.h \ + divert-tpm2.c +endif + common_libs = $(libcommon) commonpth_libs = $(libcommonpth) if HAVE_W32CE_SYSTEM -- cgit v1.2.3