]>
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 | ||
b5e15606 | 19 | AC_INIT(strongSwan,4.0.1) |
5e5f0bd4 | 20 | AM_INIT_AUTOMAKE(tar-ustar) |
f2c2d395 MW |
21 | AC_C_BIGENDIAN |
22 | AC_SUBST(ipsecdir, '${libexecdir}/ipsec') | |
23 | AC_SUBST(confdir, '${sysconfdir}') | |
24 | AC_SUBST(piddir, '/var/run') | |
25 | ||
db26d00e MW |
26 | dnl ================================= |
27 | dnl check --enable-xxx & --with-xxx | |
28 | dnl ================================= | |
29 | ||
30 | ||
31 | AC_ARG_WITH( | |
32 | [default-pkcs11], | |
33 | AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than /usr/lib/opensc-pkcs11.so]), | |
34 | [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")], | |
35 | [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")] | |
36 | ) | |
37 | ||
38 | AC_ARG_WITH( | |
39 | [random-device], | |
40 | AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than /dev/random]), | |
41 | [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")], | |
42 | [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")] | |
43 | ) | |
44 | ||
45 | AC_ARG_WITH( | |
46 | [urandom-device], | |
47 | AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than /dev/urandom]), | |
48 | [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")], | |
49 | [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")] | |
50 | ) | |
f2c2d395 MW |
51 | |
52 | AC_ARG_ENABLE( | |
53 | [http], | |
54 | AS_HELP_STRING([--enable-http],[enable OCSP and fetching of Certificates and CRLs over HTTP (default is NO). Requires libcurl.]), | |
55 | http=true | |
56 | AC_DEFINE(LIBCURL) | |
57 | ) | |
58 | AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue) | |
59 | ||
60 | AC_ARG_ENABLE( | |
61 | [ldap], | |
db26d00e | 62 | AS_HELP_STRING([--enable-ldap],[enable fetching of CRLs from LDAP (default is NO). Requires openLDAP.]), |
f2c2d395 | 63 | ldap=true |
db26d00e | 64 | AC_DEFINE(LDAP_VER, 3) |
f2c2d395 MW |
65 | ) |
66 | AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue) | |
67 | ||
68 | AC_ARG_ENABLE( | |
db26d00e MW |
69 | [smartcard], |
70 | AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]), | |
f2c2d395 MW |
71 | smartcard=true |
72 | AC_DEFINE(SMARTCARD) | |
f2c2d395 MW |
73 | ) |
74 | AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue) | |
75 | ||
76 | AC_ARG_ENABLE( | |
77 | [leak-detective], | |
78 | AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]), | |
79 | leak_detective=true | |
f2c2d395 MW |
80 | ) |
81 | AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue) | |
82 | ||
83 | dnl ========================= | |
84 | dnl check required programs | |
85 | dnl ========================= | |
86 | ||
87 | AC_PROG_INSTALL | |
88 | AC_PROG_LIBTOOL | |
89 | AC_PROG_LEX | |
90 | AC_PROG_YACC | |
91 | AC_PROG_CC(intel) | |
298b06c2 MW |
92 | AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin]) |
93 | AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin]) | |
f2c2d395 MW |
94 | |
95 | dnl ========================== | |
96 | dnl check required libraries | |
97 | dnl ========================== | |
98 | ||
99 | AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([GNU Multi Precision library gmp not found])]) | |
100 | if test "$ldap" = "true"; then | |
101 | AC_HAVE_LIBRARY([ldap],,[AC_MSG_ERROR([LDAP enabled, but library ldap not found])]) | |
102 | AC_HAVE_LIBRARY([lber],,[AC_MSG_ERROR([LDAP enabled, but library lber not found])]) | |
103 | fi | |
104 | if test "$http" = "true"; then | |
105 | AC_HAVE_LIBRARY([curl],,[AC_MSG_ERROR([HTTP enabled, but library curl not found])]) | |
106 | fi | |
107 | ||
108 | ||
109 | dnl ============================= | |
110 | dnl check required header files | |
111 | dnl ============================= | |
112 | ||
113 | ||
114 | AC_MSG_CHECKING([gmp.h version >= 4.1.4]) | |
115 | AC_TRY_COMPILE( | |
116 | [#include "gmp.h"], | |
117 | [ | |
118 | #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414 | |
119 | #error bad gmp | |
120 | #endif | |
121 | ], | |
122 | [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])] | |
123 | ) | |
124 | if test "$ldap" = "true"; then | |
125 | AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])]) | |
126 | fi | |
127 | if test "$http" = "true"; then | |
128 | AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])]) | |
129 | fi | |
130 | ||
131 | dnl ============================== | |
132 | dnl build Makefiles | |
133 | dnl ============================== | |
134 | ||
135 | AC_OUTPUT( | |
136 | Makefile | |
137 | src/Makefile | |
138 | src/libstrongswan/Makefile | |
139 | src/libcrypto/Makefile | |
140 | src/libfreeswan/Makefile | |
141 | src/pluto/Makefile | |
142 | src/whack/Makefile | |
143 | src/charon/Makefile | |
144 | src/stroke/Makefile | |
145 | src/ipsec/Makefile | |
146 | src/starter/Makefile | |
147 | src/_updown/Makefile | |
148 | src/_updown_espmark/Makefile | |
149 | src/_copyright/Makefile | |
150 | src/openac/Makefile | |
151 | src/scepclient/Makefile | |
152 | ) |