Add test runner for unit tests in libstrongswan
[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
92 if USE_LEAK_DETECTIVE
93   AM_CFLAGS += -DLEAK_DETECTIVE
94   libstrongswan_la_SOURCES += utils/leak_detective.c
95 endif
96
97 if USE_LOCK_PROFILER
98   AM_CFLAGS += -DLOCK_PROFILER
99 endif
100
101 if USE_INTEGRITY_TEST
102   AM_CFLAGS += -DINTEGRITY_TEST
103   libstrongswan_la_SOURCES += utils/integrity_checker.c
104 endif
105
106 if USE_VSTR
107   libstrongswan_la_LIBADD += -lvstr
108 endif
109
110 if USE_LIBCAP
111   libstrongswan_la_LIBADD += -lcap
112 endif
113
114 EXTRA_DIST = \
115 asn1/oid.txt asn1/oid.pl \
116 crypto/proposal/proposal_keywords_static.txt \
117 Android.mk AndroidConfigLocal.h
118
119 BUILT_SOURCES = \
120 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
121 $(srcdir)/crypto/proposal/proposal_keywords_static.c
122
123 MAINTAINERCLEANFILES = \
124 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
125 $(srcdir)/crypto/proposal/proposal_keywords_static.c
126
127 $(srcdir)/asn1/oid.c :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
128                 $(AM_V_GEN) \
129                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
130
131 $(srcdir)/asn1/oid.h :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
132                 $(AM_V_GEN) \
133                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
134
135 $(srcdir)/crypto/proposal/proposal_keywords_static.c:   $(srcdir)/crypto/proposal/proposal_keywords_static.txt \
136                                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.h
137                 $(AM_V_GEN) \
138                 $(GPERF) -N proposal_get_token_static -m 10 -C -G -c -t -D < \
139                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.txt > $@
140
141
142 # build plugins with their own Makefile
143 #######################################
144
145 if MONOLITHIC
146 SUBDIRS =
147 else
148 SUBDIRS = .
149 endif
150
151 if USE_AF_ALG
152   SUBDIRS += plugins/af_alg
153 if MONOLITHIC
154   libstrongswan_la_LIBADD += plugins/af_alg/libstrongswan-af-alg.la
155 endif
156 endif
157
158 if USE_AES
159   SUBDIRS += plugins/aes
160 if MONOLITHIC
161   libstrongswan_la_LIBADD += plugins/aes/libstrongswan-aes.la
162 endif
163 endif
164
165 if USE_DES
166   SUBDIRS += plugins/des
167 if MONOLITHIC
168   libstrongswan_la_LIBADD += plugins/des/libstrongswan-des.la
169 endif
170 endif
171
172 if USE_BLOWFISH
173   SUBDIRS += plugins/blowfish
174 if MONOLITHIC
175   libstrongswan_la_LIBADD += plugins/blowfish/libstrongswan-blowfish.la
176 endif
177 endif
178
179 if USE_RC2
180   SUBDIRS += plugins/rc2
181 if MONOLITHIC
182   libstrongswan_la_LIBADD += plugins/rc2/libstrongswan-rc2.la
183 endif
184 endif
185
186 if USE_MD4
187   SUBDIRS += plugins/md4
188 if MONOLITHIC
189   libstrongswan_la_LIBADD += plugins/md4/libstrongswan-md4.la
190 endif
191 endif
192
193 if USE_MD5
194   SUBDIRS += plugins/md5
195 if MONOLITHIC
196   libstrongswan_la_LIBADD += plugins/md5/libstrongswan-md5.la
197 endif
198 endif
199
200 if USE_SHA1
201   SUBDIRS += plugins/sha1
202 if MONOLITHIC
203   libstrongswan_la_LIBADD += plugins/sha1/libstrongswan-sha1.la
204 endif
205 endif
206
207 if USE_SHA2
208   SUBDIRS += plugins/sha2
209 if MONOLITHIC
210   libstrongswan_la_LIBADD += plugins/sha2/libstrongswan-sha2.la
211 endif
212 endif
213
214 if USE_GMP
215   SUBDIRS += plugins/gmp
216 if MONOLITHIC
217   libstrongswan_la_LIBADD += plugins/gmp/libstrongswan-gmp.la
218 endif
219 endif
220
221 if USE_RDRAND
222   SUBDIRS += plugins/rdrand
223 if MONOLITHIC
224   libstrongswan_la_LIBADD += plugins/rdrand/libstrongswan-rdrand.la
225 endif
226 endif
227
228 if USE_RANDOM
229   SUBDIRS += plugins/random
230 if MONOLITHIC
231   libstrongswan_la_LIBADD += plugins/random/libstrongswan-random.la
232 endif
233 endif
234
235 if USE_NONCE
236   SUBDIRS += plugins/nonce
237 if MONOLITHIC
238   libstrongswan_la_LIBADD += plugins/nonce/libstrongswan-nonce.la
239 endif
240 endif
241
242 if USE_HMAC
243   SUBDIRS += plugins/hmac
244 if MONOLITHIC
245   libstrongswan_la_LIBADD += plugins/hmac/libstrongswan-hmac.la
246 endif
247 endif
248
249 if USE_CMAC
250   SUBDIRS += plugins/cmac
251 if MONOLITHIC
252   libstrongswan_la_LIBADD += plugins/cmac/libstrongswan-cmac.la
253 endif
254 endif
255
256 if USE_XCBC
257   SUBDIRS += plugins/xcbc
258 if MONOLITHIC
259   libstrongswan_la_LIBADD += plugins/xcbc/libstrongswan-xcbc.la
260 endif
261 endif
262
263 if USE_X509
264   SUBDIRS += plugins/x509
265 if MONOLITHIC
266   libstrongswan_la_LIBADD += plugins/x509/libstrongswan-x509.la
267 endif
268 endif
269
270 if USE_REVOCATION
271   SUBDIRS += plugins/revocation
272 if MONOLITHIC
273   libstrongswan_la_LIBADD += plugins/revocation/libstrongswan-revocation.la
274 endif
275 endif
276
277 if USE_CONSTRAINTS
278   SUBDIRS += plugins/constraints
279 if MONOLITHIC
280   libstrongswan_la_LIBADD += plugins/constraints/libstrongswan-constraints.la
281 endif
282 endif
283
284 if USE_PUBKEY
285   SUBDIRS += plugins/pubkey
286 if MONOLITHIC
287   libstrongswan_la_LIBADD += plugins/pubkey/libstrongswan-pubkey.la
288 endif
289 endif
290
291 if USE_PKCS1
292   SUBDIRS += plugins/pkcs1
293 if MONOLITHIC
294   libstrongswan_la_LIBADD += plugins/pkcs1/libstrongswan-pkcs1.la
295 endif
296 endif
297
298 if USE_PKCS7
299   SUBDIRS += plugins/pkcs7
300 if MONOLITHIC
301   libstrongswan_la_LIBADD += plugins/pkcs7/libstrongswan-pkcs7.la
302 endif
303 endif
304
305 if USE_PKCS8
306   SUBDIRS += plugins/pkcs8
307 if MONOLITHIC
308   libstrongswan_la_LIBADD += plugins/pkcs8/libstrongswan-pkcs8.la
309 endif
310 endif
311
312 if USE_PKCS12
313   SUBDIRS += plugins/pkcs12
314 if MONOLITHIC
315   libstrongswan_la_LIBADD += plugins/pkcs12/libstrongswan-pkcs12.la
316 endif
317 endif
318
319 if USE_PGP
320   SUBDIRS += plugins/pgp
321 if MONOLITHIC
322   libstrongswan_la_LIBADD += plugins/pgp/libstrongswan-pgp.la
323 endif
324 endif
325
326 if USE_DNSKEY
327   SUBDIRS += plugins/dnskey
328 if MONOLITHIC
329   libstrongswan_la_LIBADD += plugins/dnskey/libstrongswan-dnskey.la
330 endif
331 endif
332
333 if USE_SSHKEY
334   SUBDIRS += plugins/sshkey
335 if MONOLITHIC
336   libstrongswan_la_LIBADD += plugins/sshkey/libstrongswan-sshkey.la
337 endif
338 endif
339
340 if USE_PEM
341   SUBDIRS += plugins/pem
342 if MONOLITHIC
343   libstrongswan_la_LIBADD += plugins/pem/libstrongswan-pem.la
344 endif
345 endif
346
347 if USE_CURL
348   SUBDIRS += plugins/curl
349 if MONOLITHIC
350   libstrongswan_la_LIBADD += plugins/curl/libstrongswan-curl.la
351 endif
352 endif
353
354 if USE_UNBOUND
355   SUBDIRS += plugins/unbound
356 if MONOLITHIC
357   libstrongswan_la_LIBADD += plugins/unbound/libstrongswan-unbound.la
358 endif
359 endif
360
361 if USE_SOUP
362   SUBDIRS += plugins/soup
363 if MONOLITHIC
364   libstrongswan_la_LIBADD += plugins/soup/libstrongswan-soup.la
365 endif
366 endif
367
368 if USE_LDAP
369   SUBDIRS += plugins/ldap
370 if MONOLITHIC
371   libstrongswan_la_LIBADD += plugins/ldap/libstrongswan-ldap.la
372 endif
373 endif
374
375 if USE_MYSQL
376   SUBDIRS += plugins/mysql
377 if MONOLITHIC
378   libstrongswan_la_LIBADD += plugins/mysql/libstrongswan-mysql.la
379 endif
380 endif
381
382 if USE_SQLITE
383   SUBDIRS += plugins/sqlite
384 if MONOLITHIC
385   libstrongswan_la_LIBADD += plugins/sqlite/libstrongswan-sqlite.la
386 endif
387 endif
388
389 if USE_PADLOCK
390   SUBDIRS += plugins/padlock
391 if MONOLITHIC
392   libstrongswan_la_LIBADD += plugins/padlock/libstrongswan-padlock.la
393 endif
394 endif
395
396 if USE_OPENSSL
397   SUBDIRS += plugins/openssl
398 if MONOLITHIC
399   libstrongswan_la_LIBADD += plugins/openssl/libstrongswan-openssl.la
400 endif
401 endif
402
403 if USE_GCRYPT
404   SUBDIRS += plugins/gcrypt
405 if MONOLITHIC
406   libstrongswan_la_LIBADD += plugins/gcrypt/libstrongswan-gcrypt.la
407 endif
408 endif
409
410 if USE_FIPS_PRF
411   SUBDIRS += plugins/fips_prf
412 if MONOLITHIC
413   libstrongswan_la_LIBADD += plugins/fips_prf/libstrongswan-fips-prf.la
414 endif
415 endif
416
417 if USE_AGENT
418   SUBDIRS += plugins/agent
419 if MONOLITHIC
420   libstrongswan_la_LIBADD += plugins/agent/libstrongswan-agent.la
421 endif
422 endif
423
424 if USE_PKCS11
425   SUBDIRS += plugins/pkcs11
426 if MONOLITHIC
427   libstrongswan_la_LIBADD += plugins/pkcs11/libstrongswan-pkcs11.la
428 endif
429 endif
430
431 if USE_CTR
432   SUBDIRS += plugins/ctr
433 if MONOLITHIC
434   libstrongswan_la_LIBADD += plugins/ctr/libstrongswan-ctr.la
435 endif
436 endif
437
438 if USE_CCM
439   SUBDIRS += plugins/ccm
440 if MONOLITHIC
441   libstrongswan_la_LIBADD += plugins/ccm/libstrongswan-ccm.la
442 endif
443 endif
444
445 if USE_GCM
446   SUBDIRS += plugins/gcm
447 if MONOLITHIC
448   libstrongswan_la_LIBADD += plugins/gcm/libstrongswan-gcm.la
449 endif
450 endif
451
452 if USE_TEST_VECTORS
453   SUBDIRS += plugins/test_vectors
454 if MONOLITHIC
455   libstrongswan_la_LIBADD += plugins/test_vectors/libstrongswan-test-vectors.la
456 endif
457 endif
458
459 if UNITTESTS
460 if MONOLITHIC
461   SUBDIRS += .
462 endif
463   SUBDIRS += tests
464 endif