4 # For the license, see the LICENSE file in the root directory.
7 lib_LTLIBRARIES=libtpms.la
11 libtpms_la_LDFLAGS = -Wl,--version-script=./libtpms.syms \
12 -version-info $(LIBTPMS_VERSION_INFO)
14 libtpms_la_CFLAGS = -include tpm_library_conf.h -I$(top_srcdir)/include/libtpms
17 libtpms_la_CFLAGS += -DTPM_V12
18 # build a PC Client TPM
19 libtpms_la_CFLAGS += -DTPM_PCCLIENT
20 # upon initialization have the TPM load the volatile state
21 libtpms_la_CFLAGS += -DTPM_VOLATILE_LOAD
22 # build the TPM enabled and activated
23 libtpms_la_CFLAGS += -DTPM_ENABLE_ACTIVATE
24 # build with AES support for symmetric crypto
25 libtpms_la_CFLAGS += -DTPM_AES
26 # build with libtpms callback support
27 libtpms_la_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
28 # let the default NVRAM write to disk
29 libtpms_la_CFLAGS += -DTPM_NV_DISK
30 # build a POSIX type of TPM
31 libtpms_la_CFLAGS += -DTPM_POSIX
33 libtpms_la_CFLAGS += @DEBUG_DEFINES@
37 libtpms_la_SOURCES = \
98 tpm_library_intern.h \
125 if LIBTPMS_USE_FREEBL
127 libtpms_la_SOURCES += tpm_crypto_freebl.c
128 libtpms_la_LIBADD += -lfreebl -lgmp -lnspr4 -lnssutil3 -lnss3
130 #work-around broken freebl includes
131 libtpms_la_CFLAGS += $(shell [ ! -r /usr/include/nss3/alghmac.h ] && \
134 # tpm_crypto_freebl.c: work around #include "blapi.h" : should be <nss3/blapi.h>
135 libtpms_la_CFLAGS += $(shell nss-config --cflags)
136 #including nss3/blapi.h requires a look into nspr4 dir
137 libtpms_la_CFLAGS += $(shell nspr-config --cflags)
141 if LIBTPMS_USE_OPENSSL
143 libtpms_la_SOURCES += tpm_crypto.c
144 libtpms_la_LIBADD += -lcrypto
145 libtpms_la_LDFLAGS += $(shell nspr-config --libs)
146 libtpms_la_CFLAGS += $(shell nspr-config --cflags)
148 endif # LIBTPMS_USE_OPENSSL
150 endif # LIBTPMS_USE_FREEBL
152 LDFLAGS_ARCH = $(findstring -m32, $(CFLAGS))
153 LDFLAGS_ARCH += $(findstring -m64, $(CFLAGS))
154 LDFLAGS_ARCH += $(findstring -m32, $(LDFLAGS))
155 LDFLAGS_ARCH += $(findstring -m64, $(LDFLAGS))
158 @($(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>/dev/null || \
159 (echo "There are undefined symbols in libtpms ($(LDFLAGS_ARCH))";\
160 $(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>&1 | grep libtpms))
161 @$(CC) $(LDFLAGS_ARCH) -nostdlib -L./.libs -ltpms 2>/dev/null
164 tpm_crypto_freebl.c \