Check if libpthread is required or not.
[strongswan.git] / src / libstrongswan / Makefile.am
1 lib_LTLIBRARIES = libstrongswan.la
2
3 libstrongswan_la_SOURCES = \
4 library.c library.h \
5 chunk.c chunk.h \
6 debug.c debug.h \
7 enum.c enum.h \
8 settings.h settings.c \
9 printf_hook.c printf_hook.h \
10 asn1/asn1.c asn1/asn1.h \
11 asn1/asn1_parser.c asn1/asn1_parser.h \
12 asn1/oid.c asn1/oid.h \
13 attributes/attributes.c attributes/attributes.h \
14 attributes/attribute_provider.h attributes/attribute_handler.h \
15 attributes/attribute_manager.c attributes/attribute_manager.h \
16 crypto/crypters/crypter.c crypto/crypters/crypter.h \
17 crypto/hashers/hasher.h crypto/hashers/hasher.c \
18 crypto/pkcs9.c crypto/pkcs9.h \
19 crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords.h \
20 crypto/prfs/prf.c crypto/prfs/prf.h \
21 crypto/rngs/rng.c crypto/rngs/rng.h \
22 crypto/prf_plus.h crypto/prf_plus.c \
23 crypto/signers/signer.c crypto/signers/signer.h \
24 crypto/crypto_factory.c crypto/crypto_factory.h \
25 crypto/crypto_tester.c crypto/crypto_tester.h \
26 crypto/diffie_hellman.c crypto/diffie_hellman.h \
27 crypto/transform.c crypto/transform.h \
28 credentials/credential_factory.c credentials/credential_factory.h \
29 credentials/builder.c credentials/builder.h \
30 credentials/keys/key_encoding.c credentials/keys/key_encoding.h \
31 credentials/keys/private_key.c credentials/keys/private_key.h \
32 credentials/keys/public_key.c credentials/keys/public_key.h \
33 credentials/keys/shared_key.c credentials/keys/shared_key.h \
34 credentials/certificates/certificate.c credentials/certificates/certificate.h \
35 credentials/certificates/x509.h credentials/certificates/x509.c \
36 credentials/certificates/ac.h \
37 credentials/certificates/crl.h credentials/certificates/crl.c \
38 credentials/certificates/pkcs10.h \
39 credentials/certificates/ocsp_request.h \
40 credentials/certificates/ocsp_response.h credentials/certificates/ocsp_response.c \
41 credentials/certificates/pgp_certificate.h \
42 credentials/ietf_attributes/ietf_attributes.c credentials/ietf_attributes/ietf_attributes.h \
43 database/database.h database/database_factory.h database/database_factory.c \
44 fetcher/fetcher.h fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
45 selectors/traffic_selector.c selectors/traffic_selector.h \
46 threading/mutex.h threading/mutex.c threading/condvar.h  \
47 threading/rwlock.h threading/rwlock.c \
48 threading/lock_profiler.h \
49 utils.h utils.c \
50 utils/host.c utils/host.h \
51 utils/identification.c utils/identification.h \
52 utils/iterator.h \
53 utils/lexparser.c utils/lexparser.h \
54 utils/linked_list.c utils/linked_list.h \
55 utils/hashtable.c utils/hashtable.h \
56 utils/enumerator.c utils/enumerator.h \
57 utils/optionsfrom.c utils/optionsfrom.h \
58 utils/backtrace.c utils/backtrace.h \
59 plugins/plugin_loader.c plugins/plugin_loader.h plugins/plugin.h
60
61 libstrongswan_la_LIBADD = $(PTHREADLIB) $(DLLIB) $(BTLIB) $(SOCKLIB) $(RTLIB)
62
63 INCLUDES = -I$(top_srcdir)/src/libstrongswan
64 AM_CFLAGS = \
65 -DIPSEC_DIR=\"${ipsecdir}\" \
66 -DPLUGINDIR=\"${plugindir}\" \
67 -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
68
69 if USE_LEAK_DETECTIVE
70   AM_CFLAGS += -DLEAK_DETECTIVE
71   libstrongswan_la_SOURCES += \
72     utils/leak_detective.c utils/leak_detective.h
73 endif
74
75 if USE_LOCK_PROFILER
76   AM_CFLAGS += -DLOCK_PROFILER
77 endif
78
79 if USE_INTEGRITY_TEST
80   AM_CFLAGS += -DINTEGRITY_TEST
81   libstrongswan_la_SOURCES += \
82     integrity_checker.c integrity_checker.h
83 endif
84
85 if USE_VSTR
86   libstrongswan_la_LIBADD += -lvstr
87 endif
88
89 EXTRA_DIST = \
90 asn1/oid.txt asn1/oid.pl \
91 crypto/proposal/proposal_keywords.txt
92
93 BUILT_SOURCES = \
94 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
95 $(srcdir)/crypto/proposal/proposal_keywords.c
96
97 MAINTAINERCLEANFILES = \
98 $(srcdir)/asn1/oid.c $(srcdir)/asn1/oid.h \
99 $(srcdir)/crypto/proposal/proposal_keywords.c
100
101 $(srcdir)/asn1/oid.c :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
102                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
103
104 $(srcdir)/asn1/oid.h :  $(srcdir)/asn1/oid.pl $(srcdir)/asn1/oid.txt
105                 (cd $(srcdir)/asn1/ && $(PERL) oid.pl)
106
107 $(srcdir)/crypto/proposal/proposal_keywords.c:  $(srcdir)/crypto/proposal/proposal_keywords.txt \
108                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords.h
109                 $(GPERF) -N proposal_get_token -m 10 -C -G -c -t -D < \
110                                                                                                 $(srcdir)/crypto/proposal/proposal_keywords.txt > $@
111
112
113 # build plugins with their own Makefile
114 #######################################
115
116 SUBDIRS = .
117
118 if USE_AES
119   SUBDIRS += plugins/aes
120 endif
121
122 if USE_DES
123   SUBDIRS += plugins/des
124 endif
125
126 if USE_BLOWFISH
127   SUBDIRS += plugins/blowfish
128 endif
129
130 if USE_MD4
131   SUBDIRS += plugins/md4
132 endif
133
134 if USE_MD5
135   SUBDIRS += plugins/md5
136 endif
137
138 if USE_SHA1
139   SUBDIRS += plugins/sha1
140 endif
141
142 if USE_SHA2
143   SUBDIRS += plugins/sha2
144 endif
145
146 if USE_FIPS_PRF
147   SUBDIRS += plugins/fips_prf
148 endif
149
150 if USE_GMP
151   SUBDIRS += plugins/gmp
152 endif
153
154 if USE_RANDOM
155   SUBDIRS += plugins/random
156 endif
157
158 if USE_HMAC
159   SUBDIRS += plugins/hmac
160 endif
161
162 if USE_XCBC
163   SUBDIRS += plugins/xcbc
164 endif
165
166 if USE_X509
167   SUBDIRS += plugins/x509
168 endif
169
170 if USE_PUBKEY
171   SUBDIRS += plugins/pubkey
172 endif
173
174 if USE_PKCS1
175   SUBDIRS += plugins/pkcs1
176 endif
177
178 if USE_PGP
179   SUBDIRS += plugins/pgp
180 endif
181
182 if USE_DNSKEY
183   SUBDIRS += plugins/dnskey
184 endif
185
186 if USE_PEM
187   SUBDIRS += plugins/pem
188 endif
189
190 if USE_CURL
191   SUBDIRS += plugins/curl
192 endif
193
194 if USE_LDAP
195   SUBDIRS += plugins/ldap
196 endif
197
198 if USE_MYSQL
199   SUBDIRS += plugins/mysql
200 endif
201
202 if USE_SQLITE
203   SUBDIRS += plugins/sqlite
204 endif
205
206 if USE_ATTR_SQL
207   SUBDIRS += plugins/attr_sql
208 endif
209
210 if USE_PADLOCK
211   SUBDIRS += plugins/padlock
212 endif
213
214 if USE_OPENSSL
215   SUBDIRS += plugins/openssl
216 endif
217
218 if USE_GCRYPT
219   SUBDIRS += plugins/gcrypt
220 endif
221
222 if USE_AGENT
223   SUBDIRS += plugins/agent
224 endif
225
226 if USE_TEST_VECTORS
227   SUBDIRS += plugins/test_vectors
228 endif