]>
Commit | Line | Data |
---|---|---|
f2c2d395 MW |
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 | ||
83e60eb2 | 19 | AC_INIT(strongSwan,4.1.2) |
5e5f0bd4 | 20 | AM_INIT_AUTOMAKE(tar-ustar) |
f2c2d395 | 21 | AC_C_BIGENDIAN |
f2c2d395 | 22 | AC_SUBST(confdir, '${sysconfdir}') |
f2c2d395 | 23 | |
db26d00e MW |
24 | dnl ================================= |
25 | dnl check --enable-xxx & --with-xxx | |
26 | dnl ================================= | |
27 | ||
28 | ||
29 | AC_ARG_WITH( | |
30 | [default-pkcs11], | |
f27f6296 | 31 | AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than "/usr/lib/opensc-pkcs11.so"]), |
db26d00e MW |
32 | [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")], |
33 | [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")] | |
34 | ) | |
35 | ||
195307b5 | 36 | AC_ARG_WITH( |
7b0c588a | 37 | [xauth-module], |
195307b5 AS |
38 | AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]), |
39 | [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")], | |
40 | ) | |
41 | ||
db26d00e MW |
42 | AC_ARG_WITH( |
43 | [random-device], | |
f27f6296 | 44 | AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than "/dev/random"]), |
db26d00e MW |
45 | [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")], |
46 | [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")] | |
47 | ) | |
c60c7694 MW |
48 | AC_ARG_WITH( |
49 | [resolv-conf], | |
50 | AS_HELP_STRING([--with-resolv-conf=file],[set the file to store DNS server information other than "sysconfdir/resolv.conf"]), | |
51 | [AC_DEFINE_UNQUOTED(RESOLV_CONF, "$withval")], | |
52 | [AC_DEFINE_UNQUOTED(RESOLV_CONF, "${sysconfdir}/resolv.conf")] | |
53 | ) | |
db26d00e MW |
54 | |
55 | AC_ARG_WITH( | |
56 | [urandom-device], | |
f27f6296 | 57 | AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than "/dev/urandom"]), |
db26d00e MW |
58 | [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")], |
59 | [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")] | |
60 | ) | |
f2c2d395 | 61 | |
f27f6296 MW |
62 | AC_ARG_WITH( |
63 | [ipsecdir], | |
64 | AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]), | |
65 | [AC_SUBST(ipsecdir, "$withval")], | |
66 | [AC_SUBST(ipsecdir, "${libexecdir}/ipsec")] | |
67 | ) | |
68 | ||
69 | AC_ARG_WITH( | |
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")] | |
74 | ) | |
75 | ||
76 | AC_ARG_WITH( | |
77 | [eapdir], | |
78 | AS_HELP_STRING([--with-eapdir=dir],[path for pluggable EAP modules other than "ipsecdir/eap"]), | |
79 | [AC_SUBST(eapdir, "$withval")], | |
80 | [AC_SUBST(eapdir, "${ipsecdir}/eap")] | |
81 | ) | |
82 | ||
d560c849 MW |
83 | AC_ARG_WITH( |
84 | [sim-reader], | |
85 | AS_HELP_STRING([--with-sim-reader=library.so],[library containing the sim_run_alg() function for EAP-SIM]), | |
86 | [AC_DEFINE_UNQUOTED(SIM_READER_LIB, "$withval")] | |
87 | ) | |
88 | ||
f2c2d395 MW |
89 | AC_ARG_ENABLE( |
90 | [http], | |
91 | AS_HELP_STRING([--enable-http],[enable OCSP and fetching of Certificates and CRLs over HTTP (default is NO). Requires libcurl.]), | |
7b0c588a AS |
92 | [if test x$enableval = xyes; then |
93 | http=true | |
94 | AC_DEFINE(LIBCURL) | |
95 | fi] | |
f2c2d395 MW |
96 | ) |
97 | AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue) | |
98 | ||
99 | AC_ARG_ENABLE( | |
100 | [ldap], | |
db26d00e | 101 | AS_HELP_STRING([--enable-ldap],[enable fetching of CRLs from LDAP (default is NO). Requires openLDAP.]), |
7b0c588a AS |
102 | [if test x$enableval = xyes; then |
103 | ldap=true | |
2c0e0f4f | 104 | AC_DEFINE(LIBLDAP) |
7b0c588a | 105 | fi] |
f2c2d395 | 106 | ) |
2c0e0f4f | 107 | AM_CONDITIONAL(USE_LIBLDAP, test x$ldap = xtrue) |
f2c2d395 MW |
108 | |
109 | AC_ARG_ENABLE( | |
db26d00e MW |
110 | [smartcard], |
111 | AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]), | |
7b0c588a AS |
112 | [if test x$enableval = xyes; then |
113 | smartcard=true | |
114 | AC_DEFINE(SMARTCARD) | |
115 | fi] | |
f2c2d395 MW |
116 | ) |
117 | AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue) | |
118 | ||
2df45a73 | 119 | AC_ARG_ENABLE( |
7b0c588a | 120 | [cisco-quirks], |
2df45a73 | 121 | AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]), |
7b0c588a AS |
122 | [if test x$enableval = xyes; then |
123 | cisco_quirks=true | |
124 | fi] | |
2df45a73 AS |
125 | ) |
126 | AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue) | |
127 | ||
f2c2d395 MW |
128 | AC_ARG_ENABLE( |
129 | [leak-detective], | |
130 | AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]), | |
7b0c588a AS |
131 | [if test x$enableval = xyes; then |
132 | leak_detective=true | |
133 | fi] | |
f2c2d395 MW |
134 | ) |
135 | AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue) | |
136 | ||
b0f24449 MW |
137 | AC_ARG_ENABLE( |
138 | [eap-sim], | |
139 | AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]), | |
7b0c588a AS |
140 | [if test x$enableval = xyes; then |
141 | eap_sim=true | |
142 | fi] | |
b0f24449 MW |
143 | ) |
144 | AM_CONDITIONAL(BUILD_EAP_SIM, test x$eap_sim = xtrue) | |
145 | ||
7b0c588a AS |
146 | AC_ARG_ENABLE( |
147 | [nat-transport], | |
148 | AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]), | |
149 | [if test x$enableval = xyes; then | |
150 | nat_transport=true | |
151 | fi] | |
152 | ) | |
153 | AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue) | |
154 | ||
155 | AC_ARG_ENABLE( | |
156 | [vendor-id], | |
157 | AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]), | |
158 | [if test x$enableval = xyes; then | |
159 | vendor_id=true | |
160 | else | |
161 | vendor_id=false | |
162 | fi], | |
163 | vendor_id=true | |
164 | ) | |
165 | AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue) | |
166 | ||
f2c2d395 MW |
167 | dnl ========================= |
168 | dnl check required programs | |
169 | dnl ========================= | |
170 | ||
171 | AC_PROG_INSTALL | |
172 | AC_PROG_LIBTOOL | |
173 | AC_PROG_LEX | |
174 | AC_PROG_YACC | |
4986554f | 175 | AC_PROG_CC() |
298b06c2 MW |
176 | AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin]) |
177 | AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin]) | |
f2c2d395 MW |
178 | |
179 | dnl ========================== | |
180 | dnl check required libraries | |
181 | dnl ========================== | |
182 | ||
4986554f | 183 | AC_CHECK_FUNCS(backtrace) |
61dd20f9 | 184 | AC_CHECK_FUNCS(getifaddrs) |
e696757c | 185 | |
c09d8959 | 186 | AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])]) |
f2c2d395 | 187 | if test "$ldap" = "true"; then |
c09d8959 AS |
188 | AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library ldap not found])]) |
189 | AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library lber not found])]) | |
f2c2d395 MW |
190 | fi |
191 | if test "$http" = "true"; then | |
c09d8959 | 192 | AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([HTTP enabled, but library curl not found])]) |
f2c2d395 MW |
193 | fi |
194 | ||
195 | ||
196 | dnl ============================= | |
197 | dnl check required header files | |
198 | dnl ============================= | |
199 | ||
200 | ||
201 | AC_MSG_CHECKING([gmp.h version >= 4.1.4]) | |
202 | AC_TRY_COMPILE( | |
203 | [#include "gmp.h"], | |
204 | [ | |
205 | #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414 | |
206 | #error bad gmp | |
207 | #endif | |
208 | ], | |
209 | [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])] | |
210 | ) | |
211 | if test "$ldap" = "true"; then | |
212 | AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])]) | |
213 | fi | |
214 | if test "$http" = "true"; then | |
215 | AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])]) | |
216 | fi | |
217 | ||
218 | dnl ============================== | |
219 | dnl build Makefiles | |
220 | dnl ============================== | |
221 | ||
222 | AC_OUTPUT( | |
223 | Makefile | |
224 | src/Makefile | |
225 | src/libstrongswan/Makefile | |
226 | src/libcrypto/Makefile | |
227 | src/libfreeswan/Makefile | |
228 | src/pluto/Makefile | |
229 | src/whack/Makefile | |
230 | src/charon/Makefile | |
92ee45a0 | 231 | dnl src/charon/testing/Makefile |
f2c2d395 MW |
232 | src/stroke/Makefile |
233 | src/ipsec/Makefile | |
234 | src/starter/Makefile | |
235 | src/_updown/Makefile | |
236 | src/_updown_espmark/Makefile | |
237 | src/_copyright/Makefile | |
238 | src/openac/Makefile | |
239 | src/scepclient/Makefile | |
240 | ) |