]> git.ipfire.org Git - people/ms/strongswan.git/blame - configure.in
extended leak detective white list for OpenSSL
[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
8f7074cf 19AC_INIT(strongSwan,4.2.4)
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
MW
317 [medsrv],
318 AS_HELP_STRING([--enable-medsrv],[enable mediation server configuration database 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
MW
403
404AC_ARG_ENABLE(
6b9290ff
MW
405 [eap-aka],
406 AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
407 [if test x$enableval = xyes; then
408 eap_aka=true
409 fi]
26e24676 410)
b0f24449 411
7b0c588a 412AC_ARG_ENABLE(
6b9290ff
MW
413 [nat-transport],
414 AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
415 [if test x$enableval = xyes; then
416 nat_transport=true
417 fi]
7b0c588a 418)
7b0c588a
AS
419
420AC_ARG_ENABLE(
6b9290ff
MW
421 [vendor-id],
422 AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
423 [if test x$enableval = xyes; then
424 vendor_id=true
425 else
426 vendor_id=false
427 fi],
428 vendor_id=true
7b0c588a 429)
7b0c588a 430
0e307360 431AC_ARG_ENABLE(
6b9290ff
MW
432 [xauth-vid],
433 AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
434 [if test x$enableval = xyes; then
435 xauth_vid=true
436 else
437 xauth_vid=false
438 fi],
439 xauth_vid=true
0e307360 440)
0e307360 441
fd4ded97 442AC_ARG_ENABLE(
6b9290ff
MW
443 [dumm],
444 AS_HELP_STRING([--enable-dumm],[build the DUMM UML test framework (default is NO).]),
445 [if test x$enableval = xyes; then
446 dumm=true
447 fi]
fd4ded97 448)
fd4ded97 449
552cc11b 450AC_ARG_ENABLE(
6b9290ff
MW
451 [fast],
452 AS_HELP_STRING([--enable-fast],[build libfast (FastCGI Application Server w/ templates (default is NO).]),
453 [if test x$enableval = xyes; then
454 fast=true
455 fi]
552cc11b 456)
552cc11b 457
b8c7453a 458AC_ARG_ENABLE(
6b9290ff
MW
459 [manager],
460 AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
461 [if test x$enableval = xyes; then
462 manager=true
463 xml=true
464 fi]
b8c7453a 465)
b8c7453a 466
d5cc1758 467AC_ARG_ENABLE(
6b9290ff
MW
468 [mediation],
469 AS_HELP_STRING([--enable-mediation],[enable IKEv2 Mediation Extension (default is NO).]),
470 [if test x$enableval = xyes; then
471 me=true
472 fi]
d5cc1758 473)
d5cc1758 474
9ee1111d 475AC_ARG_ENABLE(
6b9290ff
MW
476 [integrity-test],
477 AS_HELP_STRING([--enable-integrity-test],[enable the integrity test of the crypto library (default is NO).]),
478 [if test x$enableval = xyes; then
479 integrity_test=true
480 fi]
9ee1111d 481)
9ee1111d
AS
482
483AC_ARG_ENABLE(
6b9290ff
MW
484 [self-test],
485 AS_HELP_STRING([--disable-self-test],[disable the self-test of the crypto library (default is NO).]),
486 [if test x$enableval = xyes; then
487 self_test=true
488 else
489 self_test=false
490 fi],
491 self_test=true
9ee1111d 492)
9ee1111d 493
733f336a 494AC_ARG_ENABLE(
6b9290ff
MW
495 [pluto],
496 AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
497 [if test x$enableval = xyes; then
498 pluto=true
499 else
500 pluto=false
501 fi],
502 pluto=true
cbfb2aff 503)
cbfb2aff
MW
504
505AC_ARG_ENABLE(
6b9290ff
MW
506 [charon],
507 AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
508 [if test x$enableval = xyes; then
509 charon=true
510 else
511 charon=false
512 fi],
513 charon=true
cbfb2aff 514)
cbfb2aff
MW
515
516AC_ARG_ENABLE(
6b9290ff
MW
517 [tools],
518 AS_HELP_STRING([--disable-tools],[disable additional utilities (openac and scepclient). (default is NO).]),
519 [if test x$enableval = xyes; then
520 tools=true
521 else
522 tools=false
523 fi],
524 tools=true
733f336a 525)
733f336a 526
36d62fac
MW
527AC_ARG_ENABLE(
528 [padlock],
529 AS_HELP_STRING([--enable-padlock],[enables VIA Padlock crypto plugin. (default is NO).]),
530 [if test x$enableval = xyes; then
531 padlock=true
532 else
533 padlock=false
534 fi],
535)
536
17353034
TB
537AC_ARG_ENABLE(
538 [openssl],
539 AS_HELP_STRING([--enable-openssl],[enables the OpenSSL crypto plugin. (default is NO).]),
540 [if test x$enableval = xyes; then
541 openssl=true
542 else
543 openssl=false
544 fi],
545)
546
f2c2d395
MW
547dnl =========================
548dnl check required programs
549dnl =========================
550
551AC_PROG_INSTALL
552AC_PROG_LIBTOOL
553AC_PROG_LEX
554AC_PROG_YACC
4986554f 555AC_PROG_CC()
298b06c2
MW
556AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
557AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
f2c2d395 558
6b9290ff
MW
559dnl =========================
560dnl dependency calculation
561dnl =========================
f2c2d395 562
6b9290ff
MW
563if test x$pluto = xtrue; then
564 gmp=true;
565fi
566
567if test x$tools = xtrue; then
568 gmp=true;
569fi
552cc11b 570
6b9290ff
MW
571if test x$smp = xtrue; then
572 xml=true
573fi
574
575if test x$manager = xtrue; then
576 fast=true
577fi
578
782db7ed
MW
579if test x$medsrv = xtrue; then
580 me=true
581fi
582
583if test x$medcli = xtrue; then
584 me=true
585fi
586
6b9290ff
MW
587dnl ==========================================
588dnl check required libraries and header files
589dnl ==========================================
590
591AC_HAVE_LIBRARY(dl)
4986554f 592AC_CHECK_FUNCS(backtrace)
552cc11b 593AC_CHECK_FUNCS(dladdr)
e696757c 594
6b9290ff
MW
595AC_MSG_CHECKING([capset() definition])
596AC_TRY_COMPILE(
597 [#include <linux/capset.h>],
598 [
599 void *test = capset;
600 ],
601 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_DEFINE_UNQUOTED(NO_CAPSET_DEFINED, 1)]
602)
603
604if test x$gmp = xtrue; then
f8277a83 605 AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
6b9290ff
MW
606 AC_MSG_CHECKING([gmp.h version >= 4.1.4])
607 AC_TRY_COMPILE(
608 [#include "gmp.h"],
609 [
610 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
611 #error bad gmp
612 #endif
613 ],
614 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
615 )
f2c2d395 616fi
6b9290ff
MW
617
618if test x$ldap = xtrue; then
619 AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])])
620 AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])])
621 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
f2c2d395
MW
622fi
623
6b9290ff
MW
624if test x$curl = xtrue; then
625 AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])])
626 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
627fi
628
629if test x$xml = xtrue; then
a47486b5 630 PKG_CHECK_MODULES(xml, [libxml-2.0])
f2d6355e
MW
631 AC_SUBST(xml_CFLAGS)
632 AC_SUBST(xml_LIBS)
633fi
634
a47486b5
MW
635if test x$dumm = xtrue; then
636 PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
637 AC_SUBST(gtk_CFLAGS)
638 AC_SUBST(gtk_LIBS)
639fi
640
6b9290ff
MW
641if test x$fast = xtrue; then
642 AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
643 AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
644 AC_HAVE_LIBRARY([z],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver dependency zlib not found!])])
645dnl autoconf does not like CamelCase!? How to fix this?
646dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
647
648 AC_HAVE_LIBRARY([fcgi],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])])
649 AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
a84fb01b
MW
650fi
651
6b9290ff
MW
652if test x$mysql = xtrue; then
653 AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
654 AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
655fi
f2c2d395 656
f8277a83 657if test x$sqlite = xtrue; then
6b9290ff
MW
658 AC_HAVE_LIBRARY([sqlite3],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])])
659 AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
f8277a83
MW
660 AC_MSG_CHECKING([sqlite3_prepare_v2])
661 AC_TRY_COMPILE(
662 [#include <sqlite3.h>],
663 [
664 void *test = sqlite3_prepare_v2;
665 ],
666 [AC_MSG_RESULT([yes])]; AC_DEFINE_UNQUOTED(HAVE_SQLITE3_PREPARE_V2, 1), [AC_MSG_RESULT([no])])
6b9290ff 667fi
f2c2d395 668
17353034 669if test x$openssl = xtrue; then
e581a31d 670 AC_HAVE_LIBRARY([crypto],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])])
17353034
TB
671 AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
672fi
673
1ba62b55
MW
674dnl ======================================
675dnl collect all plugins for libstrongswan
676dnl ======================================
677
678libstrongswan_plugins=
679
680if test x$curl = xtrue; then
681 libstrongswan_plugins+=" curl"
682fi
683if test x$ldap = xtrue; then
684 libstrongswan_plugins+=" ldap"
685fi
686if test x$aes = xtrue; then
687 libstrongswan_plugins+=" aes"
688fi
689if test x$des = xtrue; then
690 libstrongswan_plugins+=" des"
691fi
692if test x$md5 = xtrue; then
693 libstrongswan_plugins+=" md5"
694fi
695if test x$sha1 = xtrue; then
696 libstrongswan_plugins+=" sha1"
697fi
698if test x$sha2 = xtrue; then
699 libstrongswan_plugins+=" sha2"
700fi
701if test x$fips_prf = xtrue; then
702 libstrongswan_plugins+=" fips-prf"
703fi
704if test x$gmp = xtrue; then
705 libstrongswan_plugins+=" gmp"
706fi
707if test x$random = xtrue; then
708 libstrongswan_plugins+=" random"
709fi
710if test x$x509 = xtrue; then
711 libstrongswan_plugins+=" x509"
712fi
713if test x$pubkey = xtrue; then
714 libstrongswan_plugins+=" pubkey"
715fi
716if test x$hmac = xtrue; then
717 libstrongswan_plugins+=" hmac"
718fi
719if test x$xcbc = xtrue; then
720 libstrongswan_plugins+=" xcbc"
721fi
722if test x$mysql = xtrue; then
723 libstrongswan_plugins+=" mysql"
724fi
725if test x$sqlite = xtrue; then
726 libstrongswan_plugins+=" sqlite"
727fi
728if test x$padlock = xtrue; then
729 libstrongswan_plugins+=" padlock"
730fi
731if test x$openssl = xtrue; then
732 libstrongswan_plugins+=" openssl"
733fi
734
735AC_SUBST(libstrongswan_plugins)
736
6b9290ff
MW
737dnl =========================
738dnl set Makefile.am vars
739dnl =========================
f2c2d395 740
1ba62b55
MW
741dnl libstrongswan plugins
742dnl =====================
6b9290ff
MW
743AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)
744AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
745AM_CONDITIONAL(USE_AES, test x$aes = xtrue)
746AM_CONDITIONAL(USE_DES, test x$des = xtrue)
747AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)
748AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)
749AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)
750AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
751AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
6a365f07 752AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
6b9290ff 753AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)
affd7a90 754AM_CONDITIONAL(USE_PUBKEY, test x$pubkey = xtrue)
6b9290ff 755AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)
27d04e05 756AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
6b9290ff
MW
757AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
758AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
1ba62b55
MW
759AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
760AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
761
762dnl charon plugins
763dnl ==============
6b9290ff 764AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
5b7ec6d4 765AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
782db7ed 766AM_CONDITIONAL(USE_MEDCLI, test x$medcli = xtrue)
6b9290ff
MW
767AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
768AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
6b9290ff
MW
769AM_CONDITIONAL(USE_UNIT_TESTS, test x$unittest = xtrue)
770AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
771AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
772AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
773AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
1ba62b55
MW
774
775dnl other options
776dnl =============
777AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
778AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
779AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
6b9290ff
MW
780AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
781AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
782AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
783AM_CONDITIONAL(USE_DUMM, test x$dumm = xtrue)
784AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)
785AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
786AM_CONDITIONAL(USE_ME, test x$me = xtrue)
787AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
788AM_CONDITIONAL(USE_SELF_TEST, test x$self_test = xtrue)
789AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
790AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
791AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
792AM_CONDITIONAL(USE_PLUTO_OR_CHARON, test x$pluto = xtrue -o x$charon = xtrue)
793AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$tools = xtrue)
794AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
f2c2d395 795
9e72d3bc
MW
796dnl ==============================
797dnl set global definitions
798dnl ==============================
799
800if test x$me = xtrue; then
801 AC_DEFINE(ME)
802fi
803
f2c2d395
MW
804dnl ==============================
805dnl build Makefiles
806dnl ==============================
807
808AC_OUTPUT(
809 Makefile
810 src/Makefile
04a7b6d8 811 src/include/Makefile
f2c2d395 812 src/libstrongswan/Makefile
552cc11b
MW
813 src/libstrongswan/plugins/aes/Makefile
814 src/libstrongswan/plugins/des/Makefile
815 src/libstrongswan/plugins/md5/Makefile
816 src/libstrongswan/plugins/sha1/Makefile
817 src/libstrongswan/plugins/sha2/Makefile
818 src/libstrongswan/plugins/fips_prf/Makefile
819 src/libstrongswan/plugins/gmp/Makefile
6a365f07 820 src/libstrongswan/plugins/random/Makefile
552cc11b 821 src/libstrongswan/plugins/hmac/Makefile
27d04e05 822 src/libstrongswan/plugins/xcbc/Makefile
552cc11b 823 src/libstrongswan/plugins/x509/Makefile
affd7a90 824 src/libstrongswan/plugins/pubkey/Makefile
552cc11b
MW
825 src/libstrongswan/plugins/curl/Makefile
826 src/libstrongswan/plugins/ldap/Makefile
827 src/libstrongswan/plugins/mysql/Makefile
828 src/libstrongswan/plugins/sqlite/Makefile
36d62fac 829 src/libstrongswan/plugins/padlock/Makefile
17353034 830 src/libstrongswan/plugins/openssl/Makefile
f2c2d395
MW
831 src/libcrypto/Makefile
832 src/libfreeswan/Makefile
833 src/pluto/Makefile
834 src/whack/Makefile
835 src/charon/Makefile
552cc11b
MW
836 src/charon/plugins/eap_aka/Makefile
837 src/charon/plugins/eap_identity/Makefile
838 src/charon/plugins/eap_md5/Makefile
839 src/charon/plugins/eap_sim/Makefile
6b9290ff 840 src/charon/plugins/smp/Makefile
552cc11b 841 src/charon/plugins/sql/Makefile
5b7ec6d4 842 src/charon/plugins/medsrv/Makefile
782db7ed 843 src/charon/plugins/medcli/Makefile
552cc11b
MW
844 src/charon/plugins/stroke/Makefile
845 src/charon/plugins/unit_tester/Makefile
f2c2d395
MW
846 src/stroke/Makefile
847 src/ipsec/Makefile
848 src/starter/Makefile
849 src/_updown/Makefile
850 src/_updown_espmark/Makefile
851 src/_copyright/Makefile
852 src/openac/Makefile
853 src/scepclient/Makefile
f2d6355e 854 src/dumm/Makefile
552cc11b 855 src/libfast/Makefile
b8c7453a 856 src/manager/Makefile
9ee1111d 857 testing/Makefile
f2c2d395 858)