]> git.ipfire.org Git - people/ms/strongswan.git/blame - configure.in
- fixed errors when --enable-pkcs11
[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
19AC_INIT(strongSwan,4.0.0)
20AM_INIT_AUTOMAKE
21AC_C_BIGENDIAN
22AC_SUBST(ipsecdir, '${libexecdir}/ipsec')
23AC_SUBST(confdir, '${sysconfdir}')
24AC_SUBST(piddir, '/var/run')
25
26dnl ===========================
27dnl check --enable-xxx params
28dnl ===========================
29
30AC_ARG_ENABLE(
31 [http],
32 AS_HELP_STRING([--enable-http],[enable OCSP and fetching of Certificates and CRLs over HTTP (default is NO). Requires libcurl.]),
33 http=true
34 AC_DEFINE(LIBCURL)
35)
36AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue)
37
38AC_ARG_ENABLE(
39 [ldap],
40 AS_HELP_STRING([--enable-ldap],[enable fetching of CRLs from LDAP (default is NO). Requires openldap. \
41 Protocol version 2 or 3 are supported, use --with-ldap=version to specify \
42 explicitly.]),
43 ldap=true
44 [case "${enableval}" in
45 2) AC_DEFINE(LDAP_VER, 2) ;;
46 3) AC_DEFINE(LDAP_VER, 3) ;;
47 *) AC_MSG_ERROR([Invalid LDAP protocol version specified!]) ;;
48 esac
49 ]
50)
51AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
52
53AC_ARG_ENABLE(
54 [pkcs11],
55 AS_HELP_STRING([--enable-pkcs11],[enable PKCS11 smartcard support (default is NO). \
56 Set the default PKCS11 library using \
57 --enable-pkcs11=/path/to/default-pkcs11.so]),
58 smartcard=true
59 AC_DEFINE(SMARTCARD)
f0cdc48e 60 AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$enableval")
f2c2d395
MW
61)
62AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
63
64AC_ARG_ENABLE(
65 [leak-detective],
66 AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
67 leak_detective=true
68 AC_DEFINE(USE_LEAK_DETECTIVE)
69)
70AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
71
72dnl =========================
73dnl check required programs
74dnl =========================
75
76AC_PROG_INSTALL
77AC_PROG_LIBTOOL
78AC_PROG_LEX
79AC_PROG_YACC
80AC_PROG_CC(intel)
81
82dnl ==========================
83dnl check required libraries
84dnl ==========================
85
86AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
87if test "$ldap" = "true"; then
88 AC_HAVE_LIBRARY([ldap],,[AC_MSG_ERROR([LDAP enabled, but library ldap not found])])
89 AC_HAVE_LIBRARY([lber],,[AC_MSG_ERROR([LDAP enabled, but library lber not found])])
90fi
91if test "$http" = "true"; then
92 AC_HAVE_LIBRARY([curl],,[AC_MSG_ERROR([HTTP enabled, but library curl not found])])
93fi
94
95
96dnl =============================
97dnl check required header files
98dnl =============================
99
100
101AC_MSG_CHECKING([gmp.h version >= 4.1.4])
102AC_TRY_COMPILE(
103 [#include "gmp.h"],
104 [
105 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
106 #error bad gmp
107 #endif
108 ],
109 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
110)
111if test "$ldap" = "true"; then
112 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])])
113fi
114if test "$http" = "true"; then
115 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])])
116fi
117
118dnl ==============================
119dnl build Makefiles
120dnl ==============================
121
122AC_OUTPUT(
123 Makefile
124 src/Makefile
125 src/libstrongswan/Makefile
126 src/libcrypto/Makefile
127 src/libfreeswan/Makefile
128 src/pluto/Makefile
129 src/whack/Makefile
130 src/charon/Makefile
131 src/stroke/Makefile
132 src/ipsec/Makefile
133 src/starter/Makefile
134 src/_updown/Makefile
135 src/_updown_espmark/Makefile
136 src/_copyright/Makefile
137 src/openac/Makefile
138 src/scepclient/Makefile
139)