]>
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 | ||
19 | AC_INIT(strongSwan,4.0.0) | |
20 | AM_INIT_AUTOMAKE | |
21 | AC_C_BIGENDIAN | |
22 | AC_SUBST(ipsecdir, '${libexecdir}/ipsec') | |
23 | AC_SUBST(confdir, '${sysconfdir}') | |
24 | AC_SUBST(piddir, '/var/run') | |
25 | ||
26 | dnl =========================== | |
27 | dnl check --enable-xxx params | |
28 | dnl =========================== | |
29 | ||
30 | AC_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 | ) | |
36 | AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue) | |
37 | ||
38 | AC_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 | ) | |
51 | AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue) | |
52 | ||
53 | AC_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 | ) |
62 | AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue) | |
63 | ||
64 | AC_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 | ) | |
70 | AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue) | |
71 | ||
72 | dnl ========================= | |
73 | dnl check required programs | |
74 | dnl ========================= | |
75 | ||
76 | AC_PROG_INSTALL | |
77 | AC_PROG_LIBTOOL | |
78 | AC_PROG_LEX | |
79 | AC_PROG_YACC | |
80 | AC_PROG_CC(intel) | |
81 | ||
82 | dnl ========================== | |
83 | dnl check required libraries | |
84 | dnl ========================== | |
85 | ||
86 | AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([GNU Multi Precision library gmp not found])]) | |
87 | if 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])]) | |
90 | fi | |
91 | if test "$http" = "true"; then | |
92 | AC_HAVE_LIBRARY([curl],,[AC_MSG_ERROR([HTTP enabled, but library curl not found])]) | |
93 | fi | |
94 | ||
95 | ||
96 | dnl ============================= | |
97 | dnl check required header files | |
98 | dnl ============================= | |
99 | ||
100 | ||
101 | AC_MSG_CHECKING([gmp.h version >= 4.1.4]) | |
102 | AC_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 | ) | |
111 | if test "$ldap" = "true"; then | |
112 | AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])]) | |
113 | fi | |
114 | if test "$http" = "true"; then | |
115 | AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])]) | |
116 | fi | |
117 | ||
118 | dnl ============================== | |
119 | dnl build Makefiles | |
120 | dnl ============================== | |
121 | ||
122 | AC_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 | ) |