Merge branch 'unit-tests'
[strongswan.git] / src / libstrongswan / Makefile.am
1 ipseclib_LTLIBRARIES = libstrongswan.la
2
3 libstrongswan_la_SOURCES = \
4 library.c \
5 asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
6 collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
7 collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
8 crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
9 crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
10 crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
11 crypto/signers/mac_signer.c crypto/crypto_factory.c crypto/crypto_tester.c \
12 crypto/diffie_hellman.c crypto/aead.c crypto/transform.c \
13 credentials/credential_factory.c credentials/builder.c \
14 credentials/cred_encoding.c credentials/keys/private_key.c \
15 credentials/keys/public_key.c credentials/keys/shared_key.c \
16 credentials/certificates/certificate.c credentials/certificates/crl.c \
17 credentials/certificates/ocsp_response.c \
18 credentials/containers/container.c credentials/containers/pkcs12.c \
19 credentials/ietf_attributes/ietf_attributes.c credentials/credential_manager.c \
20 credentials/sets/auth_cfg_wrapper.c credentials/sets/ocsp_response_wrapper.c \
21 credentials/sets/cert_cache.c credentials/sets/mem_cred.c \
22 credentials/sets/callback_cred.c credentials/auth_cfg.c database/database.c \
23 database/database_factory.c fetcher/fetcher.c fetcher/fetcher_manager.c eap/eap.c \
24 ipsec/ipsec_types.c \
25 networking/host.c networking/host_resolver.c networking/packet.c \
26 networking/tun_device.c \
27 pen/pen.c plugins/plugin_loader.c plugins/plugin_feature.c processing/jobs/job.c \
28 processing/jobs/callback_job.c processing/processor.c processing/scheduler.c \
29 resolver/resolver_manager.c resolver/rr_set.c \
30 selectors/traffic_selector.c threading/thread.c threading/thread_value.c \
31 threading/mutex.c threading/semaphore.c threading/rwlock.c threading/spinlock.c \
32 utils/utils.c utils/chunk.c utils/debug.c utils/enum.c utils/identification.c \
33 utils/lexparser.c utils/optionsfrom.c utils/capabilities.c utils/backtrace.c \
34 utils/printf_hook.c utils/settings.c
35
36 if USE_DEV_HEADERS
37 strongswan_includedir = ${dev_headers}
38 nobase_strongswan_include_HEADERS = \
39 library.h \
40 asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
41 collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
42 collections/linked_list.h \
43 crypto/crypters/crypter.h crypto/hashers/hasher.h crypto/mac.h \
44 crypto/proposal/proposal_keywords.h crypto/proposal/proposal_keywords_static.h \
45 crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
46 crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \
47 crypto/crypto_factory.h crypto/crypto_tester.h crypto/diffie_hellman.h \
48 crypto/aead.h crypto/transform.h crypto/pkcs5.h \
49 credentials/credential_factory.h credentials/builder.h \
50 credentials/cred_encoding.h credentials/keys/private_key.h \
51 credentials/keys/public_key.h credentials/keys/shared_key.h \
52 credentials/certificates/certificate.h credentials/certificates/x509.h \
53 credentials/certificates/ac.h credentials/certificates/crl.h \
54 credentials/certificates/pkcs10.h credentials/certificates/ocsp_request.h \
55 credentials/certificates/ocsp_response.h \
56 credentials/certificates/pgp_certificate.h \
57 credentials/containers/container.h credentials/containers/pkcs7.h \
58 credentials/containers/pkcs12.h \
59 credentials/ietf_attributes/ietf_attributes.h \
60 credentials/credential_manager.h credentials/sets/auth_cfg_wrapper.h \
61 credentials/sets/ocsp_response_wrapper.h credentials/sets/cert_cache.h \
62 credentials/sets/mem_cred.h credentials/sets/callback_cred.h \
63 credentials/auth_cfg.h credentials/credential_set.h credentials/cert_validator.h \
64 database/database.h database/database_factory.h fetcher/fetcher.h \
65 fetcher/fetcher_manager.h eap/eap.h pen/pen.h ipsec/ipsec_types.h \
66 networking/host.h networking/host_resolver.h networking/packet.h \
67 networking/tun_device.h \
68 resolver/resolver.h resolver/resolver_response.h resolver/rr_set.h \
69 resolver/rr.h resolver/resolver_manager.h \
70 plugins/plugin_loader.h plugins/plugin.h plugins/plugin_feature.h \
71 processing/jobs/job.h processing/jobs/callback_job.h processing/processor.h \
72 processing/scheduler.h selectors/traffic_selector.h \
73 threading/thread.h threading/thread_value.h \
74 threading/mutex.h threading/condvar.h threading/spinlock.h threading/semaphore.h \
75 threading/rwlock.h threading/rwlock_condvar.h threading/lock_profiler.h \
76 utils/utils.h utils/chunk.h utils/debug.h utils/enum.h utils/identification.h \
77 utils/lexparser.h utils/optionsfrom.h utils/capabilities.h utils/backtrace.h \
78 utils/leak_detective.h utils/printf_hook.h utils/settings.h utils/integrity_checker.h
79 endif
80
81 library.lo :    $(top_builddir)/config.status
82
83 libstrongswan_la_LIBADD = $(PTHREADLIB) $(DLLIB) $(BTLIB) $(SOCKLIB) $(RTLIB) $(BFDLIB) $(UNWINDLIB)
84
85 INCLUDES = -I$(top_srcdir)/src/libstrongswan
86 AM_CFLAGS = \
87 -DIPSEC_DIR=\"${ipsecdir}\" \
88 -DIPSEC_LIB_DIR=\"${ipseclibdir}\" \
89 -DPLUGINDIR=\"${plugindir}\" \
90 -DSTRONGSWAN_CONF=\"${strongswan_conf}\" \
91 @COVERAGE_CFLAGS@
92
93 if USE_LEAK_DETECTIVE
94   AM_CFLAGS += -DLEAK_DETECTIVE
95   libstrongswan_la_SOURCES += utils/leak_detective.c
96 endif
97
98 if USE_LOCK_PROFILER
99   AM_CFLAGS += -DLOCK_PROFILER
100 endif
101
102 if USE_INTEGRITY_TEST
103   AM_CFLAGS += -DINTEGRITY_TEST
104   libstrongswan_la_SOURCES += utils/integrity_checker.c
105 endif
106
107 if USE_VSTR
108   libstrongswan_la_LIBADD += -lvstr
109 endif
110
111 if USE_LIBCAP
112   libstrongswan_la_LIBADD += -lcap
113 endif
114
115 EXTRA_DIST = \
116 asn1/oid.txt asn1/oid.pl \
117 crypto/proposal/proposal_keywords_static.txt \
118 Android.mk AndroidConfigLocal.h
119
120 BUILT_SOURCES = \
121 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
122 $(srcdir)/crypto/proposal/proposal_keywords_static.c
123
124 MAINTAINERCLEANFILES = \
125 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
126 $(srcdir)/crypto/proposal/proposal_keywords_static.c
127
128 $(srcdir)/asn1/oid.c :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
129                 $(AM_V_GEN) \
130                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
131
132 $(srcdir)/asn1/oid.h :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
133                 $(AM_V_GEN) \
134                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
135
136 $(srcdir)/crypto/proposal/proposal_keywords_static.c:   $(srcdir)/crypto/proposal/proposal_keywords_static.txt \
137                                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.h
138                 $(AM_V_GEN) \
139                 $(GPERF) -N proposal_get_token_static -m 10 -C -G -c -t -D < \
140                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.txt > $@
141
142
143 # build plugins with their own Makefile
144 #######################################
145
146 if MONOLITHIC
147 SUBDIRS =
148 else
149 SUBDIRS = .
150 endif
151
152 if USE_AF_ALG
153   SUBDIRS += plugins/af_alg
154 if MONOLITHIC
155   libstrongswan_la_LIBADD += plugins/af_alg/libstrongswan-af-alg.la
156 endif
157 endif
158
159 if USE_AES
160   SUBDIRS += plugins/aes
161 if MONOLITHIC
162   libstrongswan_la_LIBADD += plugins/aes/libstrongswan-aes.la
163 endif
164 endif
165
166 if USE_DES
167   SUBDIRS += plugins/des
168 if MONOLITHIC
169   libstrongswan_la_LIBADD += plugins/des/libstrongswan-des.la
170 endif
171 endif
172
173 if USE_BLOWFISH
174   SUBDIRS += plugins/blowfish
175 if MONOLITHIC
176   libstrongswan_la_LIBADD += plugins/blowfish/libstrongswan-blowfish.la
177 endif
178 endif
179
180 if USE_RC2
181   SUBDIRS += plugins/rc2
182 if MONOLITHIC
183   libstrongswan_la_LIBADD += plugins/rc2/libstrongswan-rc2.la
184 endif
185 endif
186
187 if USE_MD4
188   SUBDIRS += plugins/md4
189 if MONOLITHIC
190   libstrongswan_la_LIBADD += plugins/md4/libstrongswan-md4.la
191 endif
192 endif
193
194 if USE_MD5
195   SUBDIRS += plugins/md5
196 if MONOLITHIC
197   libstrongswan_la_LIBADD += plugins/md5/libstrongswan-md5.la
198 endif
199 endif
200
201 if USE_SHA1
202   SUBDIRS += plugins/sha1
203 if MONOLITHIC
204   libstrongswan_la_LIBADD += plugins/sha1/libstrongswan-sha1.la
205 endif
206 endif
207
208 if USE_SHA2
209   SUBDIRS += plugins/sha2
210 if MONOLITHIC
211   libstrongswan_la_LIBADD += plugins/sha2/libstrongswan-sha2.la
212 endif
213 endif
214
215 if USE_GMP
216   SUBDIRS += plugins/gmp
217 if MONOLITHIC
218   libstrongswan_la_LIBADD += plugins/gmp/libstrongswan-gmp.la
219 endif
220 endif
221
222 if USE_RDRAND
223   SUBDIRS += plugins/rdrand
224 if MONOLITHIC
225   libstrongswan_la_LIBADD += plugins/rdrand/libstrongswan-rdrand.la
226 endif
227 endif
228
229 if USE_RANDOM
230   SUBDIRS += plugins/random
231 if MONOLITHIC
232   libstrongswan_la_LIBADD += plugins/random/libstrongswan-random.la
233 endif
234 endif
235
236 if USE_NONCE
237   SUBDIRS += plugins/nonce
238 if MONOLITHIC
239   libstrongswan_la_LIBADD += plugins/nonce/libstrongswan-nonce.la
240 endif
241 endif
242
243 if USE_HMAC
244   SUBDIRS += plugins/hmac
245 if MONOLITHIC
246   libstrongswan_la_LIBADD += plugins/hmac/libstrongswan-hmac.la
247 endif
248 endif
249
250 if USE_CMAC
251   SUBDIRS += plugins/cmac
252 if MONOLITHIC
253   libstrongswan_la_LIBADD += plugins/cmac/libstrongswan-cmac.la
254 endif
255 endif
256
257 if USE_XCBC
258   SUBDIRS += plugins/xcbc
259 if MONOLITHIC
260   libstrongswan_la_LIBADD += plugins/xcbc/libstrongswan-xcbc.la
261 endif
262 endif
263
264 if USE_X509
265   SUBDIRS += plugins/x509
266 if MONOLITHIC
267   libstrongswan_la_LIBADD += plugins/x509/libstrongswan-x509.la
268 endif
269 endif
270
271 if USE_REVOCATION
272   SUBDIRS += plugins/revocation
273 if MONOLITHIC
274   libstrongswan_la_LIBADD += plugins/revocation/libstrongswan-revocation.la
275 endif
276 endif
277
278 if USE_CONSTRAINTS
279   SUBDIRS += plugins/constraints
280 if MONOLITHIC
281   libstrongswan_la_LIBADD += plugins/constraints/libstrongswan-constraints.la
282 endif
283 endif
284
285 if USE_PUBKEY
286   SUBDIRS += plugins/pubkey
287 if MONOLITHIC
288   libstrongswan_la_LIBADD += plugins/pubkey/libstrongswan-pubkey.la
289 endif
290 endif
291
292 if USE_PKCS1
293   SUBDIRS += plugins/pkcs1
294 if MONOLITHIC
295   libstrongswan_la_LIBADD += plugins/pkcs1/libstrongswan-pkcs1.la
296 endif
297 endif
298
299 if USE_PKCS7
300   SUBDIRS += plugins/pkcs7
301 if MONOLITHIC
302   libstrongswan_la_LIBADD += plugins/pkcs7/libstrongswan-pkcs7.la
303 endif
304 endif
305
306 if USE_PKCS8
307   SUBDIRS += plugins/pkcs8
308 if MONOLITHIC
309   libstrongswan_la_LIBADD += plugins/pkcs8/libstrongswan-pkcs8.la
310 endif
311 endif
312
313 if USE_PKCS12
314   SUBDIRS += plugins/pkcs12
315 if MONOLITHIC
316   libstrongswan_la_LIBADD += plugins/pkcs12/libstrongswan-pkcs12.la
317 endif
318 endif
319
320 if USE_PGP
321   SUBDIRS += plugins/pgp
322 if MONOLITHIC
323   libstrongswan_la_LIBADD += plugins/pgp/libstrongswan-pgp.la
324 endif
325 endif
326
327 if USE_DNSKEY
328   SUBDIRS += plugins/dnskey
329 if MONOLITHIC
330   libstrongswan_la_LIBADD += plugins/dnskey/libstrongswan-dnskey.la
331 endif
332 endif
333
334 if USE_SSHKEY
335   SUBDIRS += plugins/sshkey
336 if MONOLITHIC
337   libstrongswan_la_LIBADD += plugins/sshkey/libstrongswan-sshkey.la
338 endif
339 endif
340
341 if USE_PEM
342   SUBDIRS += plugins/pem
343 if MONOLITHIC
344   libstrongswan_la_LIBADD += plugins/pem/libstrongswan-pem.la
345 endif
346 endif
347
348 if USE_CURL
349   SUBDIRS += plugins/curl
350 if MONOLITHIC
351   libstrongswan_la_LIBADD += plugins/curl/libstrongswan-curl.la
352 endif
353 endif
354
355 if USE_UNBOUND
356   SUBDIRS += plugins/unbound
357 if MONOLITHIC
358   libstrongswan_la_LIBADD += plugins/unbound/libstrongswan-unbound.la
359 endif
360 endif
361
362 if USE_SOUP
363   SUBDIRS += plugins/soup
364 if MONOLITHIC
365   libstrongswan_la_LIBADD += plugins/soup/libstrongswan-soup.la
366 endif
367 endif
368
369 if USE_LDAP
370   SUBDIRS += plugins/ldap
371 if MONOLITHIC
372   libstrongswan_la_LIBADD += plugins/ldap/libstrongswan-ldap.la
373 endif
374 endif
375
376 if USE_MYSQL
377   SUBDIRS += plugins/mysql
378 if MONOLITHIC
379   libstrongswan_la_LIBADD += plugins/mysql/libstrongswan-mysql.la
380 endif
381 endif
382
383 if USE_SQLITE
384   SUBDIRS += plugins/sqlite
385 if MONOLITHIC
386   libstrongswan_la_LIBADD += plugins/sqlite/libstrongswan-sqlite.la
387 endif
388 endif
389
390 if USE_PADLOCK
391   SUBDIRS += plugins/padlock
392 if MONOLITHIC
393   libstrongswan_la_LIBADD += plugins/padlock/libstrongswan-padlock.la
394 endif
395 endif
396
397 if USE_OPENSSL
398   SUBDIRS += plugins/openssl
399 if MONOLITHIC
400   libstrongswan_la_LIBADD += plugins/openssl/libstrongswan-openssl.la
401 endif
402 endif
403
404 if USE_GCRYPT
405   SUBDIRS += plugins/gcrypt
406 if MONOLITHIC
407   libstrongswan_la_LIBADD += plugins/gcrypt/libstrongswan-gcrypt.la
408 endif
409 endif
410
411 if USE_FIPS_PRF
412   SUBDIRS += plugins/fips_prf
413 if MONOLITHIC
414   libstrongswan_la_LIBADD += plugins/fips_prf/libstrongswan-fips-prf.la
415 endif
416 endif
417
418 if USE_AGENT
419   SUBDIRS += plugins/agent
420 if MONOLITHIC
421   libstrongswan_la_LIBADD += plugins/agent/libstrongswan-agent.la
422 endif
423 endif
424
425 if USE_PKCS11
426   SUBDIRS += plugins/pkcs11
427 if MONOLITHIC
428   libstrongswan_la_LIBADD += plugins/pkcs11/libstrongswan-pkcs11.la
429 endif
430 endif
431
432 if USE_CTR
433   SUBDIRS += plugins/ctr
434 if MONOLITHIC
435   libstrongswan_la_LIBADD += plugins/ctr/libstrongswan-ctr.la
436 endif
437 endif
438
439 if USE_CCM
440   SUBDIRS += plugins/ccm
441 if MONOLITHIC
442   libstrongswan_la_LIBADD += plugins/ccm/libstrongswan-ccm.la
443 endif
444 endif
445
446 if USE_GCM
447   SUBDIRS += plugins/gcm
448 if MONOLITHIC
449   libstrongswan_la_LIBADD += plugins/gcm/libstrongswan-gcm.la
450 endif
451 endif
452
453 if USE_TEST_VECTORS
454   SUBDIRS += plugins/test_vectors
455 if MONOLITHIC
456   libstrongswan_la_LIBADD += plugins/test_vectors/libstrongswan-test-vectors.la
457 endif
458 endif
459
460 if UNITTESTS
461 if MONOLITHIC
462   SUBDIRS += .
463 endif
464   SUBDIRS += tests
465 endif