1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

build: Allow selection of TSS library.

* configure.ac: New option --with-tss to force the use of a
specific TSS library.
--

While most systems will probably have only one of the two TPM
libraries that we support (the IBM TSS or the Intel TSS), it
would still be helpful to allow which one to use in the event
that both are detected, instead of always using the IBM one.

This patch does that by adding a --with-tss=TSS configure-time
option, where TSS can be "ibm", "intel", or "autodetect". The
default value is "autodetect", which triggers the original
behavior (i.e. try to detect both libraries, and prefer the IBM
one if both are found).

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
This commit is contained in:
Damien Goutte-Gattat via Gnupg-devel 2021-03-17 23:19:21 +00:00 committed by Werner Koch
parent 86f446fd44
commit 93c88d0af3
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -1594,14 +1594,30 @@ AC_SUBST(W32SOCKLIBS)
#
# TPM libtss library .. don't compile TPM support if we don't have it
#
AC_ARG_WITH([tss],
[AS_HELP_STRING([--with-tss=TSS],
[use the specified TPM Software Stack (ibm, intel, or autodetect)])],
[with_tss=$withval],
[with_tss=autodetect])
LIBTSS_LIBS=
LIBTSS_CFLAGS=
if test "$build_tpm2d" = "yes"; then
_save_libs="$LIBS"
_save_cflags="$CFLAGS"
LIBS=""
AC_SEARCH_LIBS([TSS_Create], [tss ibmtss],have_libtss=IBM,
AC_SEARCH_LIBS([Esys_Initialize], [tss2-esys],have_libtss=Intel))
if test "$with_tss" = autodetect; then
AC_SEARCH_LIBS([TSS_Create],[tss ibmtss],have_libtss=IBM,
AC_SEARCH_LIBS([Esys_Initialize],[tss2-esys],have_libtss=Intel,have_libtss=no))
elif test "$with_tss" = ibm; then
AC_SEARCH_LIBS([TSS_Create],[tss ibmtss],have_libtss=IBM,
[AC_MSG_ERROR([IBM TPM Software Stack requested but not found])])
elif test "$with_tss" = intel; then
AC_SEARCH_LIBS([Esys_Initialize],[tss2-esys],have_libtss=Intel,
[AC_MSG_ERROR([Intel TPM Software Stack requested but not found])])
else
AC_MSG_ERROR([Invalid TPM Software Stack requested: $with_tss])
fi
if test "$have_libtss" = IBM; then
LIBTSS_CFLAGS="-DTPM_POSIX"
CFLAGS="$CFLAGS ${LIBTSS_CFLAGS}"