]> git.ipfire.org Git - people/ms/strongswan.git/blame - configure.in
- added testing files to dist
[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
b5e15606 19AC_INIT(strongSwan,4.0.1)
5e5f0bd4 20AM_INIT_AUTOMAKE(tar-ustar)
f2c2d395
MW
21AC_C_BIGENDIAN
22AC_SUBST(ipsecdir, '${libexecdir}/ipsec')
23AC_SUBST(confdir, '${sysconfdir}')
24AC_SUBST(piddir, '/var/run')
25
db26d00e
MW
26dnl =================================
27dnl check --enable-xxx & --with-xxx
28dnl =================================
29
30
31AC_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
38AC_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
45AC_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
52AC_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)
58AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue)
59
60AC_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)
66AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
67
68AC_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)
74AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
75
76AC_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)
81AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
82
83dnl =========================
84dnl check required programs
85dnl =========================
86
87AC_PROG_INSTALL
88AC_PROG_LIBTOOL
89AC_PROG_LEX
90AC_PROG_YACC
91AC_PROG_CC(intel)
298b06c2
MW
92AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
93AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
f2c2d395
MW
94
95dnl ==========================
96dnl check required libraries
97dnl ==========================
98
99AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
100if 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])])
103fi
104if test "$http" = "true"; then
105 AC_HAVE_LIBRARY([curl],,[AC_MSG_ERROR([HTTP enabled, but library curl not found])])
106fi
107
108
109dnl =============================
110dnl check required header files
111dnl =============================
112
113
114AC_MSG_CHECKING([gmp.h version >= 4.1.4])
115AC_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)
124if test "$ldap" = "true"; then
125 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])])
126fi
127if test "$http" = "true"; then
128 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])])
129fi
130
131dnl ==============================
132dnl build Makefiles
133dnl ==============================
134
135AC_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)