aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
blob: c13d19b2ee7014bd1d3672ba424f8c146209224e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
dnl  configure.in for linux strongSwan
dnl  Copyright (C) 2006 Martin Willi
dnl  Hochschule fuer Technik Rapperswil
dnl 
dnl  This program is free software; you can redistribute it and/or modify it
dnl  under the terms of the GNU General Public License as published by the
dnl  Free Software Foundation; either version 2 of the License, or (at your
dnl  option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
dnl 
dnl  This program is distributed in the hope that it will be useful, but
dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dnl  for more details.

dnl ===========================
dnl  initialize & set some vars
dnl ===========================

AC_INIT(strongSwan,4.2.0)
AM_INIT_AUTOMAKE(tar-ustar)
AC_C_BIGENDIAN
AC_SUBST(confdir, '${sysconfdir}')

dnl =================================
dnl  check --enable-xxx & --with-xxx
dnl =================================


AC_ARG_WITH(
    [default-pkcs11],
    AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than "/usr/lib/opensc-pkcs11.so"]),
    [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")],
    [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")]
)

AC_ARG_WITH(
    [xauth-module],
    AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]),
    [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")],
)

AC_ARG_WITH(
    [random-device],
    AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than "/dev/random"]),
    [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")],
    [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")]
)
AC_ARG_WITH(
    [resolv-conf],
    AS_HELP_STRING([--with-resolv-conf=file],[set the file to store DNS server information other than "sysconfdir/resolv.conf"]),
    [AC_DEFINE_UNQUOTED(RESOLV_CONF, "$withval")],
    [AC_DEFINE_UNQUOTED(RESOLV_CONF, "${sysconfdir}/resolv.conf")]
)

AC_ARG_WITH(
    [urandom-device],
    AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than "/dev/urandom"]),
    [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")],
    [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")]
)

AC_ARG_WITH(
    [piddir],
    AS_HELP_STRING([--with-piddir=dir],[path for PID and UNIX socket files other than "/var/run"]),
    [AC_SUBST(piddir, "$withval")],
    [AC_SUBST(piddir, "/var/run")]
)

AC_ARG_WITH(
    [ipsecdir],
    AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]),
    [AC_SUBST(ipsecdir, "$withval")],
    [AC_SUBST(ipsecdir, "${libexecdir}/ipsec")]
)
AC_SUBST(plugindir, "${ipsecdir}/plugins")

AC_ARG_WITH(
    [plugindir],
    AS_HELP_STRING([--with-plugindir=dir],[installation path for plugins other than "ipsecdir/plugins"]),
    [AC_SUBST(plugindir, "$withval")],
    [AC_SUBST(plugindir, "${ipsecdir}/plugins")]
)

AC_ARG_WITH(
    [sim-reader],
    AS_HELP_STRING([--with-sim-reader=library.so],[library containing the sim_run_alg()/sim_get_triplet() function for EAP-SIM]),
    [AC_SUBST(simreader, "$withval")],
    [AC_SUBST(simreader, "${plugindir}/libeapsim-file.so")]
)

AC_ARG_WITH(
    [linux-headers],
    AS_HELP_STRING([--with-linux-headers=dir],[use the linux header files in dir instead of the supplied ones in "src/include"]),
    [AC_SUBST(linuxdir, "$withval")], [AC_SUBST(linuxdir, "../include")]
)
AC_SUBST(LINUX_HEADERS)

AC_ARG_WITH(
    [routing-table],
    AS_HELP_STRING([--with-routing-table=num],[use routing table for IPsec routes (default: 220)]),
    [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, $withval) AC_SUBST(IPSEC_ROUTING_TABLE, "$withval")], 
    [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, 220) AC_SUBST(IPSEC_ROUTING_TABLE, "220")]
)

AC_ARG_WITH(
    [routing-table-prio],
    AS_HELP_STRING([--with-routing-table-prio=prio],[priority for IPsec routing table (default: 220)]),
    [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, $withval) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "$withval")], 
    [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, 220) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "220")]
)

AC_ARG_WITH(
    [uid],
    AS_HELP_STRING([--with-uid=uid],[change user of the daemons to UID after startup (default is 0).]),
    [AC_DEFINE_UNQUOTED(IPSEC_UID, $withval) AC_SUBST(ipsecuid, "$withval")],
    [AC_DEFINE_UNQUOTED(IPSEC_UID, 0) AC_SUBST(ipsecuid, "0")]
)

AC_ARG_WITH(
    [gid],
    AS_HELP_STRING([--with-gid=gid],[change group of the daemons to GID after startup (default is 0).]),
    [AC_DEFINE_UNQUOTED(IPSEC_GID, $withval) AC_SUBST(ipsecgid, "$withval")],
    [AC_DEFINE_UNQUOTED(IPSEC_GID, 0) AC_SUBST(ipsecgid, "0")]
)

AC_ARG_ENABLE(
    [curl],
    AS_HELP_STRING([--enable-curl],[enable CURL fetcher plugin to fetch files via libcurl (default is NO). Requires libcurl.]),
    [if test x$enableval = xyes; then
        curl=true
    fi]
)
AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)

AC_ARG_ENABLE(
    [ldap],
    AS_HELP_STRING([--enable-ldap],[enable LDAP fetching plugin to fetch files via libldap (default is NO). Requires openLDAP.]),
    [if test x$enableval = xyes; then
        ldap=true
    fi]
)
AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)

AC_ARG_ENABLE(
    [aes],
    AS_HELP_STRING([--disable-aes],[disable own AES software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        aes=true
     else
        aes=false
    fi],
    aes=true
)
AM_CONDITIONAL(USE_AES, test x$aes = xtrue)

AC_ARG_ENABLE(
    [des],
    AS_HELP_STRING([--disable-des],[disable own DES/3DES software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        des=true
     else
        des=false
    fi],
    des=true
)
AM_CONDITIONAL(USE_DES, test x$des = xtrue)

AC_ARG_ENABLE(
    [md5],
    AS_HELP_STRING([--disable-md5],[disable own MD5 software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        md5=true
     else
        md5=false
    fi],
    md5=true
)
AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)

AC_ARG_ENABLE(
    [sha1],
    AS_HELP_STRING([--disable-sha1],[disable own SHA1 software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        sha1=true
     else
        sha1=false
    fi],
    sha1=true
)
AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)

AC_ARG_ENABLE(
    [sha2],
    AS_HELP_STRING([--disable-sha2],[disable own SHA256/SHA384/SHA512 software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        sha2=true
     else
        sha2=false
    fi],
    sha2=true
)
AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)

AC_ARG_ENABLE(
    [fips-prf],
    AS_HELP_STRING([--disable-fips-prf],[disable FIPS PRF software implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        fips_prf=true
     else
        fips_prf=false
    fi],
    fips_prf=true
)
AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)

AC_ARG_ENABLE(
    [gmp],
    AS_HELP_STRING([--disable-gmp],[disable own GNU MP (libgmp) based crypto implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        gmp=true
     else
        gmp=false
    fi],
    gmp=true
)
AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)

AC_ARG_ENABLE(
    [x509],
    AS_HELP_STRING([--disable-x509],[disable own X509 certificate implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        x509=true
     else
        x509=false
    fi],
    x509=true
)
AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)

AC_ARG_ENABLE(
    [hmac],
    AS_HELP_STRING([--disable-hmac],[disable HMAC crypto implementation plugin. (default is NO).]),
    [if test x$enableval = xyes; then
        hmac=true
     else
        hmac=false
    fi],
    hmac=true
)
AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)

AC_ARG_ENABLE(
    [mysql],
    AS_HELP_STRING([--enable-mysql],[enable MySQL database support (default is NO). Requires libmysqlclient_r.]),
    [if test x$enableval = xyes; then
        mysql=true
    fi]
)
AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)

AC_ARG_ENABLE(
    [sqlite],
    AS_HELP_STRING([--enable-sqlite],[enable SQLite database support (default is NO). Requires libsqlite3.]),
    [if test x$enableval = xyes; then
        sqlite=true
    fi]
)
AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)

AC_ARG_ENABLE(
    [stroke],
    AS_HELP_STRING([--disable-stroke],[disable charons stroke (pluto compatibility) configuration backend. (default is NO).]),
    [if test x$enableval = xyes; then
        stroke=true
     else
        stroke=false
    fi],
    stroke=true
)
AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)

AC_ARG_ENABLE(
    [med-db],
    AS_HELP_STRING([--enable-med-db],[enable MySQL mediation database plugin (default is NO).]),
    [if test x$enableval = xyes; then
        med_db=true
        AC_DEFINE(LIBDBUS)
    fi]
)
AM_CONDITIONAL(USE_MED_DB, test x$med_db = xtrue)

AC_ARG_ENABLE(
    [dbus],
    AS_HELP_STRING([--enable-dbus],[enable DBUS configuration and control interface (default is NO). Requires libdbus.]),
    [if test x$enableval = xyes; then
        dbus=true
        AC_DEFINE(LIBDBUS)
    fi]
)
AM_CONDITIONAL(USE_LIBDBUS, test x$dbus = xtrue)

AC_ARG_ENABLE(
    [xml],
    AS_HELP_STRING([--enable-xml],[enable XML configuration and control interface (default is NO). Requires libxml.]),
    [if test x$enableval = xyes; then
        xml=true
        AC_DEFINE(LIBXML)
    fi]
)
AM_CONDITIONAL(USE_LIBXML, test x$xml = xtrue)

AC_ARG_ENABLE(
    [sql],
    AS_HELP_STRING([--enable-sql],[enable SQL database configuration backend (default is NO).]),
    [if test x$enableval = xyes; then
        sql=true
    fi]
)
AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)

AC_ARG_ENABLE(
    [smartcard],
    AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]),
    [if test x$enableval = xyes; then
        smartcard=true
        AC_DEFINE(SMARTCARD)
    fi]
)
AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)

AC_ARG_ENABLE(
    [cisco-quirks],
    AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]),
    [if test x$enableval = xyes; then
        cisco_quirks=true
    fi]
)
AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)

AC_ARG_ENABLE(
    [leak-detective],
    AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
    [if test x$enableval = xyes; then
        leak_detective=true
    fi]
)
AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)

AC_ARG_ENABLE(
    [unit-tests],
    AS_HELP_STRING([--enable-unit-tests],[enable unit tests on IKEv2 daemon startup (default is NO).]),
    [if test x$enableval = xyes; then
        unittest=true
    fi]
)
AM_CONDITIONAL(USE_UNIT_TESTS, test x$unittest = xtrue)

AC_ARG_ENABLE(
    [eap-sim],
    AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]),
    [if test x$enableval = xyes; then
        eap_sim=true
    fi]
)
AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)

AC_ARG_ENABLE(
    [eap-identity],
    AS_HELP_STRING([--enable-eap-identity],[build EAP module providing EAP-Identity helper (default is NO).]),
    [if test x$enableval = xyes; then
        eap_identity=true
    fi]
)
AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)

AC_ARG_ENABLE(
    [eap-md5],
    AS_HELP_STRING([--enable-eap-md5],[build MD5 (CHAP) authenication module for EAP (default is NO).]),
    [if test x$enableval = xyes; then
        eap_md5=true
    fi]
)
AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)

AC_ARG_ENABLE(
    [eap-aka],
    AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
    [if test x$enableval = xyes; then
        eap_aka=true
    fi]
)
AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)

AC_ARG_ENABLE(
    [nat-transport],
    AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
    [if test x$enableval = xyes; then
        nat_transport=true
    fi]
)
AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)

AC_ARG_ENABLE(
    [vendor-id],
    AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
    [if test x$enableval = xyes; then
        vendor_id=true
     else
        vendor_id=false
    fi],
    vendor_id=true
)
AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)

AC_ARG_ENABLE(
    [xauth-vid],
    AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
    [if test x$enableval = xyes; then
        xauth_vid=true
     else
        xauth_vid=false
    fi],
    xauth_vid=true
)
AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)

AC_ARG_ENABLE(
    [uml],
    AS_HELP_STRING([--enable-uml],[build the UML test framework (default is NO).]),
    [if test x$enableval = xyes; then
        uml=true
    fi]
)
AM_CONDITIONAL(USE_UML, test x$uml = xtrue)

AC_ARG_ENABLE(
    [fast],
    AS_HELP_STRING([--enable-fast],[build libfast (FastCGI Application Server w/ templates (default is NO).]),
    [if test x$enableval = xyes; then
        fast=true
    fi]
)
AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)

AC_ARG_ENABLE(
    [manager],
    AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
    [if test x$enableval = xyes; then
        manager=true
    fi]
)
AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)

AC_ARG_ENABLE(
    [p2p],
    AS_HELP_STRING([--enable-p2p],[enable peer-to-peer NAT traversal (default is NO).]),
    [if test x$enableval = xyes; then
        p2p=true
        AC_DEFINE(P2P)
    fi]
)
AM_CONDITIONAL(USE_P2P, test x$p2p = xtrue)

AC_ARG_ENABLE(
    [integrity-test],
    AS_HELP_STRING([--enable-integrity-test],[enable the integrity test of the crypto library (default is NO).]),
    [if test x$enableval = xyes; then
        integrity_test=true 
        AC_DEFINE(INTEGRITY_TEST)
     fi]
)
AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)

AC_ARG_ENABLE(
    [self-test],
    AS_HELP_STRING([--disable-self-test],[disable the self-test of the crypto library (default is NO).]),
    [if test x$enableval = xyes; then
        self_test=true
     else
        self_test=false
        AC_DEFINE(NO_SELF_TEST)
     fi],
        self_test=true
)
AM_CONDITIONAL(USE_SELF_TEST, test x$self_test = xtrue)

AC_ARG_ENABLE(
    [pluto],
    AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
    [if test x$enableval = xyes; then
        pluto=true
     else
        pluto=false
    fi],
    pluto=true
)
AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)

AC_ARG_ENABLE(
    [charon],
    AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
    [if test x$enableval = xyes; then
        charon=true
     else
        charon=false
    fi],
    charon=true
)
AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)

AC_ARG_ENABLE(
    [tools],
    AS_HELP_STRING([--disable-tools],[disable additional utilities (openac and scepclient). (default is NO).]),
    [if test x$enableval = xyes; then
        tools=true
     else
        tools=false
    fi],
    tools=true
)
AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)

AM_CONDITIONAL(USE_PLUTO_OR_CHARON, test x$pluto = xtrue -o x$charon = xtrue)
AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$tools = xtrue)
AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)

dnl =========================
dnl  check required programs
dnl =========================

AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_CC()
AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])

dnl ==========================
dnl  check required libraries
dnl ==========================

AC_HAVE_LIBRARY(dl)

AC_CHECK_FUNCS(backtrace)
AC_CHECK_FUNCS(dladdr)
AC_CHECK_FUNCS(getifaddrs)

AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])	
if test "$ldap" = "true"; then
    AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library ldap not found])])
    AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library lber not found])])
fi
if test "$curl" = "true"; then
    AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL enabled, but library curl not found])])
fi

if test "$xml" = "true"; then
	PKG_CHECK_MODULES(xml, [libxml-2.0],, AC_MSG_ERROR([No libxml2 package information found]))
	AC_SUBST(xml_CFLAGS)
	AC_SUBST(xml_LIBS)
fi

if test "$dbus" = "true"; then
	PKG_CHECK_MODULES(dbus, [dbus-1],, AC_MSG_ERROR([No libdbus package information found]))
	AC_SUBST(dbus_CFLAGS)
	AC_SUBST(dbus_LIBS)
fi


dnl =============================
dnl  check required header files
dnl =============================


AC_MSG_CHECKING([gmp.h version >= 4.1.4])
AC_TRY_COMPILE(
    [#include "gmp.h"],
    [
        #if (__GNU_MP_VERSION*100 +  __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
            #error bad gmp
        #endif
    ], 
    [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
)
AC_MSG_CHECKING([capset() definition])
AC_TRY_COMPILE(
    [#include <linux/capset.h>],
    [
    	void *test = capset;
    ], 
    [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_DEFINE_UNQUOTED(NO_CAPSET_DEFINED, 1)]
)
if test "$ldap" = "true"; then
    AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])])
fi
if test "$curl" = "true"; then
    AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL enabled, but curl.h not found!])])
fi

dnl ==============================
dnl  build Makefiles
dnl ==============================

AC_OUTPUT(
	Makefile
	src/Makefile
	src/include/Makefile
	src/libstrongswan/Makefile
	src/libstrongswan/plugins/aes/Makefile
	src/libstrongswan/plugins/des/Makefile
	src/libstrongswan/plugins/md5/Makefile
	src/libstrongswan/plugins/sha1/Makefile
	src/libstrongswan/plugins/sha2/Makefile
	src/libstrongswan/plugins/fips_prf/Makefile
	src/libstrongswan/plugins/gmp/Makefile
	src/libstrongswan/plugins/hmac/Makefile
	src/libstrongswan/plugins/x509/Makefile
	src/libstrongswan/plugins/curl/Makefile
	src/libstrongswan/plugins/ldap/Makefile
	src/libstrongswan/plugins/mysql/Makefile
	src/libstrongswan/plugins/sqlite/Makefile
	src/libcrypto/Makefile
	src/libfreeswan/Makefile
	src/pluto/Makefile
	src/whack/Makefile
	src/charon/Makefile
	src/charon/plugins/eap_aka/Makefile
	src/charon/plugins/eap_identity/Makefile
	src/charon/plugins/eap_md5/Makefile
	src/charon/plugins/eap_sim/Makefile
	src/charon/plugins/dbus/Makefile
	src/charon/plugins/xml/Makefile
	src/charon/plugins/sql/Makefile
	src/charon/plugins/med_db/Makefile
	src/charon/plugins/stroke/Makefile
	src/charon/plugins/unit_tester/Makefile
	src/stroke/Makefile
	src/ipsec/Makefile
	src/starter/Makefile
	src/_updown/Makefile
	src/_updown_espmark/Makefile
	src/_copyright/Makefile
	src/openac/Makefile
	src/scepclient/Makefile
	src/dumm/Makefile
	src/libfast/Makefile
	src/manager/Makefile
	testing/Makefile
)