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