8b6aa8bbd93527e08a0ed08412baf43da8908aed
[strongswan.git] / src / libstrongswan / Makefile.am
1 lib_LTLIBRARIES = libstrongswan.la
2
3 libstrongswan_la_SOURCES = \
4 library.c library.h \
5 chunk.c chunk.h \
6 debug.c debug.h \
7 enum.c enum.h \
8 settings.h settings.c \
9 printf_hook.c printf_hook.h \
10 asn1/asn1.c asn1/asn1.h \
11 asn1/asn1_parser.c asn1/asn1_parser.h \
12 asn1/oid.c asn1/oid.h \
13 crypto/crypters/crypter.c crypto/crypters/crypter.h \
14 crypto/hashers/hasher.h crypto/hashers/hasher.c \
15 crypto/pkcs9.c crypto/pkcs9.h \
16 crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords.h \
17 crypto/prfs/prf.c crypto/prfs/prf.h \
18 crypto/rngs/rng.c crypto/rngs/rng.h \
19 crypto/prf_plus.h crypto/prf_plus.c \
20 crypto/signers/signer.c crypto/signers/signer.h \
21 crypto/crypto_factory.c crypto/crypto_factory.h \
22 crypto/crypto_tester.c crypto/crypto_tester.h \
23 crypto/diffie_hellman.c crypto/diffie_hellman.h \
24 crypto/transform.c crypto/transform.h \
25 credentials/credential_factory.c credentials/credential_factory.h \
26 credentials/builder.c credentials/builder.h \
27 credentials/cred_encoding.c credentials/cred_encoding.h \
28 credentials/keys/private_key.c credentials/keys/private_key.h \
29 credentials/keys/public_key.c credentials/keys/public_key.h \
30 credentials/keys/shared_key.c credentials/keys/shared_key.h \
31 credentials/certificates/certificate.c credentials/certificates/certificate.h \
32 credentials/certificates/x509.h credentials/certificates/x509.c \
33 credentials/certificates/ac.h \
34 credentials/certificates/crl.h credentials/certificates/crl.c \
35 credentials/certificates/pkcs10.h \
36 credentials/certificates/ocsp_request.h \
37 credentials/certificates/ocsp_response.h credentials/certificates/ocsp_response.c \
38 credentials/certificates/pgp_certificate.h \
39 credentials/ietf_attributes/ietf_attributes.c credentials/ietf_attributes/ietf_attributes.h \
40 credentials/credential_manager.c credentials/credential_manager.h \
41 credentials/sets/auth_cfg_wrapper.c credentials/sets/auth_cfg_wrapper.h \
42 credentials/sets/ocsp_response_wrapper.c credentials/sets/ocsp_response_wrapper.h \
43 credentials/sets/cert_cache.c credentials/sets/cert_cache.h \
44 credentials/sets/mem_cred.c credentials/sets/mem_cred.h \
45 credentials/sets/callback_cred.c credentials/sets/callback_cred.h \
46 credentials/auth_cfg.c credentials/auth_cfg.h credentials/credential_set.h \
47 credentials/cert_validator.h \
48 database/database.h database/database_factory.h database/database_factory.c \
49 fetcher/fetcher.h fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
50 selectors/traffic_selector.c selectors/traffic_selector.h \
51 threading/thread.h threading/thread.c \
52 threading/thread_value.h threading/thread_value.c \
53 threading/mutex.h threading/mutex.c threading/condvar.h  \
54 threading/rwlock.h threading/rwlock.c \
55 threading/lock_profiler.h \
56 utils.h utils.c \
57 utils/host.c utils/host.h \
58 utils/identification.c utils/identification.h \
59 utils/iterator.h \
60 utils/lexparser.c utils/lexparser.h \
61 utils/linked_list.c utils/linked_list.h \
62 utils/hashtable.c utils/hashtable.h \
63 utils/enumerator.c utils/enumerator.h \
64 utils/optionsfrom.c utils/optionsfrom.h \
65 utils/backtrace.c utils/backtrace.h \
66 plugins/plugin_loader.c plugins/plugin_loader.h plugins/plugin.h
67
68 libstrongswan_la_LIBADD = $(PTHREADLIB) $(DLLIB) $(BTLIB) $(SOCKLIB) $(RTLIB)
69
70 INCLUDES = -I$(top_srcdir)/src/libstrongswan
71 AM_CFLAGS = \
72 -DIPSEC_DIR=\"${ipsecdir}\" \
73 -DPLUGINDIR=\"${plugindir}\" \
74 -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
75
76 if USE_LEAK_DETECTIVE
77   AM_CFLAGS += -DLEAK_DETECTIVE
78   libstrongswan_la_SOURCES += \
79     utils/leak_detective.c utils/leak_detective.h
80 endif
81
82 if USE_LOCK_PROFILER
83   AM_CFLAGS += -DLOCK_PROFILER
84 endif
85
86 if USE_INTEGRITY_TEST
87   AM_CFLAGS += -DINTEGRITY_TEST
88   libstrongswan_la_SOURCES += \
89     integrity_checker.c integrity_checker.h
90 endif
91
92 if USE_VSTR
93   libstrongswan_la_LIBADD += -lvstr
94 endif
95
96 EXTRA_DIST = \
97 asn1/oid.txt asn1/oid.pl \
98 crypto/proposal/proposal_keywords.txt \
99 Android.mk AndroidConfigLocal.h
100
101 BUILT_SOURCES = \
102 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
103 $(srcdir)/crypto/proposal/proposal_keywords.c
104
105 MAINTAINERCLEANFILES = \
106 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
107 $(srcdir)/crypto/proposal/proposal_keywords.c
108
109 $(srcdir)/asn1/oid.c :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
110                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
111
112 $(srcdir)/asn1/oid.h :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
113                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
114
115 $(srcdir)/crypto/proposal/proposal_keywords.c:  $(srcdir)/crypto/proposal/proposal_keywords.txt \
116                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords.h
117                 $(GPERF) -N proposal_get_token -m 10 -C -G -c -t -D < \
118                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords.txt > $@
119
120
121 # build plugins with their own Makefile
122 #######################################
123
124 if MONOLITHIC
125 SUBDIRS =
126 else
127 SUBDIRS = .
128 endif
129
130 if USE_AES
131   SUBDIRS += plugins/aes
132 if MONOLITHIC
133   libstrongswan_la_LIBADD += plugins/aes/libstrongswan-aes.la
134 endif
135 endif
136
137 if USE_DES
138   SUBDIRS += plugins/des
139 if MONOLITHIC
140   libstrongswan_la_LIBADD += plugins/des/libstrongswan-des.la
141 endif
142 endif
143
144 if USE_BLOWFISH
145   SUBDIRS += plugins/blowfish
146 if MONOLITHIC
147   libstrongswan_la_LIBADD += plugins/blowfish/libstrongswan-blowfish.la
148 endif
149 endif
150
151 if USE_MD4
152   SUBDIRS += plugins/md4
153 if MONOLITHIC
154   libstrongswan_la_LIBADD += plugins/md4/libstrongswan-md4.la
155 endif
156 endif
157
158 if USE_MD5
159   SUBDIRS += plugins/md5
160 if MONOLITHIC
161   libstrongswan_la_LIBADD += plugins/md5/libstrongswan-md5.la
162 endif
163 endif
164
165 if USE_SHA1
166   SUBDIRS += plugins/sha1
167 if MONOLITHIC
168   libstrongswan_la_LIBADD += plugins/sha1/libstrongswan-sha1.la
169 endif
170 endif
171
172 if USE_SHA2
173   SUBDIRS += plugins/sha2
174 if MONOLITHIC
175   libstrongswan_la_LIBADD += plugins/sha2/libstrongswan-sha2.la
176 endif
177 endif
178
179 if USE_GMP
180   SUBDIRS += plugins/gmp
181 if MONOLITHIC
182   libstrongswan_la_LIBADD += plugins/gmp/libstrongswan-gmp.la
183 endif
184 endif
185
186 if USE_RANDOM
187   SUBDIRS += plugins/random
188 if MONOLITHIC
189   libstrongswan_la_LIBADD += plugins/random/libstrongswan-random.la
190 endif
191 endif
192
193 if USE_HMAC
194   SUBDIRS += plugins/hmac
195 if MONOLITHIC
196   libstrongswan_la_LIBADD += plugins/hmac/libstrongswan-hmac.la
197 endif
198 endif
199
200 if USE_XCBC
201   SUBDIRS += plugins/xcbc
202 if MONOLITHIC
203   libstrongswan_la_LIBADD += plugins/xcbc/libstrongswan-xcbc.la
204 endif
205 endif
206
207 if USE_X509
208   SUBDIRS += plugins/x509
209 if MONOLITHIC
210   libstrongswan_la_LIBADD += plugins/x509/libstrongswan-x509.la
211 endif
212 endif
213
214 if USE_REVOCATION
215   SUBDIRS += plugins/revocation
216 if MONOLITHIC
217   libstrongswan_la_LIBADD += plugins/revocation/libstrongswan-revocation.la
218 endif
219 endif
220
221 if USE_PUBKEY
222   SUBDIRS += plugins/pubkey
223 if MONOLITHIC
224   libstrongswan_la_LIBADD += plugins/pubkey/libstrongswan-pubkey.la
225 endif
226 endif
227
228 if USE_PKCS1
229   SUBDIRS += plugins/pkcs1
230 if MONOLITHIC
231   libstrongswan_la_LIBADD += plugins/pkcs1/libstrongswan-pkcs1.la
232 endif
233 endif
234
235 if USE_PGP
236   SUBDIRS += plugins/pgp
237 if MONOLITHIC
238   libstrongswan_la_LIBADD += plugins/pgp/libstrongswan-pgp.la
239 endif
240 endif
241
242 if USE_DNSKEY
243   SUBDIRS += plugins/dnskey
244 if MONOLITHIC
245   libstrongswan_la_LIBADD += plugins/dnskey/libstrongswan-dnskey.la
246 endif
247 endif
248
249 if USE_PEM
250   SUBDIRS += plugins/pem
251 if MONOLITHIC
252   libstrongswan_la_LIBADD += plugins/pem/libstrongswan-pem.la
253 endif
254 endif
255
256 if USE_CURL
257   SUBDIRS += plugins/curl
258 if MONOLITHIC
259   libstrongswan_la_LIBADD += plugins/curl/libstrongswan-curl.la
260 endif
261 endif
262
263 if USE_LDAP
264   SUBDIRS += plugins/ldap
265 if MONOLITHIC
266   libstrongswan_la_LIBADD += plugins/ldap/libstrongswan-ldap.la
267 endif
268 endif
269
270 if USE_MYSQL
271   SUBDIRS += plugins/mysql
272 if MONOLITHIC
273   libstrongswan_la_LIBADD += plugins/mysql/libstrongswan-mysql.la
274 endif
275 endif
276
277 if USE_SQLITE
278   SUBDIRS += plugins/sqlite
279 if MONOLITHIC
280   libstrongswan_la_LIBADD += plugins/sqlite/libstrongswan-sqlite.la
281 endif
282 endif
283
284 if USE_PADLOCK
285   SUBDIRS += plugins/padlock
286 if MONOLITHIC
287   libstrongswan_la_LIBADD += plugins/padlock/libstrongswan-padlock.la
288 endif
289 endif
290
291 if USE_OPENSSL
292   SUBDIRS += plugins/openssl
293 if MONOLITHIC
294   libstrongswan_la_LIBADD += plugins/openssl/libstrongswan-openssl.la
295 endif
296 endif
297
298 if USE_GCRYPT
299   SUBDIRS += plugins/gcrypt
300 if MONOLITHIC
301   libstrongswan_la_LIBADD += plugins/gcrypt/libstrongswan-gcrypt.la
302 endif
303 endif
304
305 if USE_FIPS_PRF
306   SUBDIRS += plugins/fips_prf
307 if MONOLITHIC
308   libstrongswan_la_LIBADD += plugins/fips_prf/libstrongswan-fips-prf.la
309 endif
310 endif
311
312 if USE_AGENT
313   SUBDIRS += plugins/agent
314 if MONOLITHIC
315   libstrongswan_la_LIBADD += plugins/agent/libstrongswan-agent.la
316 endif
317 endif
318
319 if USE_PKCS11
320   SUBDIRS += plugins/pkcs11
321 if MONOLITHIC
322   libstrongswan_la_LIBADD += plugins/pkcs11/libstrongswan-pkcs11.la
323 endif
324 endif
325
326 if USE_CTR
327   SUBDIRS += plugins/ctr
328 if MONOLITHIC
329   libstrongswan_la_LIBADD += plugins/ctr/libstrongswan-ctr.la
330 endif
331 endif
332
333 if USE_TEST_VECTORS
334   SUBDIRS += plugins/test_vectors
335 if MONOLITHIC
336   libstrongswan_la_LIBADD += plugins/test_vectors/libstrongswan-test-vectors.la
337 endif
338 endif