update usetime only if usebytes increase
[strongswan.git] / configure.in
1 dnl  configure.in for linux strongSwan
2 dnl  Copyright (C) 2006 Martin Willi
3 dnl  Hochschule fuer Technik Rapperswil
4 dnl 
5 dnl  This program is free software; you can redistribute it and/or modify it
6 dnl  under the terms of the GNU General Public License as published by the
7 dnl  Free Software Foundation; either version 2 of the License, or (at your
8 dnl  option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
9 dnl 
10 dnl  This program is distributed in the hope that it will be useful, but
11 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 dnl  for more details.
14
15 dnl ===========================
16 dnl  initialize & set some vars
17 dnl ===========================
18
19 AC_INIT(strongSwan,4.3.4)
20 AM_INIT_AUTOMAKE(tar-ustar)
21 AC_SUBST(confdir, '${sysconfdir}')
22 PKG_PROG_PKG_CONFIG
23
24 dnl =================================
25 dnl  check --enable-xxx & --with-xxx
26 dnl =================================
27
28 AC_ARG_WITH(
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")]
33 )
34
35 AC_ARG_WITH(
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")],
39 )
40
41 AC_ARG_WITH(
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")]
46 )
47 AC_ARG_WITH(
48         [resolv-conf],
49         AS_HELP_STRING([--with-resolv-conf=file],[set the file to use in DNS handler plugin other than "sysconfdir/resolv.conf"]),
50         [AC_SUBST(resolv_conf, "$withval")],
51         [AC_SUBST(resolv_conf, "${sysconfdir}/resolv.conf")]
52 )
53
54 AC_ARG_WITH(
55         [strongswan-conf],
56         AS_HELP_STRING([--with-strongswan-conf=file],[strongswan.conf file other than "sysconfdir/strongswan.conf"]),
57         [AC_SUBST(strongswan_conf, "$withval")],
58         [AC_SUBST(strongswan_conf, "${sysconfdir}/strongswan.conf")]
59 )
60
61 AC_ARG_WITH(
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")]
66 )
67
68 AC_ARG_WITH(
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")]
73 )
74
75 AC_ARG_WITH(
76         [ipsecdir],
77         AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]),
78         [AC_SUBST(ipsecdir, "$withval")],
79         [AC_SUBST(ipsecdir, "${libexecdir%/}/ipsec")]
80 )
81 AC_SUBST(plugindir, "${ipsecdir%/}/plugins")
82
83 AC_ARG_WITH(
84         [plugindir],
85         AS_HELP_STRING([--with-plugindir=dir],[installation path for plugins other than "ipsecdir/plugins"]),
86         [AC_SUBST(plugindir, "$withval")],
87         [AC_SUBST(plugindir, "${ipsecdir%/}/plugins")]
88 )
89
90 AC_ARG_WITH(
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")],
94         [AC_SUBST(simreader, "${plugindir%/}/libeapsim-file.so")]
95 )
96
97 AC_ARG_WITH(
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"]),
100         [AC_SUBST(linuxdir, "$withval")], [AC_SUBST(linuxdir, "\${top_srcdir}/src/include")]
101 )
102 AC_SUBST(LINUX_HEADERS)
103
104 AC_ARG_WITH(
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")]
109 )
110
111 AC_ARG_WITH(
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")]
116 )
117
118 AC_ARG_WITH(
119         [uid],,[AC_MSG_ERROR([--with-uid is gone, use --with-user instead!])]
120 )
121
122 AC_ARG_WITH(
123         [gid],,[AC_MSG_ERROR([--with-gid is gone, use --with-group instead!])]
124 )
125
126 AC_ARG_WITH(
127         [user],
128         AS_HELP_STRING([--with-user=user],[change user of the daemons to "user" after startup (default is "root").]),
129         [AC_DEFINE_UNQUOTED(IPSEC_USER, "$withval") AC_SUBST(ipsecuser, "$withval")],
130         [AC_SUBST(ipsecuser, "root")]
131 )
132
133 AC_ARG_WITH(
134         [group],
135         AS_HELP_STRING([--with-group=group],[change group of the daemons to "group" after startup (default is "root").]),
136         [AC_DEFINE_UNQUOTED(IPSEC_GROUP, "$withval") AC_SUBST(ipsecgroup, "$withval")],
137         [AC_SUBST(ipsecgroup, "root")]
138 )
139
140 dnl Will be extended to --with-capabilities=libcap|libcap2
141 AC_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
148 AC_ARG_ENABLE(
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]
154 )
155
156 AC_ARG_ENABLE(
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]
162 )
163
164 AC_ARG_ENABLE(
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
173 )
174
175 AC_ARG_ENABLE(
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
184 )
185
186 AC_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
194 AC_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
202 AC_ARG_ENABLE(
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
211 )
212
213 AC_ARG_ENABLE(
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
222 )
223
224 AC_ARG_ENABLE(
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
233 )
234
235 AC_ARG_ENABLE(
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
244 )
245
246 AC_ARG_ENABLE(
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
255 )
256
257 AC_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
268 AC_ARG_ENABLE(
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
277 )
278
279 AC_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
290 AC_ARG_ENABLE(
291         [hmac],
292         AS_HELP_STRING([--disable-hmac],[disable HMAC crypto implementation plugin. (default is NO).]),
293         [if test x$enableval = xyes; then
294                 hmac=true
295          else
296                 hmac=false
297         fi],
298         hmac=true
299 )
300
301 AC_ARG_ENABLE(
302         [xcbc],
303         AS_HELP_STRING([--disable-xcbc],[disable xcbc crypto implementation plugin. (default is NO).]),
304         [if test x$enableval = xyes; then
305                 xcbc=true
306          else
307                 xcbc=false
308         fi],
309         xcbc=true
310 )
311
312 AC_ARG_ENABLE(
313         [test-vectors],
314         AS_HELP_STRING([--enable-test-vectors],[enable plugin providing crypto test vectors (default is NO).]),
315         [if test x$enableval = xyes; then
316                 test_vectors=true
317         fi]
318 )
319
320 AC_ARG_ENABLE(
321         [mysql],
322         AS_HELP_STRING([--enable-mysql],[enable MySQL database support (default is NO). Requires libmysqlclient_r.]),
323         [if test x$enableval = xyes; then
324                 mysql=true
325         fi]
326 )
327
328 AC_ARG_ENABLE(
329         [sqlite],
330         AS_HELP_STRING([--enable-sqlite],[enable SQLite database support (default is NO). Requires libsqlite3.]),
331         [if test x$enableval = xyes; then
332                 sqlite=true
333         fi]
334 )
335
336 AC_ARG_ENABLE(
337         [stroke],
338         AS_HELP_STRING([--disable-stroke],[disable charons stroke (pluto compatibility) configuration backend. (default is NO).]),
339         [if test x$enableval = xyes; then
340                 stroke=true
341          else
342                 stroke=false
343         fi],
344         stroke=true
345 )
346
347 AC_ARG_ENABLE(
348         [medsrv],
349         AS_HELP_STRING([--enable-medsrv],[enable mediation server web frontend and daemon plugin (default is NO).]),
350         [if test x$enableval = xyes; then
351                 medsrv=true
352         fi]
353 )
354
355 AC_ARG_ENABLE(
356         [medcli],
357         AS_HELP_STRING([--enable-medcli],[enable mediation client configuration database plugin (default is NO).]),
358         [if test x$enableval = xyes; then
359                 medcli=true
360         fi]
361 )
362
363 AC_ARG_ENABLE(
364         [smp],
365         AS_HELP_STRING([--enable-smp],[enable SMP configuration and control interface (default is NO). Requires libxml.]),
366         [if test x$enableval = xyes; then
367                 smp=true
368         fi]
369 )
370
371 AC_ARG_ENABLE(
372         [sql],
373         AS_HELP_STRING([--enable-sql],[enable SQL database configuration backend (default is NO).]),
374         [if test x$enableval = xyes; then
375                 sql=true
376         fi]
377 )
378
379 AC_ARG_ENABLE(
380         [smartcard],
381         AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]),
382         [if test x$enableval = xyes; then
383                 smartcard=true
384         fi]
385 )
386
387 AC_ARG_ENABLE(
388         [cisco-quirks],
389         AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]),
390         [if test x$enableval = xyes; then
391                 cisco_quirks=true
392         fi]
393 )
394
395 AC_ARG_ENABLE(
396         [leak-detective],
397         AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
398         [if test x$enableval = xyes; then
399                 leak_detective=true
400         fi]
401 )
402
403 AC_ARG_ENABLE(
404         [lock-profiler],
405         AS_HELP_STRING([--enable-lock-profiler],[enable lock/mutex profiling code (default is NO).]),
406         [if test x$enableval = xyes; then
407                 lock_profiler=true
408         fi]
409 )
410
411 AC_ARG_ENABLE(
412         [unit-tests],
413         AS_HELP_STRING([--enable-unit-tests],[enable unit tests on IKEv2 daemon startup (default is NO).]),
414         [if test x$enableval = xyes; then
415                 unittest=true
416         fi]
417 )
418
419 AC_ARG_ENABLE(
420         [load-tests],
421         AS_HELP_STRING([--enable-load-tests],[enable load testing plugin for IKEv2 daemon (default is NO).]),
422         [if test x$enableval = xyes; then
423                 loadtest=true
424         fi]
425 )
426
427 AC_ARG_ENABLE(
428         [eap-sim],
429         AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]),
430         [if test x$enableval = xyes; then
431                 eap_sim=true
432         fi]
433 )
434
435 AC_ARG_ENABLE(
436         [eap-sim-file],
437         AS_HELP_STRING([--enable-eap-sim-file],[build EAP-SIM backend based on a triplet file (default is NO).]),
438         [if test x$enableval = xyes; then
439                 eap_sim_file=true
440         fi]
441 )
442
443 AC_ARG_ENABLE(
444         [eap-identity],
445         AS_HELP_STRING([--enable-eap-identity],[build EAP module providing EAP-Identity helper (default is NO).]),
446         [if test x$enableval = xyes; then
447                 eap_identity=true
448         fi]
449 )
450
451 AC_ARG_ENABLE(
452         [eap-md5],
453         AS_HELP_STRING([--enable-eap-md5],[build MD5 (CHAP) authenication module for EAP (default is NO).]),
454         [if test x$enableval = xyes; then
455                 eap_md5=true
456         fi]
457 )
458
459 AC_ARG_ENABLE(
460         [eap-gtc],
461         AS_HELP_STRING([--enable-eap-gtc],[build PAM based GTC authenication module for EAP (default is NO).]),
462         [if test x$enableval = xyes; then
463                 eap_gtc=true
464         fi]
465 )
466
467 AC_ARG_ENABLE(
468         [eap-aka],
469         AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
470         [if test x$enableval = xyes; then
471                 eap_aka=true
472         fi]
473 )
474
475 AC_ARG_ENABLE(
476         [eap-mschapv2],
477         AS_HELP_STRING([--enable-eap-mschapv2],[build MS-CHAPv2 authenication module for EAP (default is NO).]),
478         [if test x$enableval = xyes; then
479                 eap_mschapv2=true
480         fi]
481 )
482
483 AC_ARG_ENABLE(
484         [eap-radius],
485         AS_HELP_STRING([--enable-eap-radius],[build RADIUS proxy authenication module for EAP (default is NO).]),
486         [if test x$enableval = xyes; then
487                 eap_radius=true
488         fi]
489 )
490
491 AC_ARG_ENABLE(
492         [kernel-netlink],
493         AS_HELP_STRING([--disable-kernel-netlink],[disable the netlink kernel interface. (default is NO).]),
494         [if test x$enableval = xyes; then
495                 kernel_netlink=true
496          else
497                 kernel_netlink=false
498         fi],
499         kernel_netlink=true
500 )
501
502 AC_ARG_ENABLE(
503         [kernel-pfkey],
504         AS_HELP_STRING([--enable-kernel-pfkey],[enable the PF_KEY kernel interface. (default is NO).]),
505         [if test x$enableval = xyes; then
506                 kernel_pfkey=true
507         fi]
508 )
509
510 AC_ARG_ENABLE(
511         [kernel-pfroute],
512         AS_HELP_STRING([--enable-kernel-pfroute],[enable the PF_ROUTE kernel interface. (default is NO).]),
513         [if test x$enableval = xyes; then
514                 kernel_pfroute=true
515         fi]
516 )
517
518 AC_ARG_ENABLE(
519         [kernel-klips],
520         AS_HELP_STRING([--enable-kernel-klips],[enable the KLIPS kernel interface. (default is NO).]),
521         [if test x$enableval = xyes; then
522                 kernel_klips=true
523         fi]
524 )
525
526 AC_ARG_ENABLE(
527         [nat-transport],
528         AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
529         [if test x$enableval = xyes; then
530                 nat_transport=true
531         fi]
532 )
533
534 AC_ARG_ENABLE(
535         [vendor-id],
536         AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
537         [if test x$enableval = xyes; then
538                 vendor_id=true
539          else
540                 vendor_id=false
541         fi],
542         vendor_id=true
543 )
544
545 AC_ARG_ENABLE(
546         [xauth-vid],
547         AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
548         [if test x$enableval = xyes; then
549                 xauth_vid=true
550          else
551                 xauth_vid=false
552         fi],
553         xauth_vid=true
554 )
555
556 AC_ARG_ENABLE(
557         [dumm],
558         AS_HELP_STRING([--enable-dumm],[build the DUMM UML test framework (default is NO).]),
559         [if test x$enableval = xyes; then
560                 dumm=true
561         fi]
562 )
563
564 AC_ARG_ENABLE(
565         [fast],
566         AS_HELP_STRING([--enable-fast],[build libfast (FastCGI Application Server w/ templates (default is NO).]),
567         [if test x$enableval = xyes; then
568                 fast=true
569         fi]
570 )
571
572 AC_ARG_ENABLE(
573         [manager],
574         AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
575         [if test x$enableval = xyes; then
576                 manager=true
577                 xml=true
578         fi]
579 )
580
581 AC_ARG_ENABLE(
582         [mediation],
583         AS_HELP_STRING([--enable-mediation],[enable IKEv2 Mediation Extension (default is NO).]),
584         [if test x$enableval = xyes; then
585                 me=true
586         fi]
587 )
588
589 AC_ARG_ENABLE(
590         [integrity-test],
591         AS_HELP_STRING([--enable-integrity-test],[enable integrity testing of libstrongswan and plugins (default is NO).]),
592         [if test x$enableval = xyes; then
593                 integrity_test=true 
594         fi]
595 )
596
597 AC_ARG_ENABLE(
598         [pluto],
599         AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
600         [if test x$enableval = xyes; then
601                 pluto=true
602          else
603                 pluto=false
604         fi],
605         pluto=true
606 )
607
608 AC_ARG_ENABLE(
609         [threads],
610         AS_HELP_STRING([--disable-threads],[disable the use of threads in pluto. Charon always uses threads. (default is NO).]),
611         [if test x$enableval = xyes; then
612                 threads=true
613          else
614                 threads=false
615         fi],
616         threads=true
617 )
618
619 AC_ARG_ENABLE(
620         [charon],
621         AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
622         [if test x$enableval = xyes; then
623                 charon=true
624          else
625                 charon=false
626         fi],
627         charon=true
628 )
629
630 AC_ARG_ENABLE(
631         [tools],
632         AS_HELP_STRING([--disable-tools],[disable additional utilities (openac and scepclient). (default is NO).]),
633         [if test x$enableval = xyes; then
634                 tools=true
635          else
636                 tools=false
637         fi],
638         tools=true
639 )
640
641 AC_ARG_ENABLE(
642         [scripts],
643         AS_HELP_STRING([--disable-scripts],[disable additional utilities (found in directory scripts). (default is NO).]),
644         [if test x$enableval = xyes; then
645                 scripts=true
646          else
647                 scripts=false
648         fi],
649         scripts=true
650 )
651
652 AC_ARG_ENABLE(
653         [updown],
654         AS_HELP_STRING([--disable-updown],[disable updown firewall script plugin. (default is NO).]),
655         [if test x$enableval = xyes; then
656                 updown=true
657          else
658                 updown=false
659         fi],
660         updown=true
661 )
662
663 AC_ARG_ENABLE(
664         [attr],
665         AS_HELP_STRING([--disable-attr],[disable strongswan.conf based configuration attribute plugin. (default is NO).]),
666         [if test x$enableval = xyes; then
667                 attr=true
668          else
669                 attr=false
670         fi],
671         attr=true
672 )
673
674 AC_ARG_ENABLE(
675         [resolv-conf],
676         AS_HELP_STRING([--disable-resolv-conf],[disable resolv.conf DNS handler plugin. (default is NO).]),
677         [if test x$enableval = xyes; then
678                 resolvconf=true
679          else
680                 resolvconf=false
681         fi],
682         resolvconf=true
683 )
684
685 AC_ARG_ENABLE(
686         [padlock],
687         AS_HELP_STRING([--enable-padlock],[enables VIA Padlock crypto plugin. (default is NO).]),
688         [if test x$enableval = xyes; then
689                 padlock=true
690          else
691                 padlock=false
692         fi],
693 )
694
695 AC_ARG_ENABLE(
696         [openssl],
697         AS_HELP_STRING([--enable-openssl],[enables the OpenSSL crypto plugin. (default is NO).]),
698         [if test x$enableval = xyes; then
699                 openssl=true
700          else
701                 openssl=false
702         fi],
703 )
704
705 AC_ARG_ENABLE(
706         [gcrypt],
707         AS_HELP_STRING([--enable-gcrypt],[enables the libgcrypt plugin. (default is NO).]),
708         [if test x$enableval = xyes; then
709                 gcrypt=true
710          else
711                 gcrypt=false
712         fi],
713 )
714
715 AC_ARG_ENABLE(
716         [agent],
717         AS_HELP_STRING([--enable-agent],[enables the ssh-agent signing plugin. (default is NO).]),
718         [if test x$enableval = xyes; then
719                 agent=true
720          else
721                 agent=false
722         fi],
723 )
724
725 AC_ARG_ENABLE(
726         [uci],
727         AS_HELP_STRING([--enable-uci],[enable OpenWRT UCI configuration plugin (default is NO).]),
728         [if test x$enableval = xyes; then
729                 uci=true
730         fi]
731 )
732
733 AC_ARG_ENABLE(
734         [nm],
735         AS_HELP_STRING([--enable-nm],[enable NetworkManager plugin (default is NO).]),
736         [if test x$enableval = xyes; then
737                 nm=true
738         fi]
739 )
740
741 AC_ARG_ENABLE(
742         [vstr],
743         AS_HELP_STRING([--enable-vstr],[enforce using the Vstr string library to replace glibc-like printf hooks (default is NO).]),
744         [if test x$enableval = xyes; then
745                 vstr=true
746         fi]
747 )
748
749 dnl =========================
750 dnl  set up compiler and flags
751 dnl =========================
752
753 if test -z "$CFLAGS"; then
754         CFLAGS="-g -O2 -Wall -Wno-format -Wno-pointer-sign -Wno-strict-aliasing"
755 fi
756 AC_PROG_CC
757 AC_LIB_PREFIX
758 AC_C_BIGENDIAN
759
760 dnl =========================
761 dnl  check required programs
762 dnl =========================
763
764 AC_PROG_INSTALL
765 AC_PROG_LIBTOOL
766 AC_PROG_EGREP
767 AC_PROG_AWK
768 AC_PROG_LEX
769 AC_PROG_YACC
770 AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
771 AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
772
773 dnl because gperf is not needed by end-users we just report it but do not abort on failure
774 AC_MSG_CHECKING([gperf version >= 3.0.0])
775 if test -x "$GPERF"; then
776         if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
777                 AC_MSG_RESULT([yes])
778         else
779                 AC_MSG_RESULT([no])
780         fi
781 else
782         AC_MSG_RESULT([not found])
783 fi
784
785 dnl translate user/group to numercial ids
786 AC_MSG_CHECKING([for uid of user "$ipsecuser"])
787 ipsecuid=`id -u $ipsecuser 2>/dev/null`
788 if test -n "$ipsecuid"; then
789         AC_MSG_RESULT([$ipsecuid])
790         AC_SUBST(ipsecuid)
791 else
792         AC_MSG_ERROR([not found])
793 fi
794 AC_MSG_CHECKING([for gid of group "$ipsecgroup"])
795 ipsecgid=`$EGREP "^$ipsecgroup:" /etc/group | $AWK -F: '{ print $3 }'`
796 if test -n "$ipsecgid"; then
797         AC_MSG_RESULT([$ipsecgid])
798         AC_SUBST(ipsecgid)
799 else
800         AC_MSG_ERROR([not found])
801 fi
802
803 dnl =========================
804 dnl  dependency calculation
805 dnl =========================
806
807 if test x$eap_aka = xtrue; then
808         gmp=true;
809         fips_prf=true;
810         sha1=true;
811 fi
812
813 if test x$eap_sim = xtrue; then
814         fips_prf=true;
815 fi
816
817 if test x$fips_prf = xtrue; then
818         sha1=true;
819 fi
820
821 if test x$tools = xtrue; then
822         gmp=true;
823 fi
824
825 if test x$smp = xtrue; then
826         xml=true
827 fi
828
829 if test x$manager = xtrue; then
830         fast=true
831 fi
832
833 if test x$medsrv = xtrue; then
834         me=true
835         fast=true
836 fi
837
838 if test x$medcli = xtrue; then
839         me=true
840 fi
841
842 dnl ===========================================
843 dnl  check required libraries and header files
844 dnl ===========================================
845
846 AC_HEADER_STDBOOL
847
848 saved_LIBS=$LIBS
849 LIBS=""
850 AC_SEARCH_LIBS(dlopen, dl, [DLLIB=$LIBS])
851 LIBS=$saved_LIBS
852 AC_SUBST(DLLIB)
853
854 AC_MSG_CHECKING(for dladdr)
855 AC_TRY_COMPILE(
856         [#define _GNU_SOURCE
857          #include <dlfcn.h>],
858         [Dl_info* info = 0;
859          dladdr(0, info);],
860         [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_DLADDR])],
861         [AC_MSG_RESULT([no])]
862 )
863
864 AC_CHECK_FUNCS(backtrace)
865 AC_CHECK_FUNCS(prctl)
866 AC_CHECK_FUNCS(gethostbyname_r)
867
868 AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h)
869
870 AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
871 [
872         #include <sys/types.h>
873         #include <sys/socket.h>
874 ])
875
876 AC_CHECK_MEMBERS([struct sadb_x_policy.sadb_x_policy_priority], [], [],
877 [
878         #include <sys/types.h>
879         #ifdef HAVE_NET_PFKEYV2_H
880         #include <net/pfkeyv2.h>
881         #else
882         #include <stdint.h>
883         #include <linux/pfkeyv2.h>
884         #endif
885 ])
886
887 AC_MSG_CHECKING([for IPSEC_MODE_BEET])
888 AC_TRY_COMPILE(
889         [#include <sys/types.h>
890         #ifdef HAVE_NETIPSEC_IPSEC_H
891         #include <netipsec/ipsec.h>
892         #elif defined(HAVE_NETINET6_IPSEC_H)
893         #include <netinet6/ipsec.h>
894         #else
895         #include <stdint.h>
896         #include <linux/ipsec.h>
897         #endif],
898         [int mode = IPSEC_MODE_BEET;
899          return mode;],
900         [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_MODE_BEET])],
901         [AC_MSG_RESULT([no])]
902 )
903
904 AC_MSG_CHECKING([for IPSEC_DIR_FWD])
905 AC_TRY_COMPILE(
906         [#include <sys/types.h>
907         #ifdef HAVE_NETIPSEC_IPSEC_H
908         #include <netipsec/ipsec.h>
909         #elif defined(HAVE_NETINET6_IPSEC_H)
910         #include <netinet6/ipsec.h>
911         #else
912         #include <stdint.h>
913         #include <linux/ipsec.h>
914         #endif],
915         [int dir = IPSEC_DIR_FWD;
916          return dir;],
917         [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_DIR_FWD])],
918         [AC_MSG_RESULT([no])]
919 )
920
921 AC_MSG_CHECKING([for gcc atomic operations])
922 AC_TRY_RUN(
923 [
924         int main() {
925                 volatile int ref = 1;
926                 __sync_fetch_and_add (&ref, 1);
927                 __sync_sub_and_fetch (&ref, 1);
928                 /* Make sure test fails if operations are not supported */
929                 __sync_val_compare_and_swap(&ref, 1, 0);
930                 return ref;
931         }
932 ],
933 [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_GCC_ATOMIC_OPERATIONS)],
934 [AC_MSG_RESULT([no])],
935 [AC_MSG_RESULT([no])])
936
937 AC_CHECK_FUNC(
938         [register_printf_function],
939         [AC_DEFINE(HAVE_PRINTF_HOOKS)],
940         [
941                 AC_MSG_NOTICE([printf does not support custom format specifiers!])
942                 vstr=true
943         ]
944 )
945
946 if test x$vstr = xtrue; then
947         AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])])
948         AC_DEFINE(USE_VSTR)
949 fi
950
951 if test x$gmp = xtrue; then
952         AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
953         AC_MSG_CHECKING([gmp.h version >= 4.1.4])
954         AC_TRY_COMPILE(
955                 [#include "gmp.h"],
956                 [
957                         #if (__GNU_MP_VERSION*100 +  __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
958                                 #error bad gmp
959                         #endif
960                 ], 
961                 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
962         )
963 fi
964
965 if test x$ldap = xtrue; then
966         AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])])
967         AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])])
968         AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
969 fi
970
971 if test x$curl = xtrue; then
972         AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])])
973         AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
974 fi
975
976 if test x$xml = xtrue; then
977         PKG_CHECK_MODULES(xml, [libxml-2.0])
978         AC_SUBST(xml_CFLAGS)
979         AC_SUBST(xml_LIBS)
980 fi
981
982 if test x$dumm = xtrue; then
983         PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
984         AC_SUBST(gtk_CFLAGS)
985         AC_SUBST(gtk_LIBS)
986         AC_CHECK_PROGS(RUBY, ruby)
987         AC_MSG_CHECKING([for Ruby header files])
988         if test -n "$RUBY"; then
989                 RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
990                 if test -n "$RUBYDIR"; then
991                         dirs="$RUBYDIR"
992                         RUBYINCLUDE=none
993                         for i in $dirs; do
994                                 if test -r $i/ruby.h; then
995                                         AC_MSG_RESULT([$i])
996                                         RUBYINCLUDE="-I$i"
997                                         break;
998                                 fi
999                         done
1000                         if test x"$RUBYINCLUDE" = xnone; then
1001                                 AC_MSG_ERROR([ruby.h not found])
1002                         fi
1003                         AC_SUBST(RUBYINCLUDE)
1004                 else
1005                         AC_MSG_ERROR([unable to determine ruby configuration])
1006                 fi
1007         else
1008                 AC_MSG_ERROR([don't know how to run ruby])
1009         fi
1010 fi
1011
1012 if test x$fast = xtrue; then
1013         AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
1014         AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
1015         AC_HAVE_LIBRARY([z],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver dependency zlib not found!])])
1016 dnl autoconf does not like CamelCase!? How to fix this?
1017 dnl     AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
1018         
1019         AC_HAVE_LIBRARY([fcgi],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])])
1020         AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
1021 fi
1022
1023 if test x$mysql = xtrue; then
1024         AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
1025         AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
1026 fi
1027
1028 if test x$sqlite = xtrue; then
1029         AC_HAVE_LIBRARY([sqlite3],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])])
1030         AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
1031         AC_MSG_CHECKING([sqlite3_prepare_v2])
1032         AC_TRY_COMPILE(
1033                 [#include <sqlite3.h>],
1034                 [
1035                         void *test = sqlite3_prepare_v2;
1036                 ], 
1037                 [AC_MSG_RESULT([yes])]; AC_DEFINE_UNQUOTED(HAVE_SQLITE3_PREPARE_V2, 1), [AC_MSG_RESULT([no])])
1038         AC_MSG_CHECKING([sqlite3.h version >= 3.3.1])
1039         AC_TRY_COMPILE(
1040                 [#include <sqlite3.h>],
1041                 [
1042                         #if SQLITE_VERSION_NUMBER < 3003001
1043                                 #error bad sqlite
1044                         #endif
1045                 ], 
1046                 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([SQLite version >= 3.3.1 required!])])
1047 fi
1048
1049 if test x$openssl = xtrue; then
1050         AC_HAVE_LIBRARY([crypto],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])])
1051         AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
1052 fi
1053
1054 if test x$gcrypt = xtrue; then
1055         AM_PATH_LIBGCRYPT(,,[AC_MSG_ERROR([libgcrypt not found!])])
1056         AC_MSG_CHECKING([gcrypt CAMELLIA cipher])
1057         AC_TRY_COMPILE(
1058                 [#include <gcrypt.h>],
1059                 [enum gcry_cipher_algos alg = GCRY_CIPHER_CAMELLIA128;],
1060                 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GCRY_CIPHER_CAMELLIA])],
1061                 [AC_MSG_RESULT([no])]
1062         )
1063 fi
1064
1065 if test x$uci = xtrue; then
1066         AC_HAVE_LIBRARY([uci],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])])
1067         AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
1068 fi
1069
1070 if test x$nm = xtrue; then
1071         PKG_CHECK_MODULES(nm, [NetworkManager libnm_glib_vpn gthread-2.0])
1072         AC_SUBST(nm_CFLAGS)
1073         AC_SUBST(nm_LIBS)
1074 fi
1075
1076 if test x$eap_gtc = xtrue; then
1077         AC_HAVE_LIBRARY([pam],[LIBS="$LIBS"],[AC_MSG_ERROR([PAM library not found])])
1078         AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])])
1079 fi
1080
1081 if test x$capabilities = xlibcap; then
1082         AC_HAVE_LIBRARY([cap],[LIBS="$LIBS"],[AC_MSG_ERROR([libcap library not found])])
1083         AC_CHECK_HEADER([sys/capability.h],,[AC_MSG_ERROR([libcap header sys/capability.h not found!])])
1084 fi
1085
1086 if test x$integrity_test = xtrue; then
1087         AC_MSG_CHECKING([for dladdr()])
1088         AC_TRY_COMPILE(
1089                 [#define _GNU_SOURCE
1090                  #include <dlfcn.h>],
1091                 [Dl_info info; dladdr(main, &info);], 
1092                 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
1093                  AC_MSG_ERROR([dladdr() not supported, required by integrity-test!])]
1094         )
1095         AC_MSG_CHECKING([for dl_iterate_phdr()])
1096         AC_TRY_COMPILE(
1097                 [#define _GNU_SOURCE
1098                  #include <link.h>],
1099                 [dl_iterate_phdr((void*)0, (void*)0);], 
1100                 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
1101                  AC_MSG_ERROR([dl_iterate_phdr() not supported, required by integrity-test!])]
1102         )
1103 fi
1104
1105 dnl ======================================
1106 dnl  collect all plugins for libstrongswan
1107 dnl ======================================
1108
1109 libstrongswan_plugins=
1110 pluto_plugins=
1111
1112 if test x$test_vectors = xtrue; then
1113         libstrongswan_plugins=${libstrongswan_plugins}" test-vectors"
1114         pluto_plugins=${pluto_plugins}" test-vectors"
1115 fi
1116 if test x$curl = xtrue; then
1117         libstrongswan_plugins=${libstrongswan_plugins}" curl"
1118         pluto_plugins=${pluto_plugins}" curl"
1119 fi
1120 if test x$ldap = xtrue; then
1121         libstrongswan_plugins=${libstrongswan_plugins}" ldap"
1122         pluto_plugins=${pluto_plugins}" ldap"
1123 fi
1124 if test x$aes = xtrue; then
1125         libstrongswan_plugins=${libstrongswan_plugins}" aes"
1126         pluto_plugins=${pluto_plugins}" aes"
1127 fi
1128 if test x$des = xtrue; then
1129         libstrongswan_plugins=${libstrongswan_plugins}" des"
1130         pluto_plugins=${pluto_plugins}" des"
1131 fi
1132 if test x$blowfish = xtrue; then
1133         libstrongswan_plugins=${libstrongswan_plugins}" blowfish"
1134         pluto_plugins=${pluto_plugins}" blowfish"
1135 fi
1136 if test x$sha1 = xtrue; then
1137         libstrongswan_plugins=${libstrongswan_plugins}" sha1"
1138         pluto_plugins=${pluto_plugins}" sha1"
1139 fi
1140 if test x$sha2 = xtrue; then
1141         libstrongswan_plugins=${libstrongswan_plugins}" sha2"
1142         pluto_plugins=${pluto_plugins}" sha2"
1143 fi
1144 if test x$md4 = xtrue; then
1145         libstrongswan_plugins=${libstrongswan_plugins}" md4"
1146 fi
1147 if test x$md5 = xtrue; then
1148         libstrongswan_plugins=${libstrongswan_plugins}" md5"
1149         pluto_plugins=${pluto_plugins}" md5"
1150 fi
1151 if test x$fips_prf = xtrue; then
1152         libstrongswan_plugins=${libstrongswan_plugins}" fips-prf"
1153 fi
1154 if test x$random = xtrue; then
1155         libstrongswan_plugins=${libstrongswan_plugins}" random"
1156         pluto_plugins=${pluto_plugins}" random"
1157 fi
1158 if test x$x509 = xtrue; then
1159         libstrongswan_plugins=${libstrongswan_plugins}" x509"
1160 fi
1161 if test x$pubkey = xtrue; then
1162         libstrongswan_plugins=${libstrongswan_plugins}" pubkey"
1163         pluto_plugins=${pluto_plugins}" pubkey"
1164 fi
1165 if test x$mysql = xtrue; then
1166         libstrongswan_plugins=${libstrongswan_plugins}" mysql"
1167 fi
1168 if test x$sqlite = xtrue; then
1169         libstrongswan_plugins=${libstrongswan_plugins}" sqlite"
1170 fi
1171 if test x$padlock = xtrue; then
1172         libstrongswan_plugins=${libstrongswan_plugins}" padlock"
1173 fi
1174 if test x$openssl = xtrue; then
1175         libstrongswan_plugins=${libstrongswan_plugins}" openssl"
1176         pluto_plugins=${pluto_plugins}" openssl"
1177 fi
1178 if test x$gcrypt = xtrue; then
1179         libstrongswan_plugins=${libstrongswan_plugins}" gcrypt"
1180         pluto_plugins=${pluto_plugins}" gcrypt"
1181 fi
1182 if test x$xcbc = xtrue; then
1183         libstrongswan_plugins=${libstrongswan_plugins}" xcbc"
1184 fi
1185 if test x$hmac = xtrue; then
1186         libstrongswan_plugins=${libstrongswan_plugins}" hmac"
1187         pluto_plugins=${pluto_plugins}" hmac"
1188 fi
1189 if test x$agent = xtrue; then
1190         libstrongswan_plugins=${libstrongswan_plugins}" agent"
1191 fi
1192 if test x$gmp = xtrue; then
1193         libstrongswan_plugins=${libstrongswan_plugins}" gmp"
1194         pluto_plugins=${pluto_plugins}" gmp"
1195 fi
1196
1197 AC_SUBST(libstrongswan_plugins)
1198 AC_SUBST(pluto_plugins)
1199
1200 dnl =========================
1201 dnl  set Makefile.am vars
1202 dnl =========================
1203
1204 dnl libstrongswan plugins
1205 dnl =====================
1206 AM_CONDITIONAL(USE_TEST_VECTORS, test x$test_vectors = xtrue)
1207 AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)
1208 AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
1209 AM_CONDITIONAL(USE_AES, test x$aes = xtrue)
1210 AM_CONDITIONAL(USE_DES, test x$des = xtrue)
1211 AM_CONDITIONAL(USE_BLOWFISH, test x$blowfish = xtrue)
1212 AM_CONDITIONAL(USE_MD4, test x$md4 = xtrue)
1213 AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)
1214 AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)
1215 AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)
1216 AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
1217 AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
1218 AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
1219 AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)
1220 AM_CONDITIONAL(USE_PUBKEY, test x$pubkey = xtrue)
1221 AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)
1222 AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
1223 AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
1224 AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
1225 AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
1226 AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
1227 AM_CONDITIONAL(USE_GCRYPT, test x$gcrypt = xtrue)
1228 AM_CONDITIONAL(USE_AGENT, test x$agent = xtrue)
1229
1230 dnl charon plugins
1231 dnl ==============
1232 AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
1233 AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
1234 AM_CONDITIONAL(USE_MEDCLI, test x$medcli = xtrue)
1235 AM_CONDITIONAL(USE_NM, test x$nm = xtrue)
1236 AM_CONDITIONAL(USE_UCI, test x$uci = xtrue)
1237 AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
1238 AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
1239 AM_CONDITIONAL(USE_UPDOWN, test x$updown = xtrue)
1240 AM_CONDITIONAL(USE_ATTR, test x$attr = xtrue)
1241 AM_CONDITIONAL(USE_RESOLV_CONF, test x$resolvconf = xtrue)
1242 AM_CONDITIONAL(USE_UNIT_TESTS, test x$unittest = xtrue)
1243 AM_CONDITIONAL(USE_LOAD_TESTS, test x$loadtest = xtrue)
1244 AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
1245 AM_CONDITIONAL(USE_EAP_SIM_FILE, test x$eap_sim_file = xtrue)
1246 AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
1247 AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
1248 AM_CONDITIONAL(USE_EAP_GTC, test x$eap_gtc = xtrue)
1249 AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
1250 AM_CONDITIONAL(USE_EAP_MSCHAPV2, test x$eap_mschapv2 = xtrue)
1251 AM_CONDITIONAL(USE_EAP_RADIUS, test x$eap_radius = xtrue)
1252 AM_CONDITIONAL(USE_KERNEL_NETLINK, test x$kernel_netlink = xtrue)
1253 AM_CONDITIONAL(USE_KERNEL_PFKEY, test x$kernel_pfkey = xtrue)
1254 AM_CONDITIONAL(USE_KERNEL_PFROUTE, test x$kernel_pfroute = xtrue)
1255 AM_CONDITIONAL(USE_KERNEL_KLIPS, test x$kernel_klips = xtrue)
1256
1257 dnl other options
1258 dnl =============
1259 AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
1260 AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
1261 AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
1262 AM_CONDITIONAL(USE_LOCK_PROFILER, test x$lock_profiler = xtrue)
1263 AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
1264 AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
1265 AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
1266 AM_CONDITIONAL(USE_DUMM, test x$dumm = xtrue)
1267 AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)
1268 AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
1269 AM_CONDITIONAL(USE_ME, test x$me = xtrue)
1270 AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
1271 AM_CONDITIONAL(USE_CAPABILITIES, test x$capabilities = xlibcap)
1272 AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
1273 AM_CONDITIONAL(USE_THREADS, test x$threads = xtrue)
1274 AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
1275 AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
1276 AM_CONDITIONAL(USE_SCRIPTS, test x$scripts = xtrue)
1277 AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$pluto = xtrue -o x$tools = xtrue)
1278 AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
1279 AM_CONDITIONAL(USE_VSTR, test x$vstr = xtrue)
1280
1281 dnl ==============================
1282 dnl  set global definitions
1283 dnl ==============================
1284
1285 if test x$me = xtrue; then
1286         AC_DEFINE(ME)
1287 fi
1288 if test x$capabilities = xlibcap; then
1289         AC_DEFINE(CAPABILITIES)
1290 fi
1291
1292 dnl ==============================
1293 dnl  build Makefiles
1294 dnl ==============================
1295
1296 AC_OUTPUT(
1297         Makefile
1298         src/Makefile
1299         src/include/Makefile
1300         src/libstrongswan/Makefile
1301         src/libstrongswan/plugins/aes/Makefile
1302         src/libstrongswan/plugins/des/Makefile
1303         src/libstrongswan/plugins/blowfish/Makefile
1304         src/libstrongswan/plugins/md4/Makefile
1305         src/libstrongswan/plugins/md5/Makefile
1306         src/libstrongswan/plugins/sha1/Makefile
1307         src/libstrongswan/plugins/sha2/Makefile
1308         src/libstrongswan/plugins/fips_prf/Makefile
1309         src/libstrongswan/plugins/gmp/Makefile
1310         src/libstrongswan/plugins/random/Makefile
1311         src/libstrongswan/plugins/hmac/Makefile
1312         src/libstrongswan/plugins/xcbc/Makefile
1313         src/libstrongswan/plugins/x509/Makefile
1314         src/libstrongswan/plugins/pubkey/Makefile
1315         src/libstrongswan/plugins/curl/Makefile
1316         src/libstrongswan/plugins/ldap/Makefile
1317         src/libstrongswan/plugins/mysql/Makefile
1318         src/libstrongswan/plugins/sqlite/Makefile
1319         src/libstrongswan/plugins/padlock/Makefile
1320         src/libstrongswan/plugins/openssl/Makefile
1321         src/libstrongswan/plugins/gcrypt/Makefile
1322         src/libstrongswan/plugins/agent/Makefile
1323         src/libstrongswan/plugins/test_vectors/Makefile
1324         src/libfreeswan/Makefile
1325         src/pluto/Makefile
1326         src/whack/Makefile
1327         src/charon/Makefile
1328         src/charon/plugins/eap_aka/Makefile
1329         src/charon/plugins/eap_identity/Makefile
1330         src/charon/plugins/eap_md5/Makefile
1331         src/charon/plugins/eap_gtc/Makefile
1332         src/charon/plugins/eap_sim/Makefile
1333         src/charon/plugins/eap_sim_file/Makefile
1334         src/charon/plugins/eap_mschapv2/Makefile
1335         src/charon/plugins/eap_radius/Makefile
1336         src/charon/plugins/kernel_netlink/Makefile
1337         src/charon/plugins/kernel_pfkey/Makefile
1338         src/charon/plugins/kernel_pfroute/Makefile
1339         src/charon/plugins/kernel_klips/Makefile
1340         src/charon/plugins/smp/Makefile
1341         src/charon/plugins/sql/Makefile
1342         src/charon/plugins/medsrv/Makefile
1343         src/charon/plugins/medcli/Makefile
1344         src/charon/plugins/nm/Makefile
1345         src/charon/plugins/uci/Makefile
1346         src/charon/plugins/stroke/Makefile
1347         src/charon/plugins/updown/Makefile
1348         src/charon/plugins/attr/Makefile
1349         src/charon/plugins/resolv_conf/Makefile
1350         src/charon/plugins/unit_tester/Makefile
1351         src/charon/plugins/load_tester/Makefile
1352         src/stroke/Makefile
1353         src/ipsec/Makefile
1354         src/starter/Makefile
1355         src/_updown/Makefile
1356         src/_updown_espmark/Makefile
1357         src/_copyright/Makefile
1358         src/openac/Makefile
1359         src/scepclient/Makefile
1360         src/dumm/Makefile
1361         src/dumm/ext/extconf.rb
1362         src/libfast/Makefile
1363         src/manager/Makefile
1364         src/medsrv/Makefile
1365         src/checksum/Makefile
1366         scripts/Makefile
1367         testing/Makefile
1368 )