]> git.ipfire.org Git - people/ms/strongswan.git/blame - configure.in
streamlined ipsec listalgs output
[people/ms/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
a9bb69c8 19AC_INIT(strongSwan,4.2.7)
5e5f0bd4 20AM_INIT_AUTOMAKE(tar-ustar)
f2c2d395 21AC_C_BIGENDIAN
f2c2d395 22AC_SUBST(confdir, '${sysconfdir}')
a47486b5 23PKG_PROG_PKG_CONFIG
f2c2d395 24
db26d00e
MW
25dnl =================================
26dnl check --enable-xxx & --with-xxx
27dnl =================================
28
db26d00e 29AC_ARG_WITH(
6b9290ff
MW
30 [default-pkcs11],
31 AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than "/usr/lib/opensc-pkcs11.so"]),
32 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")],
33 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")]
db26d00e
MW
34)
35
195307b5 36AC_ARG_WITH(
6b9290ff
MW
37 [xauth-module],
38 AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]),
39 [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")],
195307b5
AS
40)
41
db26d00e 42AC_ARG_WITH(
6b9290ff
MW
43 [random-device],
44 AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than "/dev/random"]),
45 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")],
46 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")]
db26d00e 47)
c60c7694 48AC_ARG_WITH(
6b9290ff
MW
49 [resolv-conf],
50 AS_HELP_STRING([--with-resolv-conf=file],[set the file to store DNS server information other than "sysconfdir/resolv.conf"]),
8cc16c9d
AS
51 [AC_SUBST(resolv_conf, "$withval")],
52 [AC_SUBST(resolv_conf, "${sysconfdir}/resolv.conf")]
c60c7694 53)
db26d00e 54
ff867d06
MW
55AC_ARG_WITH(
56 [strongswan-conf],
57 AS_HELP_STRING([--with-strongswan-conf=file],[strongswan.conf file other than "sysconfdir/strongswan.conf"]),
8cc16c9d
AS
58 [AC_SUBST(strongswan_conf, "$withval")],
59 [AC_SUBST(strongswan_conf, "${sysconfdir}/strongswan.conf")]
ff867d06
MW
60)
61
db26d00e 62AC_ARG_WITH(
6b9290ff
MW
63 [urandom-device],
64 AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than "/dev/urandom"]),
65 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")],
66 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")]
db26d00e 67)
f2c2d395 68
dfc14c84 69AC_ARG_WITH(
6b9290ff
MW
70 [piddir],
71 AS_HELP_STRING([--with-piddir=dir],[path for PID and UNIX socket files other than "/var/run"]),
72 [AC_SUBST(piddir, "$withval")],
73 [AC_SUBST(piddir, "/var/run")]
dfc14c84
AS
74)
75
f27f6296 76AC_ARG_WITH(
6b9290ff
MW
77 [ipsecdir],
78 AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]),
79 [AC_SUBST(ipsecdir, "$withval")],
80 [AC_SUBST(ipsecdir, "${libexecdir}/ipsec")]
f27f6296 81)
552cc11b 82AC_SUBST(plugindir, "${ipsecdir}/plugins")
f27f6296
MW
83
84AC_ARG_WITH(
6b9290ff
MW
85 [plugindir],
86 AS_HELP_STRING([--with-plugindir=dir],[installation path for plugins other than "ipsecdir/plugins"]),
87 [AC_SUBST(plugindir, "$withval")],
88 [AC_SUBST(plugindir, "${ipsecdir}/plugins")]
f27f6296
MW
89)
90
d560c849 91AC_ARG_WITH(
6b9290ff
MW
92 [sim-reader],
93 AS_HELP_STRING([--with-sim-reader=library.so],[library containing the sim_run_alg()/sim_get_triplet() function for EAP-SIM]),
94 [AC_SUBST(simreader, "$withval")],
95 [AC_SUBST(simreader, "${plugindir}/libeapsim-file.so")]
d560c849
MW
96)
97
04a7b6d8 98AC_ARG_WITH(
6b9290ff
MW
99 [linux-headers],
100 AS_HELP_STRING([--with-linux-headers=dir],[use the linux header files in dir instead of the supplied ones in "src/include"]),
101 [AC_SUBST(linuxdir, "$withval")], [AC_SUBST(linuxdir, "../include")]
04a7b6d8
MW
102)
103AC_SUBST(LINUX_HEADERS)
104
4e411c83 105AC_ARG_WITH(
6b9290ff
MW
106 [routing-table],
107 AS_HELP_STRING([--with-routing-table=num],[use routing table for IPsec routes (default: 220)]),
108 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, $withval) AC_SUBST(IPSEC_ROUTING_TABLE, "$withval")],
109 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, 220) AC_SUBST(IPSEC_ROUTING_TABLE, "220")]
0739cca9
MW
110)
111
112AC_ARG_WITH(
6b9290ff
MW
113 [routing-table-prio],
114 AS_HELP_STRING([--with-routing-table-prio=prio],[priority for IPsec routing table (default: 220)]),
115 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, $withval) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "$withval")],
116 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, 220) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "220")]
4e411c83
MW
117)
118
6874bf69 119AC_ARG_WITH(
25b12c69 120 [uid],,[AC_MSG_ERROR([--with-uid is gone, use --with-user instead!])]
6874bf69
MW
121)
122
123AC_ARG_WITH(
25b12c69
MW
124 [gid],,[AC_MSG_ERROR([--with-gid is gone, use --with-group instead!])]
125)
126
127AC_ARG_WITH(
128 [user],
129 AS_HELP_STRING([--with-user=user],[change user of the daemons to "user" after startup (default is 0).]),
130 [AC_DEFINE_UNQUOTED(IPSEC_USER, "$withval") AC_SUBST(ipsecuser, "$withval")],
131 [AC_SUBST(ipsecuser, "root")]
132)
133
134AC_ARG_WITH(
135 [group],
136 AS_HELP_STRING([--with-group=group],[change group of the daemons to "group" after startup (default is 0).]),
137 [AC_DEFINE_UNQUOTED(IPSEC_GROUP, "$withval") AC_SUBST(ipsecgroup, "$withval")],
138 [AC_SUBST(ipsecgroup, "root")]
6874bf69
MW
139)
140
f2c2d395 141AC_ARG_ENABLE(
6b9290ff
MW
142 [curl],
143 AS_HELP_STRING([--enable-curl],[enable CURL fetcher plugin to fetch files via libcurl (default is NO). Requires libcurl.]),
144 [if test x$enableval = xyes; then
145 curl=true
146 fi]
f2c2d395 147)
f2c2d395
MW
148
149AC_ARG_ENABLE(
6b9290ff
MW
150 [ldap],
151 AS_HELP_STRING([--enable-ldap],[enable LDAP fetching plugin to fetch files via libldap (default is NO). Requires openLDAP.]),
152 [if test x$enableval = xyes; then
153 ldap=true
154 fi]
f2c2d395 155)
552cc11b
MW
156
157AC_ARG_ENABLE(
6b9290ff
MW
158 [aes],
159 AS_HELP_STRING([--disable-aes],[disable own AES software implementation plugin. (default is NO).]),
160 [if test x$enableval = xyes; then
161 aes=true
162 else
163 aes=false
164 fi],
165 aes=true
552cc11b 166)
552cc11b
MW
167
168AC_ARG_ENABLE(
6b9290ff
MW
169 [des],
170 AS_HELP_STRING([--disable-des],[disable own DES/3DES software implementation plugin. (default is NO).]),
171 [if test x$enableval = xyes; then
172 des=true
173 else
174 des=false
175 fi],
176 des=true
552cc11b 177)
552cc11b
MW
178
179AC_ARG_ENABLE(
6b9290ff
MW
180 [md5],
181 AS_HELP_STRING([--disable-md5],[disable own MD5 software implementation plugin. (default is NO).]),
182 [if test x$enableval = xyes; then
183 md5=true
184 else
185 md5=false
186 fi],
187 md5=true
552cc11b 188)
552cc11b
MW
189
190AC_ARG_ENABLE(
6b9290ff
MW
191 [sha1],
192 AS_HELP_STRING([--disable-sha1],[disable own SHA1 software implementation plugin. (default is NO).]),
193 [if test x$enableval = xyes; then
194 sha1=true
195 else
196 sha1=false
197 fi],
198 sha1=true
552cc11b 199)
552cc11b
MW
200
201AC_ARG_ENABLE(
6b9290ff
MW
202 [sha2],
203 AS_HELP_STRING([--disable-sha2],[disable own SHA256/SHA384/SHA512 software implementation plugin. (default is NO).]),
204 [if test x$enableval = xyes; then
205 sha2=true
206 else
207 sha2=false
208 fi],
209 sha2=true
552cc11b 210)
552cc11b
MW
211
212AC_ARG_ENABLE(
6b9290ff
MW
213 [fips-prf],
214 AS_HELP_STRING([--disable-fips-prf],[disable FIPS PRF software implementation plugin. (default is NO).]),
215 [if test x$enableval = xyes; then
216 fips_prf=true
217 else
218 fips_prf=false
219 fi],
220 fips_prf=true
552cc11b 221)
552cc11b
MW
222
223AC_ARG_ENABLE(
6b9290ff
MW
224 [gmp],
225 AS_HELP_STRING([--disable-gmp],[disable own GNU MP (libgmp) based crypto implementation plugin. (default is NO).]),
226 [if test x$enableval = xyes; then
227 gmp=true
228 else
229 gmp=false
230 fi],
231 gmp=true
552cc11b 232)
552cc11b 233
6a365f07
MW
234AC_ARG_ENABLE(
235 [random],
236 AS_HELP_STRING([--disable-random],[disable RNG implementation on top of /dev/(u)random. (default is NO).]),
237 [if test x$enableval = xyes; then
238 random=true
239 else
240 random=false
241 fi],
242 random=true
243)
244
552cc11b 245AC_ARG_ENABLE(
6b9290ff
MW
246 [x509],
247 AS_HELP_STRING([--disable-x509],[disable own X509 certificate implementation plugin. (default is NO).]),
248 [if test x$enableval = xyes; then
249 x509=true
250 else
251 x509=false
252 fi],
253 x509=true
552cc11b 254)
552cc11b 255
affd7a90
MW
256AC_ARG_ENABLE(
257 [pubkey],
258 AS_HELP_STRING([--disable-pubkey],[disable RAW public key support plugin. (default is NO).]),
259 [if test x$enableval = xyes; then
260 pubkey=true
261 else
262 pubkey=false
263 fi],
264 pubkey=true
265)
266
552cc11b 267AC_ARG_ENABLE(
6b9290ff
MW
268 [hmac],
269 AS_HELP_STRING([--disable-hmac],[disable HMAC crypto implementation plugin. (default is NO).]),
270 [if test x$enableval = xyes; then
271 hmac=true
272 else
273 hmac=false
274 fi],
275 hmac=true
552cc11b 276)
552cc11b 277
27d04e05
MW
278AC_ARG_ENABLE(
279 [xcbc],
280 AS_HELP_STRING([--disable-xcbc],[disable xcbc crypto implementation plugin. (default is NO).]),
281 [if test x$enableval = xyes; then
282 xcbc=true
283 else
284 xcbc=false
285 fi],
286 xcbc=true
287)
288
552cc11b 289AC_ARG_ENABLE(
6b9290ff
MW
290 [mysql],
291 AS_HELP_STRING([--enable-mysql],[enable MySQL database support (default is NO). Requires libmysqlclient_r.]),
292 [if test x$enableval = xyes; then
293 mysql=true
294 fi]
552cc11b 295)
552cc11b
MW
296
297AC_ARG_ENABLE(
6b9290ff
MW
298 [sqlite],
299 AS_HELP_STRING([--enable-sqlite],[enable SQLite database support (default is NO). Requires libsqlite3.]),
300 [if test x$enableval = xyes; then
301 sqlite=true
302 fi]
552cc11b 303)
f2c2d395 304
cbfb2aff 305AC_ARG_ENABLE(
6b9290ff
MW
306 [stroke],
307 AS_HELP_STRING([--disable-stroke],[disable charons stroke (pluto compatibility) configuration backend. (default is NO).]),
308 [if test x$enableval = xyes; then
309 stroke=true
310 else
311 stroke=false
312 fi],
313 stroke=true
cbfb2aff 314)
cbfb2aff 315
552cc11b 316AC_ARG_ENABLE(
5b7ec6d4 317 [medsrv],
9529fb68 318 AS_HELP_STRING([--enable-medsrv],[enable mediation server web frontend and daemon plugin (default is NO).]),
6b9290ff 319 [if test x$enableval = xyes; then
5b7ec6d4 320 medsrv=true
6b9290ff 321 fi]
552cc11b 322)
552cc11b 323
782db7ed
MW
324AC_ARG_ENABLE(
325 [medcli],
326 AS_HELP_STRING([--enable-medcli],[enable mediation client configuration database plugin (default is NO).]),
327 [if test x$enableval = xyes; then
328 medcli=true
329 fi]
330)
331
a84fb01b 332AC_ARG_ENABLE(
6b9290ff
MW
333 [smp],
334 AS_HELP_STRING([--enable-smp],[enable SMP configuration and control interface (default is NO). Requires libxml.]),
335 [if test x$enableval = xyes; then
336 smp=true
337 fi]
a84fb01b 338)
a84fb01b
MW
339
340AC_ARG_ENABLE(
6b9290ff
MW
341 [sql],
342 AS_HELP_STRING([--enable-sql],[enable SQL database configuration backend (default is NO).]),
343 [if test x$enableval = xyes; then
344 sql=true
345 fi]
a84fb01b 346)
a84fb01b 347
8f561d44 348AC_ARG_ENABLE(
6b9290ff
MW
349 [smartcard],
350 AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]),
351 [if test x$enableval = xyes; then
352 smartcard=true
353 fi]
8f561d44 354)
8f561d44 355
f2c2d395 356AC_ARG_ENABLE(
6b9290ff
MW
357 [cisco-quirks],
358 AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]),
359 [if test x$enableval = xyes; then
360 cisco_quirks=true
361 fi]
f2c2d395 362)
f2c2d395 363
2df45a73 364AC_ARG_ENABLE(
6b9290ff
MW
365 [leak-detective],
366 AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
367 [if test x$enableval = xyes; then
368 leak_detective=true
369 fi]
2df45a73 370)
2df45a73 371
f2c2d395 372AC_ARG_ENABLE(
6b9290ff
MW
373 [unit-tests],
374 AS_HELP_STRING([--enable-unit-tests],[enable unit tests on IKEv2 daemon startup (default is NO).]),
375 [if test x$enableval = xyes; then
376 unittest=true
377 fi]
f2c2d395 378)
f2c2d395 379
552cc11b 380AC_ARG_ENABLE(
6b9290ff
MW
381 [eap-sim],
382 AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]),
383 [if test x$enableval = xyes; then
384 eap_sim=true
385 fi]
552cc11b 386)
552cc11b 387
b0f24449 388AC_ARG_ENABLE(
6b9290ff
MW
389 [eap-identity],
390 AS_HELP_STRING([--enable-eap-identity],[build EAP module providing EAP-Identity helper (default is NO).]),
391 [if test x$enableval = xyes; then
392 eap_identity=true
393 fi]
b0f24449 394)
cbfb2aff
MW
395
396AC_ARG_ENABLE(
6b9290ff
MW
397 [eap-md5],
398 AS_HELP_STRING([--enable-eap-md5],[build MD5 (CHAP) authenication module for EAP (default is NO).]),
399 [if test x$enableval = xyes; then
400 eap_md5=true
401 fi]
cbfb2aff 402)
26e24676 403
1caa265c
MW
404AC_ARG_ENABLE(
405 [eap-gtc],
406 AS_HELP_STRING([--enable-eap-gtc],[build PAM based GTC authenication module for EAP (default is NO).]),
407 [if test x$enableval = xyes; then
408 eap_gtc=true
409 fi]
410)
411
26e24676 412AC_ARG_ENABLE(
6b9290ff
MW
413 [eap-aka],
414 AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
415 [if test x$enableval = xyes; then
416 eap_aka=true
417 fi]
26e24676 418)
b0f24449 419
7b0c588a 420AC_ARG_ENABLE(
6b9290ff
MW
421 [nat-transport],
422 AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
423 [if test x$enableval = xyes; then
424 nat_transport=true
425 fi]
7b0c588a 426)
7b0c588a
AS
427
428AC_ARG_ENABLE(
6b9290ff
MW
429 [vendor-id],
430 AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
431 [if test x$enableval = xyes; then
432 vendor_id=true
433 else
434 vendor_id=false
435 fi],
436 vendor_id=true
7b0c588a 437)
7b0c588a 438
0e307360 439AC_ARG_ENABLE(
6b9290ff
MW
440 [xauth-vid],
441 AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
442 [if test x$enableval = xyes; then
443 xauth_vid=true
444 else
445 xauth_vid=false
446 fi],
447 xauth_vid=true
0e307360 448)
0e307360 449
fd4ded97 450AC_ARG_ENABLE(
6b9290ff
MW
451 [dumm],
452 AS_HELP_STRING([--enable-dumm],[build the DUMM UML test framework (default is NO).]),
453 [if test x$enableval = xyes; then
454 dumm=true
455 fi]
fd4ded97 456)
fd4ded97 457
552cc11b 458AC_ARG_ENABLE(
6b9290ff
MW
459 [fast],
460 AS_HELP_STRING([--enable-fast],[build libfast (FastCGI Application Server w/ templates (default is NO).]),
461 [if test x$enableval = xyes; then
462 fast=true
463 fi]
552cc11b 464)
552cc11b 465
b8c7453a 466AC_ARG_ENABLE(
6b9290ff
MW
467 [manager],
468 AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
469 [if test x$enableval = xyes; then
470 manager=true
471 xml=true
472 fi]
b8c7453a 473)
b8c7453a 474
d5cc1758 475AC_ARG_ENABLE(
6b9290ff
MW
476 [mediation],
477 AS_HELP_STRING([--enable-mediation],[enable IKEv2 Mediation Extension (default is NO).]),
478 [if test x$enableval = xyes; then
479 me=true
480 fi]
d5cc1758 481)
d5cc1758 482
9ee1111d 483AC_ARG_ENABLE(
6b9290ff
MW
484 [integrity-test],
485 AS_HELP_STRING([--enable-integrity-test],[enable the integrity test of the crypto library (default is NO).]),
486 [if test x$enableval = xyes; then
487 integrity_test=true
488 fi]
9ee1111d 489)
9ee1111d
AS
490
491AC_ARG_ENABLE(
6b9290ff
MW
492 [self-test],
493 AS_HELP_STRING([--disable-self-test],[disable the self-test of the crypto library (default is NO).]),
494 [if test x$enableval = xyes; then
495 self_test=true
496 else
497 self_test=false
498 fi],
499 self_test=true
9ee1111d 500)
9ee1111d 501
733f336a 502AC_ARG_ENABLE(
6b9290ff
MW
503 [pluto],
504 AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
505 [if test x$enableval = xyes; then
506 pluto=true
507 else
508 pluto=false
509 fi],
510 pluto=true
cbfb2aff 511)
cbfb2aff
MW
512
513AC_ARG_ENABLE(
6b9290ff
MW
514 [charon],
515 AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
516 [if test x$enableval = xyes; then
517 charon=true
518 else
519 charon=false
520 fi],
521 charon=true
cbfb2aff 522)
cbfb2aff
MW
523
524AC_ARG_ENABLE(
6b9290ff
MW
525 [tools],
526 AS_HELP_STRING([--disable-tools],[disable additional utilities (openac and scepclient). (default is NO).]),
527 [if test x$enableval = xyes; then
528 tools=true
529 else
530 tools=false
531 fi],
532 tools=true
733f336a 533)
733f336a 534
1e9c46f1
MW
535AC_ARG_ENABLE(
536 [updown],
537 AS_HELP_STRING([--disable-updown],[disable installation of firewall scripts. (default is NO).]),
538 [if test x$enableval = xyes; then
539 updown=true
540 else
541 updown=false
542 fi],
543 updown=true
544)
545
36d62fac
MW
546AC_ARG_ENABLE(
547 [padlock],
548 AS_HELP_STRING([--enable-padlock],[enables VIA Padlock crypto plugin. (default is NO).]),
549 [if test x$enableval = xyes; then
550 padlock=true
551 else
552 padlock=false
553 fi],
554)
555
17353034
TB
556AC_ARG_ENABLE(
557 [openssl],
558 AS_HELP_STRING([--enable-openssl],[enables the OpenSSL crypto plugin. (default is NO).]),
559 [if test x$enableval = xyes; then
560 openssl=true
561 else
562 openssl=false
563 fi],
564)
565
61c46386
MW
566AC_ARG_ENABLE(
567 [uci],
568 AS_HELP_STRING([--enable-uci],[enable OpenWRT UCI configuration plugin (default is NO).]),
569 [if test x$enableval = xyes; then
570 uci=true
571 fi]
572)
573
6dbce9c8
MW
574AC_ARG_ENABLE(
575 [nm],
576 AS_HELP_STRING([--enable-nm],[enable NetworkManager plugin (default is NO).]),
577 [if test x$enableval = xyes; then
578 nm=true
579 fi]
580)
581
f2c2d395
MW
582dnl =========================
583dnl check required programs
584dnl =========================
585
586AC_PROG_INSTALL
587AC_PROG_LIBTOOL
588AC_PROG_LEX
589AC_PROG_YACC
4986554f 590AC_PROG_CC()
298b06c2
MW
591AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
592AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
f2c2d395 593
6b9290ff
MW
594dnl =========================
595dnl dependency calculation
596dnl =========================
f2c2d395 597
6b9290ff
MW
598if test x$pluto = xtrue; then
599 gmp=true;
600fi
601
602if test x$tools = xtrue; then
603 gmp=true;
604fi
552cc11b 605
6b9290ff
MW
606if test x$smp = xtrue; then
607 xml=true
608fi
609
610if test x$manager = xtrue; then
611 fast=true
612fi
613
782db7ed
MW
614if test x$medsrv = xtrue; then
615 me=true
9529fb68 616 fast=true
782db7ed
MW
617fi
618
619if test x$medcli = xtrue; then
620 me=true
621fi
622
6b9290ff
MW
623dnl ==========================================
624dnl check required libraries and header files
625dnl ==========================================
626
627AC_HAVE_LIBRARY(dl)
4986554f 628AC_CHECK_FUNCS(backtrace)
552cc11b 629AC_CHECK_FUNCS(dladdr)
e696757c 630
6b9290ff
MW
631AC_MSG_CHECKING([capset() definition])
632AC_TRY_COMPILE(
633 [#include <linux/capset.h>],
634 [
635 void *test = capset;
636 ],
637 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_DEFINE_UNQUOTED(NO_CAPSET_DEFINED, 1)]
638)
639
640if test x$gmp = xtrue; then
f8277a83 641 AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
6b9290ff
MW
642 AC_MSG_CHECKING([gmp.h version >= 4.1.4])
643 AC_TRY_COMPILE(
644 [#include "gmp.h"],
645 [
646 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
647 #error bad gmp
648 #endif
649 ],
650 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
651 )
f2c2d395 652fi
6b9290ff
MW
653
654if test x$ldap = xtrue; then
655 AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])])
656 AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])])
657 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
f2c2d395
MW
658fi
659
6b9290ff
MW
660if test x$curl = xtrue; then
661 AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])])
662 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
663fi
664
665if test x$xml = xtrue; then
a47486b5 666 PKG_CHECK_MODULES(xml, [libxml-2.0])
f2d6355e
MW
667 AC_SUBST(xml_CFLAGS)
668 AC_SUBST(xml_LIBS)
669fi
670
a47486b5
MW
671if test x$dumm = xtrue; then
672 PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
673 AC_SUBST(gtk_CFLAGS)
674 AC_SUBST(gtk_LIBS)
675fi
676
6b9290ff
MW
677if test x$fast = xtrue; then
678 AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
679 AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
680 AC_HAVE_LIBRARY([z],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver dependency zlib not found!])])
681dnl autoconf does not like CamelCase!? How to fix this?
682dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
683
684 AC_HAVE_LIBRARY([fcgi],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])])
685 AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
a84fb01b
MW
686fi
687
6b9290ff
MW
688if test x$mysql = xtrue; then
689 AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
690 AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
691fi
f2c2d395 692
f8277a83 693if test x$sqlite = xtrue; then
6b9290ff
MW
694 AC_HAVE_LIBRARY([sqlite3],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])])
695 AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
f8277a83
MW
696 AC_MSG_CHECKING([sqlite3_prepare_v2])
697 AC_TRY_COMPILE(
698 [#include <sqlite3.h>],
699 [
700 void *test = sqlite3_prepare_v2;
701 ],
702 [AC_MSG_RESULT([yes])]; AC_DEFINE_UNQUOTED(HAVE_SQLITE3_PREPARE_V2, 1), [AC_MSG_RESULT([no])])
7da767f7
MW
703 AC_MSG_CHECKING([sqlite3.h version >= 3.3.1])
704 AC_TRY_COMPILE(
705 [#include <sqlite3.h>],
706 [
707 #if SQLITE_VERSION_NUMBER < 3003001
708 #error bad sqlite
709 #endif
710 ],
711 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([SQLite version >= 3.3.1 required!])])
6b9290ff 712fi
f2c2d395 713
17353034 714if test x$openssl = xtrue; then
e581a31d 715 AC_HAVE_LIBRARY([crypto],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])])
17353034
TB
716 AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
717fi
718
61c46386
MW
719if test x$uci = xtrue; then
720 AC_HAVE_LIBRARY([uci],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])])
721 AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
722fi
723
6dbce9c8
MW
724if test x$nm = xtrue; then
725 PKG_CHECK_MODULES(nm, [NetworkManager libnm_glib_vpn gthread-2.0])
726 AC_SUBST(nm_CFLAGS)
727 AC_SUBST(nm_LIBS)
728fi
729
1caa265c
MW
730if test x$eap_gtc = xtrue; then
731 AC_HAVE_LIBRARY([pam],[LIBS="$LIBS"],[AC_MSG_ERROR([PAM library not found])])
732 AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])])
733fi
734
1ba62b55
MW
735dnl ======================================
736dnl collect all plugins for libstrongswan
737dnl ======================================
738
739libstrongswan_plugins=
740
741if test x$curl = xtrue; then
29727a44 742 libstrongswan_plugins=${libstrongswan_plugins}" curl"
1ba62b55
MW
743fi
744if test x$ldap = xtrue; then
29727a44 745 libstrongswan_plugins=${libstrongswan_plugins}" ldap"
1ba62b55
MW
746fi
747if test x$aes = xtrue; then
29727a44 748 libstrongswan_plugins=${libstrongswan_plugins}" aes"
1ba62b55
MW
749fi
750if test x$des = xtrue; then
29727a44 751 libstrongswan_plugins=${libstrongswan_plugins}" des"
1ba62b55 752fi
1ba62b55 753if test x$sha1 = xtrue; then
29727a44 754 libstrongswan_plugins=${libstrongswan_plugins}" sha1"
1ba62b55
MW
755fi
756if test x$sha2 = xtrue; then
29727a44 757 libstrongswan_plugins=${libstrongswan_plugins}" sha2"
1ba62b55 758fi
e577ad39
MW
759if test x$md5 = xtrue; then
760 libstrongswan_plugins=${libstrongswan_plugins}" md5"
761fi
1ba62b55 762if test x$fips_prf = xtrue; then
29727a44 763 libstrongswan_plugins=${libstrongswan_plugins}" fips-prf"
1ba62b55 764fi
1ba62b55 765if test x$random = xtrue; then
29727a44 766 libstrongswan_plugins=${libstrongswan_plugins}" random"
1ba62b55
MW
767fi
768if test x$x509 = xtrue; then
29727a44 769 libstrongswan_plugins=${libstrongswan_plugins}" x509"
1ba62b55
MW
770fi
771if test x$pubkey = xtrue; then
29727a44 772 libstrongswan_plugins=${libstrongswan_plugins}" pubkey"
1ba62b55 773fi
1ba62b55 774if test x$xcbc = xtrue; then
29727a44 775 libstrongswan_plugins=${libstrongswan_plugins}" xcbc"
1ba62b55 776fi
e577ad39
MW
777if test x$hmac = xtrue; then
778 libstrongswan_plugins=${libstrongswan_plugins}" hmac"
779fi
1ba62b55 780if test x$mysql = xtrue; then
29727a44 781 libstrongswan_plugins=${libstrongswan_plugins}" mysql"
1ba62b55
MW
782fi
783if test x$sqlite = xtrue; then
29727a44 784 libstrongswan_plugins=${libstrongswan_plugins}" sqlite"
1ba62b55
MW
785fi
786if test x$padlock = xtrue; then
29727a44 787 libstrongswan_plugins=${libstrongswan_plugins}" padlock"
1ba62b55
MW
788fi
789if test x$openssl = xtrue; then
29727a44 790 libstrongswan_plugins=${libstrongswan_plugins}" openssl"
1ba62b55 791fi
e577ad39
MW
792if test x$gmp = xtrue; then
793 libstrongswan_plugins=${libstrongswan_plugins}" gmp"
794fi
1ba62b55
MW
795
796AC_SUBST(libstrongswan_plugins)
797
6b9290ff
MW
798dnl =========================
799dnl set Makefile.am vars
800dnl =========================
f2c2d395 801
1ba62b55
MW
802dnl libstrongswan plugins
803dnl =====================
6b9290ff
MW
804AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)
805AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
806AM_CONDITIONAL(USE_AES, test x$aes = xtrue)
807AM_CONDITIONAL(USE_DES, test x$des = xtrue)
808AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)
809AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)
810AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)
811AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
812AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
6a365f07 813AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
6b9290ff 814AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)
affd7a90 815AM_CONDITIONAL(USE_PUBKEY, test x$pubkey = xtrue)
6b9290ff 816AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)
27d04e05 817AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
6b9290ff
MW
818AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
819AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
1ba62b55
MW
820AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
821AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
822
823dnl charon plugins
824dnl ==============
6b9290ff 825AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
5b7ec6d4 826AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
782db7ed 827AM_CONDITIONAL(USE_MEDCLI, test x$medcli = xtrue)
6dbce9c8 828AM_CONDITIONAL(USE_NM, test x$nm = xtrue)
61c46386 829AM_CONDITIONAL(USE_UCI, test x$uci = xtrue)
6b9290ff
MW
830AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
831AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
6b9290ff
MW
832AM_CONDITIONAL(USE_UNIT_TESTS, test x$unittest = xtrue)
833AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
834AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
835AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
1caa265c 836AM_CONDITIONAL(USE_EAP_GTC, test x$eap_gtc = xtrue)
6b9290ff 837AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
1ba62b55
MW
838
839dnl other options
840dnl =============
841AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
842AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
843AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
6b9290ff
MW
844AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
845AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
846AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
847AM_CONDITIONAL(USE_DUMM, test x$dumm = xtrue)
848AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)
849AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
850AM_CONDITIONAL(USE_ME, test x$me = xtrue)
851AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
852AM_CONDITIONAL(USE_SELF_TEST, test x$self_test = xtrue)
853AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
854AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
855AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
1e9c46f1 856AM_CONDITIONAL(USE_UPDOWN, test x$updown = xtrue)
6b9290ff
MW
857AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$tools = xtrue)
858AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
f2c2d395 859
9e72d3bc
MW
860dnl ==============================
861dnl set global definitions
862dnl ==============================
863
864if test x$me = xtrue; then
865 AC_DEFINE(ME)
866fi
867
f2c2d395
MW
868dnl ==============================
869dnl build Makefiles
870dnl ==============================
871
872AC_OUTPUT(
873 Makefile
874 src/Makefile
04a7b6d8 875 src/include/Makefile
f2c2d395 876 src/libstrongswan/Makefile
552cc11b
MW
877 src/libstrongswan/plugins/aes/Makefile
878 src/libstrongswan/plugins/des/Makefile
879 src/libstrongswan/plugins/md5/Makefile
880 src/libstrongswan/plugins/sha1/Makefile
881 src/libstrongswan/plugins/sha2/Makefile
882 src/libstrongswan/plugins/fips_prf/Makefile
883 src/libstrongswan/plugins/gmp/Makefile
6a365f07 884 src/libstrongswan/plugins/random/Makefile
552cc11b 885 src/libstrongswan/plugins/hmac/Makefile
27d04e05 886 src/libstrongswan/plugins/xcbc/Makefile
552cc11b 887 src/libstrongswan/plugins/x509/Makefile
affd7a90 888 src/libstrongswan/plugins/pubkey/Makefile
552cc11b
MW
889 src/libstrongswan/plugins/curl/Makefile
890 src/libstrongswan/plugins/ldap/Makefile
891 src/libstrongswan/plugins/mysql/Makefile
892 src/libstrongswan/plugins/sqlite/Makefile
36d62fac 893 src/libstrongswan/plugins/padlock/Makefile
17353034 894 src/libstrongswan/plugins/openssl/Makefile
af165431 895 src/libstrongswan/fips/Makefile
f2c2d395
MW
896 src/libcrypto/Makefile
897 src/libfreeswan/Makefile
898 src/pluto/Makefile
899 src/whack/Makefile
900 src/charon/Makefile
552cc11b
MW
901 src/charon/plugins/eap_aka/Makefile
902 src/charon/plugins/eap_identity/Makefile
903 src/charon/plugins/eap_md5/Makefile
1caa265c 904 src/charon/plugins/eap_gtc/Makefile
552cc11b 905 src/charon/plugins/eap_sim/Makefile
6b9290ff 906 src/charon/plugins/smp/Makefile
552cc11b 907 src/charon/plugins/sql/Makefile
5b7ec6d4 908 src/charon/plugins/medsrv/Makefile
782db7ed 909 src/charon/plugins/medcli/Makefile
6dbce9c8 910 src/charon/plugins/nm/Makefile
61c46386 911 src/charon/plugins/uci/Makefile
552cc11b
MW
912 src/charon/plugins/stroke/Makefile
913 src/charon/plugins/unit_tester/Makefile
f2c2d395
MW
914 src/stroke/Makefile
915 src/ipsec/Makefile
916 src/starter/Makefile
917 src/_updown/Makefile
918 src/_updown_espmark/Makefile
919 src/_copyright/Makefile
920 src/openac/Makefile
921 src/scepclient/Makefile
f2d6355e 922 src/dumm/Makefile
552cc11b 923 src/libfast/Makefile
b8c7453a 924 src/manager/Makefile
9529fb68 925 src/medsrv/Makefile
39b7780d 926 scripts/Makefile
9ee1111d 927 testing/Makefile
f2c2d395 928)