]> git.proxmox.com Git - libtpms.git/blob - src/Makefile.am
Initial import of project
[libtpms.git] / src / Makefile.am
1 #
2 # src/Makefile.am
3 #
4 # For the license, see the LICENSE file in the root directory.
5 #
6
7 lib_LTLIBRARIES=libtpms.la
8
9 libtpms_la_LIBADD=
10
11 libtpms_la_LDFLAGS = -Wl,--version-script=./libtpms.syms \
12 -version-info $(LIBTPMS_VERSION_INFO)
13
14 libtpms_la_CFLAGS = -include tpm_library_conf.h -I$(top_srcdir)/include/libtpms
15
16 #Build 1.2 TPM
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
32
33 libtpms_la_CFLAGS += @DEBUG_DEFINES@
34
35 CRYPTO_OBJFILES =
36
37 libtpms_la_SOURCES = \
38 tpm_admin.c \
39 tpm_audit.c \
40 tpm_auth.c \
41 tpm_cryptoh.c \
42 tpm_counter.c \
43 tpm_daa.c \
44 tpm_debug.c \
45 tpm_delegate.c \
46 tpm_digest.c \
47 tpm_error.c \
48 tpm_global.c \
49 tpm_identity.c \
50 tpm_init.c \
51 tpm_libtpms_io.c \
52 tpm_key.c \
53 tpm_library.c \
54 tpm_load.c \
55 tpm_maint.c \
56 tpm_memory.c \
57 tpm_migration.c \
58 tpm_nonce.c \
59 tpm_nvfile.c \
60 tpm_nvram.c \
61 tpm_owner.c \
62 tpm_pcr.c \
63 tpm_permanent.c \
64 tpm_platform.c \
65 tpm_process.c \
66 tpm_secret.c \
67 tpm_session.c \
68 tpm_sizedbuffer.c \
69 tpm_startup.c \
70 tpm_store.c \
71 tpm_storage.c \
72 tpm_ticks.c \
73 tpm_time.c \
74 tpm_tis.c \
75 tpm_transport.c \
76 tpm_ver.c \
77 tpm_svnrevision.c
78
79 noinst_HEADERS = \
80 tpm_admin.h \
81 tpm_audit.h \
82 tpm_auth.h \
83 tpm_commands.h \
84 tpm_constants.h \
85 tpm_counter.h \
86 tpm_crypto.h \
87 tpm_cryptoh.h \
88 tpm_daa.h \
89 tpm_debug.h \
90 tpm_delegate.h \
91 tpm_digest.h \
92 tpm_global.h \
93 tpm_identity.h \
94 tpm_init.h \
95 tpm_io.h \
96 tpm_key.h \
97 tpm_library_conf.h \
98 tpm_library_intern.h \
99 tpm_load.h \
100 tpm_maint.h \
101 tpm_migration.h \
102 tpm_nonce.h \
103 tpm_nvfile.h \
104 tpm_nvram_const.h \
105 tpm_nvram.h \
106 tpm_owner.h \
107 tpm_pcr.h \
108 tpm_permanent.h \
109 tpm_platform.h \
110 tpm_process.h \
111 tpm_secret.h \
112 tpm_session.h \
113 tpm_sizedbuffer.h \
114 tpm_startup.h \
115 tpm_storage.h \
116 tpm_store.h \
117 tpm_structures.h \
118 tpm_svnrevision.h \
119 tpm_ticks.h \
120 tpm_time.h \
121 tpm_transport.h \
122 tpm_ver.h
123
124
125 if LIBTPMS_USE_FREEBL
126
127 libtpms_la_SOURCES += tpm_crypto_freebl.c
128 libtpms_la_LIBADD += -lfreebl -lgmp -lnspr4 -lnssutil3 -lnss3
129
130 #work-around broken freebl includes
131 libtpms_la_CFLAGS += $(shell [ ! -r /usr/include/nss3/alghmac.h ] && \
132 touch alghmac.h && \
133 echo -I./)
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)
138
139 else
140
141 if LIBTPMS_USE_OPENSSL
142
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)
147
148 endif # LIBTPMS_USE_OPENSSL
149
150 endif # LIBTPMS_USE_FREEBL
151
152 LDFLAGS_ARCH = $(findstring -m32, $(CFLAGS))
153 LDFLAGS_ARCH += $(findstring -m64, $(CFLAGS))
154 LDFLAGS_ARCH += $(findstring -m32, $(LDFLAGS))
155 LDFLAGS_ARCH += $(findstring -m64, $(LDFLAGS))
156
157 check-local:
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
162
163 EXTRA_DIST = \
164 tpm_crypto_freebl.c \
165 tpm_crypto.c \
166 libtpms.syms