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