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