]> git.ipfire.org Git - thirdparty/strongswan.git/blame - configure.in
implemented a monotonic timestamping function, unaffected from system time changes
[thirdparty/strongswan.git] / configure.in
CommitLineData
f2c2d395
MW
1dnl configure.in for linux strongSwan
2dnl Copyright (C) 2006 Martin Willi
3dnl Hochschule fuer Technik Rapperswil
4dnl
5dnl This program is free software; you can redistribute it and/or modify it
6dnl under the terms of the GNU General Public License as published by the
7dnl Free Software Foundation; either version 2 of the License, or (at your
8dnl option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9dnl
10dnl This program is distributed in the hope that it will be useful, but
11dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13dnl for more details.
14
15dnl ===========================
16dnl initialize & set some vars
17dnl ===========================
18
8bc2a808 19AC_INIT(strongSwan,4.3.5)
5e5f0bd4 20AM_INIT_AUTOMAKE(tar-ustar)
f2c2d395 21AC_SUBST(confdir, '${sysconfdir}')
a47486b5 22PKG_PROG_PKG_CONFIG
f2c2d395 23
db26d00e
MW
24dnl =================================
25dnl check --enable-xxx & --with-xxx
26dnl =================================
27
db26d00e 28AC_ARG_WITH(
6b9290ff
MW
29 [default-pkcs11],
30 AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than "/usr/lib/opensc-pkcs11.so"]),
31 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")],
32 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")]
db26d00e
MW
33)
34
195307b5 35AC_ARG_WITH(
6b9290ff
MW
36 [xauth-module],
37 AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]),
38 [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")],
195307b5
AS
39)
40
db26d00e 41AC_ARG_WITH(
6b9290ff
MW
42 [random-device],
43 AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than "/dev/random"]),
44 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")],
45 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")]
db26d00e 46)
c60c7694 47AC_ARG_WITH(
6b9290ff 48 [resolv-conf],
adc25ec2 49 AS_HELP_STRING([--with-resolv-conf=file],[set the file to use in DNS handler plugin other than "sysconfdir/resolv.conf"]),
8cc16c9d
AS
50 [AC_SUBST(resolv_conf, "$withval")],
51 [AC_SUBST(resolv_conf, "${sysconfdir}/resolv.conf")]
c60c7694 52)
db26d00e 53
ff867d06
MW
54AC_ARG_WITH(
55 [strongswan-conf],
56 AS_HELP_STRING([--with-strongswan-conf=file],[strongswan.conf file other than "sysconfdir/strongswan.conf"]),
8cc16c9d
AS
57 [AC_SUBST(strongswan_conf, "$withval")],
58 [AC_SUBST(strongswan_conf, "${sysconfdir}/strongswan.conf")]
ff867d06
MW
59)
60
db26d00e 61AC_ARG_WITH(
6b9290ff
MW
62 [urandom-device],
63 AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than "/dev/urandom"]),
64 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")],
65 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")]
db26d00e 66)
f2c2d395 67
dfc14c84 68AC_ARG_WITH(
6b9290ff
MW
69 [piddir],
70 AS_HELP_STRING([--with-piddir=dir],[path for PID and UNIX socket files other than "/var/run"]),
71 [AC_SUBST(piddir, "$withval")],
72 [AC_SUBST(piddir, "/var/run")]
dfc14c84
AS
73)
74
f27f6296 75AC_ARG_WITH(
6b9290ff
MW
76 [ipsecdir],
77 AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]),
78 [AC_SUBST(ipsecdir, "$withval")],
c5ebb635 79 [AC_SUBST(ipsecdir, "${libexecdir%/}/ipsec")]
f27f6296 80)
c5ebb635 81AC_SUBST(plugindir, "${ipsecdir%/}/plugins")
f27f6296
MW
82
83AC_ARG_WITH(
6b9290ff
MW
84 [plugindir],
85 AS_HELP_STRING([--with-plugindir=dir],[installation path for plugins other than "ipsecdir/plugins"]),
86 [AC_SUBST(plugindir, "$withval")],
c5ebb635 87 [AC_SUBST(plugindir, "${ipsecdir%/}/plugins")]
f27f6296
MW
88)
89
d560c849 90AC_ARG_WITH(
6b9290ff
MW
91 [sim-reader],
92 AS_HELP_STRING([--with-sim-reader=library.so],[library containing the sim_run_alg()/sim_get_triplet() function for EAP-SIM]),
93 [AC_SUBST(simreader, "$withval")],
c5ebb635 94 [AC_SUBST(simreader, "${plugindir%/}/libeapsim-file.so")]
d560c849
MW
95)
96
04a7b6d8 97AC_ARG_WITH(
6b9290ff
MW
98 [linux-headers],
99 AS_HELP_STRING([--with-linux-headers=dir],[use the linux header files in dir instead of the supplied ones in "src/include"]),
507f26f6 100 [AC_SUBST(linuxdir, "$withval")], [AC_SUBST(linuxdir, "\${top_srcdir}/src/include")]
04a7b6d8
MW
101)
102AC_SUBST(LINUX_HEADERS)
103
4e411c83 104AC_ARG_WITH(
6b9290ff
MW
105 [routing-table],
106 AS_HELP_STRING([--with-routing-table=num],[use routing table for IPsec routes (default: 220)]),
107 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, $withval) AC_SUBST(IPSEC_ROUTING_TABLE, "$withval")],
108 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, 220) AC_SUBST(IPSEC_ROUTING_TABLE, "220")]
0739cca9
MW
109)
110
111AC_ARG_WITH(
6b9290ff
MW
112 [routing-table-prio],
113 AS_HELP_STRING([--with-routing-table-prio=prio],[priority for IPsec routing table (default: 220)]),
114 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, $withval) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "$withval")],
115 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, 220) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "220")]
4e411c83
MW
116)
117
6874bf69 118AC_ARG_WITH(
25b12c69 119 [uid],,[AC_MSG_ERROR([--with-uid is gone, use --with-user instead!])]
6874bf69
MW
120)
121
122AC_ARG_WITH(
25b12c69
MW
123 [gid],,[AC_MSG_ERROR([--with-gid is gone, use --with-group instead!])]
124)
125
126AC_ARG_WITH(
127 [user],
c7e0f07c 128 AS_HELP_STRING([--with-user=user],[change user of the daemons to "user" after startup (default is "root").]),
25b12c69
MW
129 [AC_DEFINE_UNQUOTED(IPSEC_USER, "$withval") AC_SUBST(ipsecuser, "$withval")],
130 [AC_SUBST(ipsecuser, "root")]
131)
132
133AC_ARG_WITH(
134 [group],
c7e0f07c 135 AS_HELP_STRING([--with-group=group],[change group of the daemons to "group" after startup (default is "root").]),
25b12c69
MW
136 [AC_DEFINE_UNQUOTED(IPSEC_GROUP, "$withval") AC_SUBST(ipsecgroup, "$withval")],
137 [AC_SUBST(ipsecgroup, "root")]
6874bf69
MW
138)
139
eb3e2705
MW
140dnl Will be extended to --with-capabilities=libcap|libcap2
141AC_ARG_WITH(
142 [capabilities],
143 AS_HELP_STRING([--with-capabilities=libcap],[capability dropping using libcap. Currenlty only the value "libcap" is supported (default is NO).]),
144 [capabilities="$withval"],
145 [capabilities=no]
146)
147
f2c2d395 148AC_ARG_ENABLE(
6b9290ff
MW
149 [curl],
150 AS_HELP_STRING([--enable-curl],[enable CURL fetcher plugin to fetch files via libcurl (default is NO). Requires libcurl.]),
151 [if test x$enableval = xyes; then
152 curl=true
153 fi]
f2c2d395 154)
f2c2d395
MW
155
156AC_ARG_ENABLE(
6b9290ff
MW
157 [ldap],
158 AS_HELP_STRING([--enable-ldap],[enable LDAP fetching plugin to fetch files via libldap (default is NO). Requires openLDAP.]),
159 [if test x$enableval = xyes; then
160 ldap=true
161 fi]
f2c2d395 162)
552cc11b
MW
163
164AC_ARG_ENABLE(
6b9290ff
MW
165 [aes],
166 AS_HELP_STRING([--disable-aes],[disable own AES software implementation plugin. (default is NO).]),
167 [if test x$enableval = xyes; then
168 aes=true
169 else
170 aes=false
171 fi],
172 aes=true
552cc11b 173)
552cc11b
MW
174
175AC_ARG_ENABLE(
6b9290ff
MW
176 [des],
177 AS_HELP_STRING([--disable-des],[disable own DES/3DES software implementation plugin. (default is NO).]),
178 [if test x$enableval = xyes; then
179 des=true
180 else
181 des=false
182 fi],
183 des=true
552cc11b 184)
552cc11b 185
d36ae9e3
AS
186AC_ARG_ENABLE(
187 [blowfish],
188 AS_HELP_STRING([--enable-blowfish],[enable Blowfish software implementation plugin (default is NO).]),
189 [if test x$enableval = xyes; then
190 blowfish=true
191 fi]
192)
193
1e0d1ae2
AS
194AC_ARG_ENABLE(
195 [md4],
196 AS_HELP_STRING([--enable-md4],[enable MD4 software implementation plugin (default is NO).]),
197 [if test x$enableval = xyes; then
198 md4=true
199 fi]
200)
201
552cc11b 202AC_ARG_ENABLE(
6b9290ff
MW
203 [md5],
204 AS_HELP_STRING([--disable-md5],[disable own MD5 software implementation plugin. (default is NO).]),
205 [if test x$enableval = xyes; then
206 md5=true
207 else
208 md5=false
209 fi],
210 md5=true
552cc11b 211)
552cc11b
MW
212
213AC_ARG_ENABLE(
6b9290ff
MW
214 [sha1],
215 AS_HELP_STRING([--disable-sha1],[disable own SHA1 software implementation plugin. (default is NO).]),
216 [if test x$enableval = xyes; then
217 sha1=true
218 else
219 sha1=false
220 fi],
221 sha1=true
552cc11b 222)
552cc11b
MW
223
224AC_ARG_ENABLE(
6b9290ff
MW
225 [sha2],
226 AS_HELP_STRING([--disable-sha2],[disable own SHA256/SHA384/SHA512 software implementation plugin. (default is NO).]),
227 [if test x$enableval = xyes; then
228 sha2=true
229 else
230 sha2=false
231 fi],
232 sha2=true
552cc11b 233)
552cc11b
MW
234
235AC_ARG_ENABLE(
6b9290ff
MW
236 [fips-prf],
237 AS_HELP_STRING([--disable-fips-prf],[disable FIPS PRF software implementation plugin. (default is NO).]),
238 [if test x$enableval = xyes; then
239 fips_prf=true
240 else
241 fips_prf=false
242 fi],
243 fips_prf=true
552cc11b 244)
552cc11b
MW
245
246AC_ARG_ENABLE(
6b9290ff
MW
247 [gmp],
248 AS_HELP_STRING([--disable-gmp],[disable own GNU MP (libgmp) based crypto implementation plugin. (default is NO).]),
249 [if test x$enableval = xyes; then
250 gmp=true
251 else
252 gmp=false
253 fi],
254 gmp=true
552cc11b 255)
552cc11b 256
6a365f07
MW
257AC_ARG_ENABLE(
258 [random],
259 AS_HELP_STRING([--disable-random],[disable RNG implementation on top of /dev/(u)random. (default is NO).]),
260 [if test x$enableval = xyes; then
261 random=true
262 else
263 random=false
264 fi],
265 random=true
266)
267
552cc11b 268AC_ARG_ENABLE(
6b9290ff
MW
269 [x509],
270 AS_HELP_STRING([--disable-x509],[disable own X509 certificate implementation plugin. (default is NO).]),
271 [if test x$enableval = xyes; then
272 x509=true
273 else
274 x509=false
275 fi],
276 x509=true
552cc11b 277)
552cc11b 278
affd7a90
MW
279AC_ARG_ENABLE(
280 [pubkey],
281 AS_HELP_STRING([--disable-pubkey],[disable RAW public key support plugin. (default is NO).]),
282 [if test x$enableval = xyes; then
283 pubkey=true
284 else
285 pubkey=false
286 fi],
287 pubkey=true
288)
289
1e0f6937
MW
290AC_ARG_ENABLE(
291 [pkcs1],
ca275b38 292 AS_HELP_STRING([--disable-pkcs1],[disable PKCS1 key decoding plugin. (default is NO).]),
1e0f6937
MW
293 [if test x$enableval = xyes; then
294 pkcs1=true
295 else
296 pkcs1=false
297 fi],
298 pkcs1=true
299)
300
9493dd2c
MW
301AC_ARG_ENABLE(
302 [pgp],
ca275b38 303 AS_HELP_STRING([--disable-pgp],[disable PGP key decoding plugin. (default is NO).]),
9493dd2c
MW
304 [if test x$enableval = xyes; then
305 pgp=true
306 else
307 pgp=false
308 fi],
309 pgp=true
310)
311
5ef478aa
MW
312AC_ARG_ENABLE(
313 [dnskey],
314 AS_HELP_STRING([--disable-dnskey],[disable DNS RR key decoding plugin. (default is NO).]),
315 [if test x$enableval = xyes; then
316 dnskey=true
317 else
318 dnskey=false
319 fi],
320 dnskey=true
321)
322
160f4c22
MW
323AC_ARG_ENABLE(
324 [pem],
325 AS_HELP_STRING([--disable-pem],[disable PEM decoding plugin. (default is NO).]),
326 [if test x$enableval = xyes; then
327 pem=true
328 else
329 pem=false
330 fi],
331 pem=true
332)
333
552cc11b 334AC_ARG_ENABLE(
6b9290ff
MW
335 [hmac],
336 AS_HELP_STRING([--disable-hmac],[disable HMAC crypto implementation plugin. (default is NO).]),
337 [if test x$enableval = xyes; then
338 hmac=true
339 else
340 hmac=false
341 fi],
342 hmac=true
552cc11b 343)
552cc11b 344
27d04e05
MW
345AC_ARG_ENABLE(
346 [xcbc],
347 AS_HELP_STRING([--disable-xcbc],[disable xcbc crypto implementation plugin. (default is NO).]),
348 [if test x$enableval = xyes; then
349 xcbc=true
350 else
351 xcbc=false
352 fi],
353 xcbc=true
354)
355
81811a9d
MW
356AC_ARG_ENABLE(
357 [test-vectors],
272c8113 358 AS_HELP_STRING([--enable-test-vectors],[enable plugin providing crypto test vectors (default is NO).]),
81811a9d
MW
359 [if test x$enableval = xyes; then
360 test_vectors=true
361 fi]
362)
363
552cc11b 364AC_ARG_ENABLE(
6b9290ff
MW
365 [mysql],
366 AS_HELP_STRING([--enable-mysql],[enable MySQL database support (default is NO). Requires libmysqlclient_r.]),
367 [if test x$enableval = xyes; then
368 mysql=true
369 fi]
552cc11b 370)
552cc11b
MW
371
372AC_ARG_ENABLE(
6b9290ff
MW
373 [sqlite],
374 AS_HELP_STRING([--enable-sqlite],[enable SQLite database support (default is NO). Requires libsqlite3.]),
375 [if test x$enableval = xyes; then
376 sqlite=true
377 fi]
552cc11b 378)
f2c2d395 379
cbfb2aff 380AC_ARG_ENABLE(
6b9290ff
MW
381 [stroke],
382 AS_HELP_STRING([--disable-stroke],[disable charons stroke (pluto compatibility) configuration backend. (default is NO).]),
383 [if test x$enableval = xyes; then
384 stroke=true
385 else
386 stroke=false
387 fi],
388 stroke=true
cbfb2aff 389)
cbfb2aff 390
552cc11b 391AC_ARG_ENABLE(
5b7ec6d4 392 [medsrv],
9529fb68 393 AS_HELP_STRING([--enable-medsrv],[enable mediation server web frontend and daemon plugin (default is NO).]),
6b9290ff 394 [if test x$enableval = xyes; then
5b7ec6d4 395 medsrv=true
6b9290ff 396 fi]
552cc11b 397)
552cc11b 398
782db7ed
MW
399AC_ARG_ENABLE(
400 [medcli],
401 AS_HELP_STRING([--enable-medcli],[enable mediation client configuration database plugin (default is NO).]),
402 [if test x$enableval = xyes; then
403 medcli=true
404 fi]
405)
406
a84fb01b 407AC_ARG_ENABLE(
6b9290ff
MW
408 [smp],
409 AS_HELP_STRING([--enable-smp],[enable SMP configuration and control interface (default is NO). Requires libxml.]),
410 [if test x$enableval = xyes; then
411 smp=true
412 fi]
a84fb01b 413)
a84fb01b
MW
414
415AC_ARG_ENABLE(
6b9290ff
MW
416 [sql],
417 AS_HELP_STRING([--enable-sql],[enable SQL database configuration backend (default is NO).]),
418 [if test x$enableval = xyes; then
419 sql=true
420 fi]
a84fb01b 421)
a84fb01b 422
8f561d44 423AC_ARG_ENABLE(
6b9290ff
MW
424 [smartcard],
425 AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]),
426 [if test x$enableval = xyes; then
427 smartcard=true
428 fi]
8f561d44 429)
8f561d44 430
f2c2d395 431AC_ARG_ENABLE(
6b9290ff
MW
432 [cisco-quirks],
433 AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]),
434 [if test x$enableval = xyes; then
435 cisco_quirks=true
436 fi]
f2c2d395 437)
f2c2d395 438
2df45a73 439AC_ARG_ENABLE(
6b9290ff
MW
440 [leak-detective],
441 AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
442 [if test x$enableval = xyes; then
443 leak_detective=true
444 fi]
2df45a73 445)
2df45a73 446
02140125
MW
447AC_ARG_ENABLE(
448 [lock-profiler],
fc3ef71f 449 AS_HELP_STRING([--enable-lock-profiler],[enable lock/mutex profiling code (default is NO).]),
02140125
MW
450 [if test x$enableval = xyes; then
451 lock_profiler=true
452 fi]
453)
454
f2c2d395 455AC_ARG_ENABLE(
6b9290ff
MW
456 [unit-tests],
457 AS_HELP_STRING([--enable-unit-tests],[enable unit tests on IKEv2 daemon startup (default is NO).]),
458 [if test x$enableval = xyes; then
459 unittest=true
460 fi]
f2c2d395 461)
f2c2d395 462
0fd6e955
MW
463AC_ARG_ENABLE(
464 [load-tests],
465 AS_HELP_STRING([--enable-load-tests],[enable load testing plugin for IKEv2 daemon (default is NO).]),
466 [if test x$enableval = xyes; then
467 loadtest=true
468 fi]
469)
470
552cc11b 471AC_ARG_ENABLE(
6b9290ff
MW
472 [eap-sim],
473 AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]),
474 [if test x$enableval = xyes; then
475 eap_sim=true
476 fi]
552cc11b 477)
552cc11b 478
79a87846
MW
479AC_ARG_ENABLE(
480 [eap-sim-file],
481 AS_HELP_STRING([--enable-eap-sim-file],[build EAP-SIM backend based on a triplet file (default is NO).]),
482 [if test x$enableval = xyes; then
483 eap_sim_file=true
484 fi]
485)
486
b0f24449 487AC_ARG_ENABLE(
6b9290ff
MW
488 [eap-identity],
489 AS_HELP_STRING([--enable-eap-identity],[build EAP module providing EAP-Identity helper (default is NO).]),
490 [if test x$enableval = xyes; then
491 eap_identity=true
492 fi]
b0f24449 493)
cbfb2aff
MW
494
495AC_ARG_ENABLE(
6b9290ff
MW
496 [eap-md5],
497 AS_HELP_STRING([--enable-eap-md5],[build MD5 (CHAP) authenication module for EAP (default is NO).]),
498 [if test x$enableval = xyes; then
499 eap_md5=true
500 fi]
cbfb2aff 501)
26e24676 502
1caa265c
MW
503AC_ARG_ENABLE(
504 [eap-gtc],
505 AS_HELP_STRING([--enable-eap-gtc],[build PAM based GTC authenication module for EAP (default is NO).]),
506 [if test x$enableval = xyes; then
507 eap_gtc=true
508 fi]
509)
510
26e24676 511AC_ARG_ENABLE(
6b9290ff
MW
512 [eap-aka],
513 AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
514 [if test x$enableval = xyes; then
515 eap_aka=true
516 fi]
26e24676 517)
b0f24449 518
f98cdf7a
TB
519AC_ARG_ENABLE(
520 [eap-mschapv2],
521 AS_HELP_STRING([--enable-eap-mschapv2],[build MS-CHAPv2 authenication module for EAP (default is NO).]),
522 [if test x$enableval = xyes; then
523 eap_mschapv2=true
524 fi]
525)
526
4a6b84a9
MW
527AC_ARG_ENABLE(
528 [eap-radius],
529 AS_HELP_STRING([--enable-eap-radius],[build RADIUS proxy authenication module for EAP (default is NO).]),
530 [if test x$enableval = xyes; then
531 eap_radius=true
532 fi]
533)
534
09d7ef26
AS
535AC_ARG_ENABLE(
536 [kernel-netlink],
537 AS_HELP_STRING([--disable-kernel-netlink],[disable the netlink kernel interface. (default is NO).]),
538 [if test x$enableval = xyes; then
539 kernel_netlink=true
540 else
541 kernel_netlink=false
542 fi],
543 kernel_netlink=true
544)
545
1adaa02b
TB
546AC_ARG_ENABLE(
547 [kernel-pfkey],
548 AS_HELP_STRING([--enable-kernel-pfkey],[enable the PF_KEY kernel interface. (default is NO).]),
549 [if test x$enableval = xyes; then
550 kernel_pfkey=true
551 fi]
552)
553
ea7e89c7
TB
554AC_ARG_ENABLE(
555 [kernel-pfroute],
556 AS_HELP_STRING([--enable-kernel-pfroute],[enable the PF_ROUTE kernel interface. (default is NO).]),
557 [if test x$enableval = xyes; then
558 kernel_pfroute=true
559 fi]
560)
561
ea625fab
TB
562AC_ARG_ENABLE(
563 [kernel-klips],
564 AS_HELP_STRING([--enable-kernel-klips],[enable the KLIPS kernel interface. (default is NO).]),
565 [if test x$enableval = xyes; then
566 kernel_klips=true
567 fi]
568)
569
7b0c588a 570AC_ARG_ENABLE(
6b9290ff
MW
571 [nat-transport],
572 AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
573 [if test x$enableval = xyes; then
574 nat_transport=true
575 fi]
7b0c588a 576)
7b0c588a
AS
577
578AC_ARG_ENABLE(
6b9290ff
MW
579 [vendor-id],
580 AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
581 [if test x$enableval = xyes; then
582 vendor_id=true
583 else
584 vendor_id=false
585 fi],
586 vendor_id=true
7b0c588a 587)
7b0c588a 588
0e307360 589AC_ARG_ENABLE(
6b9290ff
MW
590 [xauth-vid],
591 AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
592 [if test x$enableval = xyes; then
593 xauth_vid=true
594 else
595 xauth_vid=false
596 fi],
597 xauth_vid=true
0e307360 598)
0e307360 599
fd4ded97 600AC_ARG_ENABLE(
6b9290ff
MW
601 [dumm],
602 AS_HELP_STRING([--enable-dumm],[build the DUMM UML test framework (default is NO).]),
603 [if test x$enableval = xyes; then
604 dumm=true
605 fi]
fd4ded97 606)
fd4ded97 607
552cc11b 608AC_ARG_ENABLE(
6b9290ff
MW
609 [fast],
610 AS_HELP_STRING([--enable-fast],[build libfast (FastCGI Application Server w/ templates (default is NO).]),
611 [if test x$enableval = xyes; then
612 fast=true
613 fi]
552cc11b 614)
552cc11b 615
b8c7453a 616AC_ARG_ENABLE(
6b9290ff
MW
617 [manager],
618 AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
619 [if test x$enableval = xyes; then
620 manager=true
621 xml=true
622 fi]
b8c7453a 623)
b8c7453a 624
d5cc1758 625AC_ARG_ENABLE(
6b9290ff
MW
626 [mediation],
627 AS_HELP_STRING([--enable-mediation],[enable IKEv2 Mediation Extension (default is NO).]),
628 [if test x$enableval = xyes; then
629 me=true
630 fi]
d5cc1758 631)
d5cc1758 632
9ee1111d 633AC_ARG_ENABLE(
6b9290ff 634 [integrity-test],
e3b7be91 635 AS_HELP_STRING([--enable-integrity-test],[enable integrity testing of libstrongswan and plugins (default is NO).]),
6b9290ff
MW
636 [if test x$enableval = xyes; then
637 integrity_test=true
638 fi]
9ee1111d 639)
9ee1111d 640
733f336a 641AC_ARG_ENABLE(
6b9290ff
MW
642 [pluto],
643 AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
644 [if test x$enableval = xyes; then
645 pluto=true
646 else
647 pluto=false
648 fi],
649 pluto=true
cbfb2aff 650)
cbfb2aff 651
6905f794
MW
652AC_ARG_ENABLE(
653 [threads],
654 AS_HELP_STRING([--disable-threads],[disable the use of threads in pluto. Charon always uses threads. (default is NO).]),
655 [if test x$enableval = xyes; then
656 threads=true
657 else
658 threads=false
659 fi],
660 threads=true
661)
662
cbfb2aff 663AC_ARG_ENABLE(
6b9290ff
MW
664 [charon],
665 AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
666 [if test x$enableval = xyes; then
667 charon=true
668 else
669 charon=false
670 fi],
671 charon=true
cbfb2aff 672)
cbfb2aff
MW
673
674AC_ARG_ENABLE(
6b9290ff 675 [tools],
7c577c8e 676 AS_HELP_STRING([--disable-tools],[disable additional utilities (openac, scepclient and pki). (default is NO).]),
6b9290ff
MW
677 [if test x$enableval = xyes; then
678 tools=true
679 else
680 tools=false
681 fi],
682 tools=true
733f336a 683)
733f336a 684
cf00cffe
TB
685AC_ARG_ENABLE(
686 [scripts],
687 AS_HELP_STRING([--disable-scripts],[disable additional utilities (found in directory scripts). (default is NO).]),
688 [if test x$enableval = xyes; then
689 scripts=true
690 else
691 scripts=false
692 fi],
693 scripts=true
694)
695
1e9c46f1
MW
696AC_ARG_ENABLE(
697 [updown],
ad3af574 698 AS_HELP_STRING([--disable-updown],[disable updown firewall script plugin. (default is NO).]),
1e9c46f1
MW
699 [if test x$enableval = xyes; then
700 updown=true
701 else
702 updown=false
703 fi],
704 updown=true
705)
706
adc25ec2
MW
707AC_ARG_ENABLE(
708 [attr],
709 AS_HELP_STRING([--disable-attr],[disable strongswan.conf based configuration attribute plugin. (default is NO).]),
710 [if test x$enableval = xyes; then
711 attr=true
712 else
713 attr=false
714 fi],
715 attr=true
716)
717
718AC_ARG_ENABLE(
719 [resolv-conf],
720 AS_HELP_STRING([--disable-resolv-conf],[disable resolv.conf DNS handler plugin. (default is NO).]),
721 [if test x$enableval = xyes; then
722 resolvconf=true
723 else
724 resolvconf=false
725 fi],
726 resolvconf=true
727)
728
36d62fac
MW
729AC_ARG_ENABLE(
730 [padlock],
731 AS_HELP_STRING([--enable-padlock],[enables VIA Padlock crypto plugin. (default is NO).]),
732 [if test x$enableval = xyes; then
733 padlock=true
734 else
735 padlock=false
736 fi],
737)
738
17353034
TB
739AC_ARG_ENABLE(
740 [openssl],
741 AS_HELP_STRING([--enable-openssl],[enables the OpenSSL crypto plugin. (default is NO).]),
742 [if test x$enableval = xyes; then
743 openssl=true
744 else
745 openssl=false
746 fi],
747)
748
4977018c
MW
749AC_ARG_ENABLE(
750 [gcrypt],
751 AS_HELP_STRING([--enable-gcrypt],[enables the libgcrypt plugin. (default is NO).]),
752 [if test x$enableval = xyes; then
753 gcrypt=true
754 else
755 gcrypt=false
756 fi],
757)
758
21c95463
MW
759AC_ARG_ENABLE(
760 [agent],
761 AS_HELP_STRING([--enable-agent],[enables the ssh-agent signing plugin. (default is NO).]),
762 [if test x$enableval = xyes; then
763 agent=true
764 else
765 agent=false
766 fi],
767)
768
61c46386
MW
769AC_ARG_ENABLE(
770 [uci],
771 AS_HELP_STRING([--enable-uci],[enable OpenWRT UCI configuration plugin (default is NO).]),
772 [if test x$enableval = xyes; then
773 uci=true
774 fi]
775)
776
6dbce9c8
MW
777AC_ARG_ENABLE(
778 [nm],
779 AS_HELP_STRING([--enable-nm],[enable NetworkManager plugin (default is NO).]),
780 [if test x$enableval = xyes; then
781 nm=true
782 fi]
783)
784
bf45d6dd
TB
785AC_ARG_ENABLE(
786 [vstr],
787 AS_HELP_STRING([--enable-vstr],[enforce using the Vstr string library to replace glibc-like printf hooks (default is NO).]),
788 [if test x$enableval = xyes; then
789 vstr=true
790 fi]
791)
792
be0a03be
MW
793dnl =========================
794dnl set up compiler and flags
795dnl =========================
796
797if test -z "$CFLAGS"; then
f5410905 798 CFLAGS="-g -O2 -Wall -Wno-format -Wno-pointer-sign -Wno-strict-aliasing"
be0a03be
MW
799fi
800AC_PROG_CC
f5410905 801AC_LIB_PREFIX
be0a03be
MW
802AC_C_BIGENDIAN
803
f2c2d395
MW
804dnl =========================
805dnl check required programs
806dnl =========================
807
808AC_PROG_INSTALL
809AC_PROG_LIBTOOL
7d2b06da 810AC_PROG_EGREP
69fc7820 811AC_PROG_AWK
f2c2d395
MW
812AC_PROG_LEX
813AC_PROG_YACC
298b06c2 814AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
69fc7820
TB
815AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
816
817dnl because gperf is not needed by end-users we just report it but do not abort on failure
818AC_MSG_CHECKING([gperf version >= 3.0.0])
819if test -x "$GPERF"; then
820 if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
821 AC_MSG_RESULT([yes])
822 else
823 AC_MSG_RESULT([no])
824 fi
825else
826 AC_MSG_RESULT([not found])
827fi
f2c2d395 828
7d2b06da
TB
829dnl translate user/group to numercial ids
830AC_MSG_CHECKING([for uid of user "$ipsecuser"])
831ipsecuid=`id -u $ipsecuser 2>/dev/null`
832if test -n "$ipsecuid"; then
833 AC_MSG_RESULT([$ipsecuid])
834 AC_SUBST(ipsecuid)
835else
836 AC_MSG_ERROR([not found])
837fi
838AC_MSG_CHECKING([for gid of group "$ipsecgroup"])
6ff7ab85 839ipsecgid=`$EGREP "^$ipsecgroup:" /etc/group | $AWK -F: '{ print $3 }'`
7d2b06da
TB
840if test -n "$ipsecgid"; then
841 AC_MSG_RESULT([$ipsecgid])
842 AC_SUBST(ipsecgid)
843else
844 AC_MSG_ERROR([not found])
845fi
846
6b9290ff
MW
847dnl =========================
848dnl dependency calculation
849dnl =========================
f2c2d395 850
a998276a
MW
851if test x$eap_aka = xtrue; then
852 gmp=true;
853 fips_prf=true;
854 sha1=true;
855fi
856
857if test x$eap_sim = xtrue; then
858 fips_prf=true;
859fi
860
861if test x$fips_prf = xtrue; then
862 sha1=true;
863fi
864
6b9290ff
MW
865if test x$smp = xtrue; then
866 xml=true
867fi
868
869if test x$manager = xtrue; then
870 fast=true
871fi
872
782db7ed
MW
873if test x$medsrv = xtrue; then
874 me=true
9529fb68 875 fast=true
782db7ed
MW
876fi
877
878if test x$medcli = xtrue; then
879 me=true
880fi
881
a9f56adb 882dnl ===========================================
6b9290ff 883dnl check required libraries and header files
a9f56adb
TB
884dnl ===========================================
885
886AC_HEADER_STDBOOL
8b6a5ce5 887AC_FUNC_ALLOCA
6b9290ff 888
3974b2fb
TB
889dnl libraries needed on some platforms but not on others
890dnl ====================================================
ea7e89c7 891saved_LIBS=$LIBS
3974b2fb 892
26965b4e 893dnl FreeBSD and Mac OS X have dlopen integrated in libc, Linux needs libdl
ea7e89c7
TB
894LIBS=""
895AC_SEARCH_LIBS(dlopen, dl, [DLLIB=$LIBS])
ea7e89c7
TB
896AC_SUBST(DLLIB)
897
3974b2fb
TB
898dnl glibc's backtrace() can be replicated on FreeBSD with libexecinfo
899LIBS=""
900AC_SEARCH_LIBS(backtrace, execinfo, [BTLIB=$LIBS])
901AC_CHECK_FUNCS(backtrace)
902AC_SUBST(BTLIB)
903
26965b4e
TB
904dnl OpenSolaris needs libsocket and libnsl for socket()
905LIBS=""
906AC_SEARCH_LIBS(socket, socket, [SOCKLIB=$LIBS],
907 [AC_CHECK_LIB(nsl, socket, [SOCKLIB="-lsocket -lnsl"], [], [-lsocket])]
908)
909AC_SUBST(SOCKLIB)
910
3f310c0d
MW
911dnl FreeBSD has clock_gettime in libc, Linux needs librt
912LIBS=""
913AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
914AC_CHECK_FUNCS(clock_gettime)
915AC_SUBST(RTLIB)
916
3974b2fb
TB
917LIBS=$saved_LIBS
918dnl ======================
919
4f734a55
MW
920AC_MSG_CHECKING(for dladdr)
921AC_TRY_COMPILE(
922 [#define _GNU_SOURCE
923 #include <dlfcn.h>],
924 [Dl_info* info = 0;
925 dladdr(0, info);],
926 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_DLADDR])],
927 [AC_MSG_RESULT([no])]
928)
929
65ea37ab 930AC_CHECK_FUNCS(prctl)
65ea37ab 931
e580e0a9 932AC_CHECK_HEADERS(sys/sockio.h)
1e7b4b00 933AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
ea7e89c7
TB
934
935AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
936[
937 #include <sys/types.h>
938 #include <sys/socket.h>
939])
940
941AC_CHECK_MEMBERS([struct sadb_x_policy.sadb_x_policy_priority], [], [],
942[
943 #include <sys/types.h>
944 #ifdef HAVE_NET_PFKEYV2_H
945 #include <net/pfkeyv2.h>
946 #else
947 #include <stdint.h>
948 #include <linux/pfkeyv2.h>
949 #endif
950])
e696757c 951
617e59b7
TB
952AC_MSG_CHECKING([for IPSEC_MODE_BEET])
953AC_TRY_COMPILE(
a6ae2a14
TB
954 [#include <sys/types.h>
955 #ifdef HAVE_NETIPSEC_IPSEC_H
617e59b7
TB
956 #include <netipsec/ipsec.h>
957 #elif defined(HAVE_NETINET6_IPSEC_H)
958 #include <netinet6/ipsec.h>
959 #else
a6ae2a14 960 #include <stdint.h>
617e59b7
TB
961 #include <linux/ipsec.h>
962 #endif],
963 [int mode = IPSEC_MODE_BEET;
964 return mode;],
965 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_MODE_BEET])],
966 [AC_MSG_RESULT([no])]
967)
968
969AC_MSG_CHECKING([for IPSEC_DIR_FWD])
970AC_TRY_COMPILE(
a6ae2a14
TB
971 [#include <sys/types.h>
972 #ifdef HAVE_NETIPSEC_IPSEC_H
617e59b7
TB
973 #include <netipsec/ipsec.h>
974 #elif defined(HAVE_NETINET6_IPSEC_H)
975 #include <netinet6/ipsec.h>
976 #else
a6ae2a14 977 #include <stdint.h>
617e59b7
TB
978 #include <linux/ipsec.h>
979 #endif],
980 [int dir = IPSEC_DIR_FWD;
981 return dir;],
982 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_DIR_FWD])],
983 [AC_MSG_RESULT([no])]
984)
985
efd0fe21
MW
986AC_MSG_CHECKING([for gcc atomic operations])
987AC_TRY_RUN(
988[
989 int main() {
990 volatile int ref = 1;
991 __sync_fetch_and_add (&ref, 1);
992 __sync_sub_and_fetch (&ref, 1);
993 /* Make sure test fails if operations are not supported */
994 __sync_val_compare_and_swap(&ref, 1, 0);
995 return ref;
996 }
997],
998[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_GCC_ATOMIC_OPERATIONS)],
bb835afa 999[AC_MSG_RESULT([no])],
efd0fe21
MW
1000[AC_MSG_RESULT([no])])
1001
d25ce370
TB
1002AC_CHECK_FUNC(
1003 [register_printf_function],
1004 [AC_DEFINE(HAVE_PRINTF_HOOKS)],
1005 [
1006 AC_MSG_NOTICE([printf does not support custom format specifiers!])
bf45d6dd
TB
1007 vstr=true
1008 ]
1009)
1010
1011if test x$vstr = xtrue; then
1012 AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])])
1013 AC_DEFINE(USE_VSTR)
1014fi
d25ce370 1015
6b9290ff 1016if test x$gmp = xtrue; then
f8277a83 1017 AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
6b9290ff
MW
1018 AC_MSG_CHECKING([gmp.h version >= 4.1.4])
1019 AC_TRY_COMPILE(
1020 [#include "gmp.h"],
1021 [
1022 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
1023 #error bad gmp
1024 #endif
1025 ],
1026 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
1027 )
f2c2d395 1028fi
6b9290ff
MW
1029
1030if test x$ldap = xtrue; then
1031 AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])])
1032 AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])])
1033 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
f2c2d395
MW
1034fi
1035
6b9290ff
MW
1036if test x$curl = xtrue; then
1037 AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])])
1038 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
1039fi
1040
1041if test x$xml = xtrue; then
a47486b5 1042 PKG_CHECK_MODULES(xml, [libxml-2.0])
f2d6355e
MW
1043 AC_SUBST(xml_CFLAGS)
1044 AC_SUBST(xml_LIBS)
1045fi
1046
a47486b5
MW
1047if test x$dumm = xtrue; then
1048 PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
1049 AC_SUBST(gtk_CFLAGS)
1050 AC_SUBST(gtk_LIBS)
d2e9cbc9
TB
1051 AC_CHECK_PROGS(RUBY, ruby)
1052 AC_MSG_CHECKING([for Ruby header files])
1053 if test -n "$RUBY"; then
1054 RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
1055 if test -n "$RUBYDIR"; then
1056 dirs="$RUBYDIR"
1057 RUBYINCLUDE=none
1058 for i in $dirs; do
1059 if test -r $i/ruby.h; then
1060 AC_MSG_RESULT([$i])
1061 RUBYINCLUDE="-I$i"
1062 break;
1063 fi
1064 done
1065 if test x"$RUBYINCLUDE" = xnone; then
1066 AC_MSG_ERROR([ruby.h not found])
1067 fi
1068 AC_SUBST(RUBYINCLUDE)
1069 else
1070 AC_MSG_ERROR([unable to determine ruby configuration])
1071 fi
1072 else
1073 AC_MSG_ERROR([don't know how to run ruby])
1074 fi
a47486b5
MW
1075fi
1076
6b9290ff
MW
1077if test x$fast = xtrue; then
1078 AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
1079 AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
1080 AC_HAVE_LIBRARY([z],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver dependency zlib not found!])])
1081dnl autoconf does not like CamelCase!? How to fix this?
1082dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
1083
1084 AC_HAVE_LIBRARY([fcgi],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])])
1085 AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
a84fb01b
MW
1086fi
1087
6b9290ff
MW
1088if test x$mysql = xtrue; then
1089 AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
1090 AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
1091fi
f2c2d395 1092
f8277a83 1093if test x$sqlite = xtrue; then
6b9290ff
MW
1094 AC_HAVE_LIBRARY([sqlite3],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])])
1095 AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
f8277a83
MW
1096 AC_MSG_CHECKING([sqlite3_prepare_v2])
1097 AC_TRY_COMPILE(
1098 [#include <sqlite3.h>],
1099 [
1100 void *test = sqlite3_prepare_v2;
1101 ],
1102 [AC_MSG_RESULT([yes])]; AC_DEFINE_UNQUOTED(HAVE_SQLITE3_PREPARE_V2, 1), [AC_MSG_RESULT([no])])
7da767f7
MW
1103 AC_MSG_CHECKING([sqlite3.h version >= 3.3.1])
1104 AC_TRY_COMPILE(
1105 [#include <sqlite3.h>],
1106 [
1107 #if SQLITE_VERSION_NUMBER < 3003001
1108 #error bad sqlite
1109 #endif
1110 ],
1111 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([SQLite version >= 3.3.1 required!])])
6b9290ff 1112fi
f2c2d395 1113
17353034 1114if test x$openssl = xtrue; then
e581a31d 1115 AC_HAVE_LIBRARY([crypto],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])])
17353034
TB
1116 AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
1117fi
1118
4977018c 1119if test x$gcrypt = xtrue; then
1d39663f
MW
1120 AC_HAVE_LIBRARY([gcrypt],[LIBS="$LIBS"],[AC_MSG_ERROR([gcrypt library not found])])
1121 AC_CHECK_HEADER([gcrypt.h],,[AC_MSG_ERROR([gcrypt header gcrypt.h not found!])])
62d6da67
MW
1122 AC_MSG_CHECKING([gcrypt CAMELLIA cipher])
1123 AC_TRY_COMPILE(
1124 [#include <gcrypt.h>],
1125 [enum gcry_cipher_algos alg = GCRY_CIPHER_CAMELLIA128;],
1126 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GCRY_CIPHER_CAMELLIA])],
1127 [AC_MSG_RESULT([no])]
1128 )
4977018c
MW
1129fi
1130
61c46386
MW
1131if test x$uci = xtrue; then
1132 AC_HAVE_LIBRARY([uci],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])])
1133 AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
1134fi
1135
6dbce9c8
MW
1136if test x$nm = xtrue; then
1137 PKG_CHECK_MODULES(nm, [NetworkManager libnm_glib_vpn gthread-2.0])
1138 AC_SUBST(nm_CFLAGS)
1139 AC_SUBST(nm_LIBS)
1140fi
1141
1caa265c
MW
1142if test x$eap_gtc = xtrue; then
1143 AC_HAVE_LIBRARY([pam],[LIBS="$LIBS"],[AC_MSG_ERROR([PAM library not found])])
1144 AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])])
1145fi
1146
eb3e2705
MW
1147if test x$capabilities = xlibcap; then
1148 AC_HAVE_LIBRARY([cap],[LIBS="$LIBS"],[AC_MSG_ERROR([libcap library not found])])
1149 AC_CHECK_HEADER([sys/capability.h],,[AC_MSG_ERROR([libcap header sys/capability.h not found!])])
1150fi
1151
e4e6a77a
MW
1152if test x$integrity_test = xtrue; then
1153 AC_MSG_CHECKING([for dladdr()])
1154 AC_TRY_COMPILE(
1155 [#define _GNU_SOURCE
1156 #include <dlfcn.h>],
1157 [Dl_info info; dladdr(main, &info);],
1158 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
1159 AC_MSG_ERROR([dladdr() not supported, required by integrity-test!])]
1160 )
1161 AC_MSG_CHECKING([for dl_iterate_phdr()])
1162 AC_TRY_COMPILE(
1163 [#define _GNU_SOURCE
1164 #include <link.h>],
1165 [dl_iterate_phdr((void*)0, (void*)0);],
1166 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
1167 AC_MSG_ERROR([dl_iterate_phdr() not supported, required by integrity-test!])]
1168 )
1169fi
1170
1ba62b55
MW
1171dnl ======================================
1172dnl collect all plugins for libstrongswan
1173dnl ======================================
1174
1175libstrongswan_plugins=
de92b9e7 1176pluto_plugins=
1ba62b55 1177
81811a9d
MW
1178if test x$test_vectors = xtrue; then
1179 libstrongswan_plugins=${libstrongswan_plugins}" test-vectors"
1180 pluto_plugins=${pluto_plugins}" test-vectors"
1181fi
1ba62b55 1182if test x$curl = xtrue; then
29727a44 1183 libstrongswan_plugins=${libstrongswan_plugins}" curl"
de92b9e7 1184 pluto_plugins=${pluto_plugins}" curl"
1ba62b55
MW
1185fi
1186if test x$ldap = xtrue; then
29727a44 1187 libstrongswan_plugins=${libstrongswan_plugins}" ldap"
de92b9e7 1188 pluto_plugins=${pluto_plugins}" ldap"
1ba62b55
MW
1189fi
1190if test x$aes = xtrue; then
29727a44 1191 libstrongswan_plugins=${libstrongswan_plugins}" aes"
d36ae9e3 1192 pluto_plugins=${pluto_plugins}" aes"
1ba62b55
MW
1193fi
1194if test x$des = xtrue; then
29727a44 1195 libstrongswan_plugins=${libstrongswan_plugins}" des"
d36ae9e3
AS
1196 pluto_plugins=${pluto_plugins}" des"
1197fi
1198if test x$blowfish = xtrue; then
1199 libstrongswan_plugins=${libstrongswan_plugins}" blowfish"
1200 pluto_plugins=${pluto_plugins}" blowfish"
1201fi
1ba62b55 1202if test x$sha1 = xtrue; then
29727a44 1203 libstrongswan_plugins=${libstrongswan_plugins}" sha1"
d36ae9e3 1204 pluto_plugins=${pluto_plugins}" sha1"
1ba62b55
MW
1205fi
1206if test x$sha2 = xtrue; then
29727a44 1207 libstrongswan_plugins=${libstrongswan_plugins}" sha2"
d36ae9e3 1208 pluto_plugins=${pluto_plugins}" sha2"
1ba62b55 1209fi
1e0d1ae2
AS
1210if test x$md4 = xtrue; then
1211 libstrongswan_plugins=${libstrongswan_plugins}" md4"
1212fi
e577ad39
MW
1213if test x$md5 = xtrue; then
1214 libstrongswan_plugins=${libstrongswan_plugins}" md5"
d36ae9e3 1215 pluto_plugins=${pluto_plugins}" md5"
e577ad39 1216fi
1ba62b55 1217if test x$fips_prf = xtrue; then
29727a44 1218 libstrongswan_plugins=${libstrongswan_plugins}" fips-prf"
1ba62b55 1219fi
1ba62b55 1220if test x$random = xtrue; then
29727a44 1221 libstrongswan_plugins=${libstrongswan_plugins}" random"
bc2e33ca 1222 pluto_plugins=${pluto_plugins}" random"
1ba62b55
MW
1223fi
1224if test x$x509 = xtrue; then
29727a44 1225 libstrongswan_plugins=${libstrongswan_plugins}" x509"
1ba62b55
MW
1226fi
1227if test x$pubkey = xtrue; then
29727a44 1228 libstrongswan_plugins=${libstrongswan_plugins}" pubkey"
c146b2c8 1229 pluto_plugins=${pluto_plugins}" pubkey"
1ba62b55 1230fi
1e0f6937
MW
1231if test x$pkcs1 = xtrue; then
1232 libstrongswan_plugins=${libstrongswan_plugins}" pkcs1"
1233 pluto_plugins=${pluto_plugins}" pkcs1"
1234fi
9493dd2c
MW
1235if test x$pgp = xtrue; then
1236 libstrongswan_plugins=${libstrongswan_plugins}" pgp"
1237 pluto_plugins=${pluto_plugins}" pgp"
1238fi
5ef478aa
MW
1239if test x$dnskey = xtrue; then
1240 libstrongswan_plugins=${libstrongswan_plugins}" dnskey"
1241 pluto_plugins=${pluto_plugins}" dnskey"
1242fi
160f4c22
MW
1243if test x$pem = xtrue; then
1244 libstrongswan_plugins=${libstrongswan_plugins}" pem"
1245 pluto_plugins=${pluto_plugins}" pem"
1246fi
1ba62b55 1247if test x$mysql = xtrue; then
29727a44 1248 libstrongswan_plugins=${libstrongswan_plugins}" mysql"
1ba62b55
MW
1249fi
1250if test x$sqlite = xtrue; then
29727a44 1251 libstrongswan_plugins=${libstrongswan_plugins}" sqlite"
1ba62b55
MW
1252fi
1253if test x$padlock = xtrue; then
29727a44 1254 libstrongswan_plugins=${libstrongswan_plugins}" padlock"
1ba62b55
MW
1255fi
1256if test x$openssl = xtrue; then
29727a44 1257 libstrongswan_plugins=${libstrongswan_plugins}" openssl"
13e51a62 1258 pluto_plugins=${pluto_plugins}" openssl"
1ba62b55 1259fi
4977018c
MW
1260if test x$gcrypt = xtrue; then
1261 libstrongswan_plugins=${libstrongswan_plugins}" gcrypt"
1262 pluto_plugins=${pluto_plugins}" gcrypt"
1263fi
0c013ff3
MW
1264if test x$xcbc = xtrue; then
1265 libstrongswan_plugins=${libstrongswan_plugins}" xcbc"
1266fi
1267if test x$hmac = xtrue; then
1268 libstrongswan_plugins=${libstrongswan_plugins}" hmac"
1269 pluto_plugins=${pluto_plugins}" hmac"
1270fi
21c95463
MW
1271if test x$agent = xtrue; then
1272 libstrongswan_plugins=${libstrongswan_plugins}" agent"
1273fi
e577ad39
MW
1274if test x$gmp = xtrue; then
1275 libstrongswan_plugins=${libstrongswan_plugins}" gmp"
96d42f44 1276 pluto_plugins=${pluto_plugins}" gmp"
e577ad39 1277fi
1ba62b55
MW
1278
1279AC_SUBST(libstrongswan_plugins)
de92b9e7 1280AC_SUBST(pluto_plugins)
1ba62b55 1281
6b9290ff
MW
1282dnl =========================
1283dnl set Makefile.am vars
1284dnl =========================
f2c2d395 1285
1ba62b55
MW
1286dnl libstrongswan plugins
1287dnl =====================
81811a9d 1288AM_CONDITIONAL(USE_TEST_VECTORS, test x$test_vectors = xtrue)
6b9290ff
MW
1289AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)
1290AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
1291AM_CONDITIONAL(USE_AES, test x$aes = xtrue)
1292AM_CONDITIONAL(USE_DES, test x$des = xtrue)
d36ae9e3 1293AM_CONDITIONAL(USE_BLOWFISH, test x$blowfish = xtrue)
1e0d1ae2 1294AM_CONDITIONAL(USE_MD4, test x$md4 = xtrue)
6b9290ff
MW
1295AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)
1296AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)
1297AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)
1298AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
1299AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
6a365f07 1300AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
6b9290ff 1301AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)
affd7a90 1302AM_CONDITIONAL(USE_PUBKEY, test x$pubkey = xtrue)
1e0f6937 1303AM_CONDITIONAL(USE_PKCS1, test x$pkcs1 = xtrue)
9493dd2c 1304AM_CONDITIONAL(USE_PGP, test x$pgp = xtrue)
5ef478aa 1305AM_CONDITIONAL(USE_DNSKEY, test x$dnskey = xtrue)
160f4c22 1306AM_CONDITIONAL(USE_PEM, test x$pem = xtrue)
6b9290ff 1307AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)
27d04e05 1308AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
6b9290ff
MW
1309AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
1310AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
1ba62b55
MW
1311AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
1312AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
4977018c 1313AM_CONDITIONAL(USE_GCRYPT, test x$gcrypt = xtrue)
21c95463 1314AM_CONDITIONAL(USE_AGENT, test x$agent = xtrue)
1ba62b55
MW
1315
1316dnl charon plugins
1317dnl ==============
6b9290ff 1318AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
5b7ec6d4 1319AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
782db7ed 1320AM_CONDITIONAL(USE_MEDCLI, test x$medcli = xtrue)
6dbce9c8 1321AM_CONDITIONAL(USE_NM, test x$nm = xtrue)
61c46386 1322AM_CONDITIONAL(USE_UCI, test x$uci = xtrue)
6b9290ff
MW
1323AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
1324AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
ad3af574 1325AM_CONDITIONAL(USE_UPDOWN, test x$updown = xtrue)
adc25ec2
MW
1326AM_CONDITIONAL(USE_ATTR, test x$attr = xtrue)
1327AM_CONDITIONAL(USE_RESOLV_CONF, test x$resolvconf = xtrue)
6b9290ff 1328AM_CONDITIONAL(USE_UNIT_TESTS, test x$unittest = xtrue)
0fd6e955 1329AM_CONDITIONAL(USE_LOAD_TESTS, test x$loadtest = xtrue)
6b9290ff 1330AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
79a87846 1331AM_CONDITIONAL(USE_EAP_SIM_FILE, test x$eap_sim_file = xtrue)
6b9290ff
MW
1332AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
1333AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
1caa265c 1334AM_CONDITIONAL(USE_EAP_GTC, test x$eap_gtc = xtrue)
6b9290ff 1335AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
f98cdf7a 1336AM_CONDITIONAL(USE_EAP_MSCHAPV2, test x$eap_mschapv2 = xtrue)
4a6b84a9 1337AM_CONDITIONAL(USE_EAP_RADIUS, test x$eap_radius = xtrue)
09d7ef26 1338AM_CONDITIONAL(USE_KERNEL_NETLINK, test x$kernel_netlink = xtrue)
1adaa02b 1339AM_CONDITIONAL(USE_KERNEL_PFKEY, test x$kernel_pfkey = xtrue)
ea7e89c7 1340AM_CONDITIONAL(USE_KERNEL_PFROUTE, test x$kernel_pfroute = xtrue)
ea625fab 1341AM_CONDITIONAL(USE_KERNEL_KLIPS, test x$kernel_klips = xtrue)
1ba62b55
MW
1342
1343dnl other options
1344dnl =============
1345AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
1346AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
1347AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
02140125 1348AM_CONDITIONAL(USE_LOCK_PROFILER, test x$lock_profiler = xtrue)
6b9290ff
MW
1349AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
1350AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
1351AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
1352AM_CONDITIONAL(USE_DUMM, test x$dumm = xtrue)
1353AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)
1354AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
1355AM_CONDITIONAL(USE_ME, test x$me = xtrue)
1356AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
eb3e2705 1357AM_CONDITIONAL(USE_CAPABILITIES, test x$capabilities = xlibcap)
6b9290ff 1358AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
6905f794 1359AM_CONDITIONAL(USE_THREADS, test x$threads = xtrue)
6b9290ff
MW
1360AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
1361AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
cf00cffe 1362AM_CONDITIONAL(USE_SCRIPTS, test x$scripts = xtrue)
4985ad6e 1363AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$pluto = xtrue -o x$tools = xtrue)
6b9290ff 1364AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
d25ce370 1365AM_CONDITIONAL(USE_VSTR, test x$vstr = xtrue)
f2c2d395 1366
9e72d3bc
MW
1367dnl ==============================
1368dnl set global definitions
1369dnl ==============================
1370
1371if test x$me = xtrue; then
1372 AC_DEFINE(ME)
1373fi
eb3e2705
MW
1374if test x$capabilities = xlibcap; then
1375 AC_DEFINE(CAPABILITIES)
1376fi
9e72d3bc 1377
f2c2d395
MW
1378dnl ==============================
1379dnl build Makefiles
1380dnl ==============================
1381
1382AC_OUTPUT(
1383 Makefile
1384 src/Makefile
04a7b6d8 1385 src/include/Makefile
f2c2d395 1386 src/libstrongswan/Makefile
552cc11b
MW
1387 src/libstrongswan/plugins/aes/Makefile
1388 src/libstrongswan/plugins/des/Makefile
d36ae9e3 1389 src/libstrongswan/plugins/blowfish/Makefile
1e0d1ae2 1390 src/libstrongswan/plugins/md4/Makefile
552cc11b
MW
1391 src/libstrongswan/plugins/md5/Makefile
1392 src/libstrongswan/plugins/sha1/Makefile
1393 src/libstrongswan/plugins/sha2/Makefile
1394 src/libstrongswan/plugins/fips_prf/Makefile
1395 src/libstrongswan/plugins/gmp/Makefile
6a365f07 1396 src/libstrongswan/plugins/random/Makefile
552cc11b 1397 src/libstrongswan/plugins/hmac/Makefile
27d04e05 1398 src/libstrongswan/plugins/xcbc/Makefile
552cc11b 1399 src/libstrongswan/plugins/x509/Makefile
affd7a90 1400 src/libstrongswan/plugins/pubkey/Makefile
1e0f6937 1401 src/libstrongswan/plugins/pkcs1/Makefile
9493dd2c 1402 src/libstrongswan/plugins/pgp/Makefile
5ef478aa 1403 src/libstrongswan/plugins/dnskey/Makefile
160f4c22 1404 src/libstrongswan/plugins/pem/Makefile
552cc11b
MW
1405 src/libstrongswan/plugins/curl/Makefile
1406 src/libstrongswan/plugins/ldap/Makefile
1407 src/libstrongswan/plugins/mysql/Makefile
1408 src/libstrongswan/plugins/sqlite/Makefile
36d62fac 1409 src/libstrongswan/plugins/padlock/Makefile
17353034 1410 src/libstrongswan/plugins/openssl/Makefile
4977018c 1411 src/libstrongswan/plugins/gcrypt/Makefile
21c95463 1412 src/libstrongswan/plugins/agent/Makefile
81811a9d 1413 src/libstrongswan/plugins/test_vectors/Makefile
f2c2d395
MW
1414 src/libfreeswan/Makefile
1415 src/pluto/Makefile
1416 src/whack/Makefile
1417 src/charon/Makefile
552cc11b
MW
1418 src/charon/plugins/eap_aka/Makefile
1419 src/charon/plugins/eap_identity/Makefile
1420 src/charon/plugins/eap_md5/Makefile
1caa265c 1421 src/charon/plugins/eap_gtc/Makefile
552cc11b 1422 src/charon/plugins/eap_sim/Makefile
79a87846 1423 src/charon/plugins/eap_sim_file/Makefile
f98cdf7a 1424 src/charon/plugins/eap_mschapv2/Makefile
4a6b84a9 1425 src/charon/plugins/eap_radius/Makefile
507f26f6 1426 src/charon/plugins/kernel_netlink/Makefile
1adaa02b 1427 src/charon/plugins/kernel_pfkey/Makefile
ea7e89c7 1428 src/charon/plugins/kernel_pfroute/Makefile
ea625fab 1429 src/charon/plugins/kernel_klips/Makefile
6b9290ff 1430 src/charon/plugins/smp/Makefile
552cc11b 1431 src/charon/plugins/sql/Makefile
5b7ec6d4 1432 src/charon/plugins/medsrv/Makefile
782db7ed 1433 src/charon/plugins/medcli/Makefile
6dbce9c8 1434 src/charon/plugins/nm/Makefile
61c46386 1435 src/charon/plugins/uci/Makefile
552cc11b 1436 src/charon/plugins/stroke/Makefile
ad3af574 1437 src/charon/plugins/updown/Makefile
adc25ec2
MW
1438 src/charon/plugins/attr/Makefile
1439 src/charon/plugins/resolv_conf/Makefile
552cc11b 1440 src/charon/plugins/unit_tester/Makefile
0fd6e955 1441 src/charon/plugins/load_tester/Makefile
f2c2d395
MW
1442 src/stroke/Makefile
1443 src/ipsec/Makefile
1444 src/starter/Makefile
1445 src/_updown/Makefile
1446 src/_updown_espmark/Makefile
1447 src/_copyright/Makefile
1448 src/openac/Makefile
1449 src/scepclient/Makefile
7c577c8e 1450 src/pki/Makefile
f2d6355e 1451 src/dumm/Makefile
2d9ce480 1452 src/dumm/ext/extconf.rb
552cc11b 1453 src/libfast/Makefile
b8c7453a 1454 src/manager/Makefile
9529fb68 1455 src/medsrv/Makefile
67a7bb02 1456 src/checksum/Makefile
39b7780d 1457 scripts/Makefile
9ee1111d 1458 testing/Makefile
f2c2d395 1459)