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