Skip to content

Allow disabling the pthread support check #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion TPMCmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,21 @@ libplatform = Platform/src/libplatform.a
libtpm = tpm/src/libtpm.a
tpm2_simulator = Simulator/src/tpm2-simulator

bin_PROGRAMS = $(tpm2_simulator)
noinst_LIBRARIES = $(libplatform) $(libtpm)

Platform_src_libplatform_a_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) $(TPM_INC)
Platform_src_libplatform_a_SOURCES = $(PLATFORM_C) $(PLATFORM_H)

if HAVE_PTHREAD
bin_PROGRAMS = $(tpm2_simulator)
Simulator_src_tpm2_simulator_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \
$(TPM_INC) $(SIMULATOR_INC) $(LIBCRYPTO_CFLAGS) $(PTHREAD_CFLAGS)
# the weird / duplicate static library is necessary for dealing with the
# circular dependency beetween libplatform and libtpm
Simulator_src_tpm2_simulator_LDADD = $(libplatform) $(libtpm) \
$(libplatform) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) @ADDITIONAL_LIBS@
Simulator_src_tpm2_simulator_SOURCES = $(SIMULATOR_C) $(SIMULATOR_H)
endif

tpm_src_libtpm_a_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) $(TPM_INC) \
$(LIBCRYPTO_CFLAGS)
Expand Down
9 changes: 8 additions & 1 deletion TPMCmd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ AS_IF([test "x$enable_usedeviceid" = "xyes"], [
PKG_CHECK_MODULES([LIBUDEV], [libudev])
[ADDITIONAL_LIBS="-ludev"]
])
AX_PTHREAD([], [AC_MSG_ERROR([requires pthread])])

AC_ARG_ENABLE([pthread],
[AS_HELP_STRING([--disable-pthread], [Disable pthread support (tpm simulator will not be built, but only the libraries)])],
[use_pthread=$enableval], [use_pthread=yes])
AS_IF([test "x$use_pthread" = "xyes"],
[AX_PTHREAD([], [AC_MSG_ERROR([requires pthread])])],
[AC_MSG_NOTICE([pthread support disabled])])
AM_CONDITIONAL([HAVE_PTHREAD], [test "x$use_pthread" = "xyes"])

AC_DEFINE([HASH_LIB], [Ossl], [Crypto lib for hash algorithms])
AC_DEFINE([SYM_LIB], [Ossl], [Crypto lib for symmetric encryption algorithms])
Expand Down