Implemented SHA-3 hash algorithm including test vectors
[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/array.c \
8 collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
9 crypto/hashers/hash_algorithm_set.c \
10 crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
11 crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
12 crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
13 crypto/signers/mac_signer.c crypto/crypto_factory.c crypto/crypto_tester.c \
14 crypto/diffie_hellman.c crypto/aead.c crypto/transform.c \
15 crypto/iv/iv_gen.c crypto/iv/iv_gen_rand.c crypto/iv/iv_gen_seq.c \
16 crypto/mgf1/mgf1.c crypto/mgf1/mgf1_bitspender.c \
17 credentials/credential_factory.c credentials/builder.c \
18 credentials/cred_encoding.c credentials/keys/private_key.c \
19 credentials/keys/public_key.c credentials/keys/shared_key.c \
20 credentials/certificates/certificate.c credentials/certificates/crl.c \
21 credentials/certificates/ocsp_response.c \
22 credentials/containers/container.c credentials/containers/pkcs12.c \
23 credentials/credential_manager.c \
24 credentials/sets/auth_cfg_wrapper.c credentials/sets/ocsp_response_wrapper.c \
25 credentials/sets/cert_cache.c credentials/sets/mem_cred.c \
26 credentials/sets/callback_cred.c credentials/auth_cfg.c database/database.c \
27 database/database_factory.c fetcher/fetcher.c fetcher/fetcher_manager.c eap/eap.c \
28 ipsec/ipsec_types.c \
29 networking/host.c networking/host_resolver.c networking/packet.c \
30 networking/tun_device.c networking/streams/stream_manager.c \
31 networking/streams/stream.c networking/streams/stream_service.c \
32 networking/streams/stream_tcp.c networking/streams/stream_service_tcp.c \
33 pen/pen.c plugins/plugin_loader.c plugins/plugin_feature.c processing/jobs/job.c \
34 processing/jobs/callback_job.c processing/processor.c processing/scheduler.c \
35 processing/watcher.c resolver/resolver_manager.c resolver/rr_set.c \
36 selectors/traffic_selector.c settings/settings.c settings/settings_types.c \
37 settings/settings_parser.y settings/settings_lexer.l utils/cpu_feature.c \
38 utils/utils.c utils/chunk.c utils/debug.c utils/enum.c utils/identification.c \
39 utils/lexparser.c utils/optionsfrom.c utils/capabilities.c utils/backtrace.c \
40 utils/parser_helper.c utils/test.c utils/process.c utils/utils/strerror.c \
41 utils/utils/atomics.c utils/utils/string.c utils/utils/memory.c \
42 utils/utils/tty.c utils/utils/path.c utils/utils/status.c utils/utils/time.c \
43 utils/utils/align.c
44
45 if !USE_WINDOWS
46   libstrongswan_la_SOURCES += \
47     threading/thread.c \
48     threading/thread_value.c \
49     threading/mutex.c \
50     threading/rwlock.c \
51     threading/spinlock.c \
52     threading/semaphore.c \
53     networking/streams/stream_unix.c \
54     networking/streams/stream_service_unix.c
55 endif
56
57 # private header files
58 noinst_HEADERS = \
59 settings/settings_types.h
60
61 if USE_DEV_HEADERS
62 strongswan_includedir = ${dev_headers}
63 nobase_strongswan_include_HEADERS = \
64 library.h \
65 asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
66 collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
67 collections/linked_list.h collections/array.h collections/dictionary.h \
68 crypto/crypters/crypter.h crypto/hashers/hasher.h \
69 crypto/hashers/hash_algorithm_set.h crypto/mac.h \
70 crypto/proposal/proposal_keywords.h crypto/proposal/proposal_keywords_static.h \
71 crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
72 crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \
73 crypto/crypto_factory.h crypto/crypto_tester.h crypto/diffie_hellman.h \
74 crypto/aead.h crypto/transform.h crypto/pkcs5.h crypto/iv/iv_gen.h \
75 crypto/iv/iv_gen_rand.h crypto/iv/iv_gen_seq.h \
76 crypto/mgf1/mgf1.h crypto/mgf1/mgf1_bitspender.h \
77 credentials/credential_factory.h credentials/builder.h \
78 credentials/cred_encoding.h credentials/keys/private_key.h \
79 credentials/keys/public_key.h credentials/keys/shared_key.h \
80 credentials/certificates/certificate.h credentials/certificates/x509.h \
81 credentials/certificates/ac.h credentials/certificates/crl.h \
82 credentials/certificates/pkcs10.h credentials/certificates/ocsp_request.h \
83 credentials/certificates/ocsp_response.h \
84 credentials/certificates/pgp_certificate.h \
85 credentials/containers/container.h credentials/containers/pkcs7.h \
86 credentials/containers/pkcs12.h \
87 credentials/credential_manager.h credentials/sets/auth_cfg_wrapper.h \
88 credentials/sets/ocsp_response_wrapper.h credentials/sets/cert_cache.h \
89 credentials/sets/mem_cred.h credentials/sets/callback_cred.h \
90 credentials/auth_cfg.h credentials/credential_set.h credentials/cert_validator.h \
91 database/database.h database/database_factory.h fetcher/fetcher.h \
92 fetcher/fetcher_manager.h eap/eap.h pen/pen.h ipsec/ipsec_types.h \
93 networking/host.h networking/host_resolver.h networking/packet.h \
94 networking/tun_device.h networking/streams/stream.h \
95 networking/streams/stream_unix.h networking/streams/stream_service_unix.h \
96 networking/streams/stream_tcp.h networking/streams/stream_service_tcp.h \
97 networking/streams/stream_service.h networking/streams/stream_manager.h \
98 resolver/resolver.h resolver/resolver_response.h resolver/rr_set.h \
99 resolver/rr.h resolver/resolver_manager.h \
100 plugins/plugin_loader.h plugins/plugin.h plugins/plugin_feature.h \
101 processing/jobs/job.h processing/jobs/callback_job.h processing/processor.h \
102 processing/scheduler.h processing/watcher.h selectors/traffic_selector.h \
103 settings/settings.h settings/settings_parser.h threading/thread_value.h \
104 threading/thread.h threading/windows/thread.h \
105 threading/mutex.h threading/condvar.h threading/spinlock.h threading/semaphore.h \
106 threading/rwlock.h threading/rwlock_condvar.h threading/lock_profiler.h \
107 utils/utils.h utils/chunk.h utils/debug.h utils/enum.h utils/identification.h \
108 utils/lexparser.h utils/optionsfrom.h utils/capabilities.h utils/backtrace.h \
109 utils/cpu_feature.h utils/leak_detective.h utils/printf_hook/printf_hook.h \
110 utils/printf_hook/printf_hook_vstr.h utils/printf_hook/printf_hook_builtin.h \
111 utils/parser_helper.h utils/test.h utils/integrity_checker.h utils/process.h \
112 utils/utils/strerror.h utils/compat/windows.h utils/compat/apple.h \
113 utils/utils/atomics.h utils/utils/types.h utils/utils/byteorder.h \
114 utils/utils/string.h utils/utils/memory.h utils/utils/tty.h utils/utils/path.h \
115 utils/utils/status.h utils/utils/object.h utils/utils/time.h utils/utils/align.h
116 endif
117
118 library.lo :    $(top_builddir)/config.status
119
120 libstrongswan_la_LIBADD = $(DLLIB) $(BTLIB) $(SOCKLIB) $(RTLIB) $(BFDLIB) $(UNWINDLIB)
121
122 AM_CPPFLAGS = \
123         -I$(top_srcdir)/src/libstrongswan \
124         -DIPSEC_DIR=\"${ipsecdir}\" \
125         -DIPSEC_LIB_DIR=\"${ipseclibdir}\" \
126         -DPLUGINDIR=\"${plugindir}\" \
127         -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
128
129 AM_CFLAGS = \
130         @COVERAGE_CFLAGS@
131
132 AM_LDFLAGS = \
133         -no-undefined
134
135 AM_YFLAGS = -v -d
136
137 if USE_WINDOWS
138   libstrongswan_la_LIBADD += -lws2_32 -lpsapi
139   libstrongswan_la_SOURCES += \
140     threading/windows/thread.c \
141     threading/windows/thread_value.c \
142     threading/windows/mutex.c \
143     threading/windows/rwlock.c \
144     threading/windows/spinlock.c \
145     threading/windows/semaphore.c \
146     utils/compat/windows.c
147 else
148   libstrongswan_la_LIBADD += $(PTHREADLIB)
149 endif
150
151 if USE_DBGHELP
152   libstrongswan_la_LIBADD += -ldbghelp
153   AM_CPPFLAGS += -DHAVE_DBGHELP
154 endif
155
156 if USE_LEAK_DETECTIVE
157   AM_CPPFLAGS += -DLEAK_DETECTIVE
158   libstrongswan_la_SOURCES += utils/leak_detective.c
159 endif
160
161 if USE_LOCK_PROFILER
162   AM_CPPFLAGS += -DLOCK_PROFILER
163 endif
164
165 if USE_INTEGRITY_TEST
166   AM_CPPFLAGS += -DINTEGRITY_TEST
167   libstrongswan_la_SOURCES += utils/integrity_checker.c
168 endif
169
170 if USE_VSTR
171   libstrongswan_la_SOURCES += utils/printf_hook/printf_hook_vstr.c
172   libstrongswan_la_LIBADD += -lvstr
173 endif
174
175 if USE_BUILTIN_PRINTF
176   libstrongswan_la_SOURCES += utils/printf_hook/printf_hook_builtin.c
177   libstrongswan_la_LIBADD += -lm
178 endif
179
180 if !USE_BUILTIN_PRINTF
181 if !USE_VSTR
182   libstrongswan_la_SOURCES += utils/printf_hook/printf_hook_glibc.c
183 endif
184 endif
185
186 if USE_LIBCAP
187   libstrongswan_la_LIBADD += -lcap
188 endif
189
190 EXTRA_DIST = \
191 asn1/oid.txt asn1/oid.pl \
192 crypto/proposal/proposal_keywords_static.txt \
193 Android.mk AndroidConfigLocal.h
194
195 BUILT_SOURCES = \
196 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
197 $(srcdir)/crypto/proposal/proposal_keywords_static.c \
198 settings/settings_parser.h
199
200 MAINTAINERCLEANFILES = \
201 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
202 $(srcdir)/crypto/proposal/proposal_keywords_static.c
203
204 $(srcdir)/asn1/oid.c :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
205                 $(AM_V_GEN) \
206                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
207
208 $(srcdir)/asn1/oid.h :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
209                 $(AM_V_GEN) \
210                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
211
212 $(srcdir)/crypto/proposal/proposal_keywords_static.c:   $(srcdir)/crypto/proposal/proposal_keywords_static.txt \
213                                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.h
214                 $(AM_V_GEN) \
215                 $(GPERF) -N proposal_get_token_static -m 10 -C -G -c -t -D < \
216                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords_static.txt > $@
217
218
219 # build plugins with their own Makefile
220 #######################################
221
222 if MONOLITHIC
223 SUBDIRS =
224 else
225 SUBDIRS = .
226 endif
227
228 if USE_AF_ALG
229   SUBDIRS += plugins/af_alg
230 if MONOLITHIC
231   libstrongswan_la_LIBADD += plugins/af_alg/libstrongswan-af-alg.la
232 endif
233 endif
234
235 if USE_AES
236   SUBDIRS += plugins/aes
237 if MONOLITHIC
238   libstrongswan_la_LIBADD += plugins/aes/libstrongswan-aes.la
239 endif
240 endif
241
242 if USE_DES
243   SUBDIRS += plugins/des
244 if MONOLITHIC
245   libstrongswan_la_LIBADD += plugins/des/libstrongswan-des.la
246 endif
247 endif
248
249 if USE_BLOWFISH
250   SUBDIRS += plugins/blowfish
251 if MONOLITHIC
252   libstrongswan_la_LIBADD += plugins/blowfish/libstrongswan-blowfish.la
253 endif
254 endif
255
256 if USE_RC2
257   SUBDIRS += plugins/rc2
258 if MONOLITHIC
259   libstrongswan_la_LIBADD += plugins/rc2/libstrongswan-rc2.la
260 endif
261 endif
262
263 if USE_MD4
264   SUBDIRS += plugins/md4
265 if MONOLITHIC
266   libstrongswan_la_LIBADD += plugins/md4/libstrongswan-md4.la
267 endif
268 endif
269
270 if USE_MD5
271   SUBDIRS += plugins/md5
272 if MONOLITHIC
273   libstrongswan_la_LIBADD += plugins/md5/libstrongswan-md5.la
274 endif
275 endif
276
277 if USE_SHA1
278   SUBDIRS += plugins/sha1
279 if MONOLITHIC
280   libstrongswan_la_LIBADD += plugins/sha1/libstrongswan-sha1.la
281 endif
282 endif
283
284 if USE_SHA2
285   SUBDIRS += plugins/sha2
286 if MONOLITHIC
287   libstrongswan_la_LIBADD += plugins/sha2/libstrongswan-sha2.la
288 endif
289 endif
290
291 if USE_SHA3
292   SUBDIRS += plugins/sha3
293 if MONOLITHIC
294   libstrongswan_la_LIBADD += plugins/sha3/libstrongswan-sha3.la
295 endif
296 endif
297
298 if USE_GMP
299   SUBDIRS += plugins/gmp
300 if MONOLITHIC
301   libstrongswan_la_LIBADD += plugins/gmp/libstrongswan-gmp.la
302 endif
303 endif
304
305 if USE_RDRAND
306   SUBDIRS += plugins/rdrand
307 if MONOLITHIC
308   libstrongswan_la_LIBADD += plugins/rdrand/libstrongswan-rdrand.la
309 endif
310 endif
311
312 if USE_AESNI
313   SUBDIRS += plugins/aesni
314 if MONOLITHIC
315   libstrongswan_la_LIBADD += plugins/aesni/libstrongswan-aesni.la
316 endif
317 endif
318
319 if USE_RANDOM
320   SUBDIRS += plugins/random
321 if MONOLITHIC
322   libstrongswan_la_LIBADD += plugins/random/libstrongswan-random.la
323 endif
324 endif
325
326 if USE_NONCE
327   SUBDIRS += plugins/nonce
328 if MONOLITHIC
329   libstrongswan_la_LIBADD += plugins/nonce/libstrongswan-nonce.la
330 endif
331 endif
332
333 if USE_HMAC
334   SUBDIRS += plugins/hmac
335 if MONOLITHIC
336   libstrongswan_la_LIBADD += plugins/hmac/libstrongswan-hmac.la
337 endif
338 endif
339
340 if USE_CMAC
341   SUBDIRS += plugins/cmac
342 if MONOLITHIC
343   libstrongswan_la_LIBADD += plugins/cmac/libstrongswan-cmac.la
344 endif
345 endif
346
347 if USE_XCBC
348   SUBDIRS += plugins/xcbc
349 if MONOLITHIC
350   libstrongswan_la_LIBADD += plugins/xcbc/libstrongswan-xcbc.la
351 endif
352 endif
353
354 if USE_X509
355   SUBDIRS += plugins/x509
356 if MONOLITHIC
357   libstrongswan_la_LIBADD += plugins/x509/libstrongswan-x509.la
358 endif
359 endif
360
361 if USE_REVOCATION
362   SUBDIRS += plugins/revocation
363 if MONOLITHIC
364   libstrongswan_la_LIBADD += plugins/revocation/libstrongswan-revocation.la
365 endif
366 endif
367
368 if USE_CONSTRAINTS
369   SUBDIRS += plugins/constraints
370 if MONOLITHIC
371   libstrongswan_la_LIBADD += plugins/constraints/libstrongswan-constraints.la
372 endif
373 endif
374
375 if USE_ACERT
376   SUBDIRS += plugins/acert
377 if MONOLITHIC
378   libstrongswan_la_LIBADD += plugins/acert/libstrongswan-acert.la
379 endif
380 endif
381
382 if USE_PUBKEY
383   SUBDIRS += plugins/pubkey
384 if MONOLITHIC
385   libstrongswan_la_LIBADD += plugins/pubkey/libstrongswan-pubkey.la
386 endif
387 endif
388
389 if USE_PKCS1
390   SUBDIRS += plugins/pkcs1
391 if MONOLITHIC
392   libstrongswan_la_LIBADD += plugins/pkcs1/libstrongswan-pkcs1.la
393 endif
394 endif
395
396 if USE_PKCS7
397   SUBDIRS += plugins/pkcs7
398 if MONOLITHIC
399   libstrongswan_la_LIBADD += plugins/pkcs7/libstrongswan-pkcs7.la
400 endif
401 endif
402
403 if USE_PKCS8
404   SUBDIRS += plugins/pkcs8
405 if MONOLITHIC
406   libstrongswan_la_LIBADD += plugins/pkcs8/libstrongswan-pkcs8.la
407 endif
408 endif
409
410 if USE_PKCS12
411   SUBDIRS += plugins/pkcs12
412 if MONOLITHIC
413   libstrongswan_la_LIBADD += plugins/pkcs12/libstrongswan-pkcs12.la
414 endif
415 endif
416
417 if USE_PGP
418   SUBDIRS += plugins/pgp
419 if MONOLITHIC
420   libstrongswan_la_LIBADD += plugins/pgp/libstrongswan-pgp.la
421 endif
422 endif
423
424 if USE_DNSKEY
425   SUBDIRS += plugins/dnskey
426 if MONOLITHIC
427   libstrongswan_la_LIBADD += plugins/dnskey/libstrongswan-dnskey.la
428 endif
429 endif
430
431 if USE_SSHKEY
432   SUBDIRS += plugins/sshkey
433 if MONOLITHIC
434   libstrongswan_la_LIBADD += plugins/sshkey/libstrongswan-sshkey.la
435 endif
436 endif
437
438 if USE_PEM
439   SUBDIRS += plugins/pem
440 if MONOLITHIC
441   libstrongswan_la_LIBADD += plugins/pem/libstrongswan-pem.la
442 endif
443 endif
444
445 if USE_CURL
446   SUBDIRS += plugins/curl
447 if MONOLITHIC
448   libstrongswan_la_LIBADD += plugins/curl/libstrongswan-curl.la
449 endif
450 endif
451
452 if USE_FILES
453   SUBDIRS += plugins/files
454 if MONOLITHIC
455   libstrongswan_la_LIBADD += plugins/files/libstrongswan-files.la
456 endif
457 endif
458
459 if USE_WINHTTP
460   SUBDIRS += plugins/winhttp
461 if MONOLITHIC
462   libstrongswan_la_LIBADD += plugins/winhttp/libstrongswan-winhttp.la
463 endif
464 endif
465
466 if USE_UNBOUND
467   SUBDIRS += plugins/unbound
468 if MONOLITHIC
469   libstrongswan_la_LIBADD += plugins/unbound/libstrongswan-unbound.la
470 endif
471 endif
472
473 if USE_SOUP
474   SUBDIRS += plugins/soup
475 if MONOLITHIC
476   libstrongswan_la_LIBADD += plugins/soup/libstrongswan-soup.la
477 endif
478 endif
479
480 if USE_LDAP
481   SUBDIRS += plugins/ldap
482 if MONOLITHIC
483   libstrongswan_la_LIBADD += plugins/ldap/libstrongswan-ldap.la
484 endif
485 endif
486
487 if USE_MYSQL
488   SUBDIRS += plugins/mysql
489 if MONOLITHIC
490   libstrongswan_la_LIBADD += plugins/mysql/libstrongswan-mysql.la
491 endif
492 endif
493
494 if USE_SQLITE
495   SUBDIRS += plugins/sqlite
496 if MONOLITHIC
497   libstrongswan_la_LIBADD += plugins/sqlite/libstrongswan-sqlite.la
498 endif
499 endif
500
501 if USE_PADLOCK
502   SUBDIRS += plugins/padlock
503 if MONOLITHIC
504   libstrongswan_la_LIBADD += plugins/padlock/libstrongswan-padlock.la
505 endif
506 endif
507
508 if USE_OPENSSL
509   SUBDIRS += plugins/openssl
510 if MONOLITHIC
511   libstrongswan_la_LIBADD += plugins/openssl/libstrongswan-openssl.la
512 endif
513 endif
514
515 if USE_GCRYPT
516   SUBDIRS += plugins/gcrypt
517 if MONOLITHIC
518   libstrongswan_la_LIBADD += plugins/gcrypt/libstrongswan-gcrypt.la
519 endif
520 endif
521
522 if USE_FIPS_PRF
523   SUBDIRS += plugins/fips_prf
524 if MONOLITHIC
525   libstrongswan_la_LIBADD += plugins/fips_prf/libstrongswan-fips-prf.la
526 endif
527 endif
528
529 if USE_AGENT
530   SUBDIRS += plugins/agent
531 if MONOLITHIC
532   libstrongswan_la_LIBADD += plugins/agent/libstrongswan-agent.la
533 endif
534 endif
535
536 if USE_KEYCHAIN
537   SUBDIRS += plugins/keychain
538 if MONOLITHIC
539   libstrongswan_la_LIBADD += plugins/keychain/libstrongswan-keychain.la
540 endif
541 endif
542
543 if USE_PKCS11
544   SUBDIRS += plugins/pkcs11
545 if MONOLITHIC
546   libstrongswan_la_LIBADD += plugins/pkcs11/libstrongswan-pkcs11.la
547 endif
548 endif
549
550 if USE_CHAPOLY
551   SUBDIRS += plugins/chapoly
552 if MONOLITHIC
553   libstrongswan_la_LIBADD += plugins/chapoly/libstrongswan-chapoly.la
554 endif
555 endif
556
557 if USE_CTR
558   SUBDIRS += plugins/ctr
559 if MONOLITHIC
560   libstrongswan_la_LIBADD += plugins/ctr/libstrongswan-ctr.la
561 endif
562 endif
563
564 if USE_CCM
565   SUBDIRS += plugins/ccm
566 if MONOLITHIC
567   libstrongswan_la_LIBADD += plugins/ccm/libstrongswan-ccm.la
568 endif
569 endif
570
571 if USE_GCM
572   SUBDIRS += plugins/gcm
573 if MONOLITHIC
574   libstrongswan_la_LIBADD += plugins/gcm/libstrongswan-gcm.la
575 endif
576 endif
577
578 if USE_NTRU
579   SUBDIRS += plugins/ntru
580 if MONOLITHIC
581   libstrongswan_la_LIBADD += plugins/ntru/libstrongswan-ntru.la
582 endif
583 endif
584
585 if USE_BLISS
586   SUBDIRS += plugins/bliss
587 if MONOLITHIC
588   libstrongswan_la_LIBADD += plugins/bliss/libstrongswan-bliss.la
589 endif
590 endif
591
592 if USE_TEST_VECTORS
593   SUBDIRS += plugins/test_vectors
594 if MONOLITHIC
595   libstrongswan_la_LIBADD += plugins/test_vectors/libstrongswan-test-vectors.la
596 endif
597 endif
598
599 if MONOLITHIC
600   SUBDIRS += .
601 endif
602 SUBDIRS += tests
603 if USE_BLISS
604   SUBDIRS += plugins/bliss/tests
605 endif