/
configure.ac
1008 lines (920 loc) · 34.3 KB
1
AC_INIT(openconnect, 7.08)
2
3
AC_CONFIG_HEADERS([config.h])
4
5
PKG_PROG_PKG_CONFIG
AC_LANG_C
6
AC_CANONICAL_HOST
7
AM_MAINTAINER_MODE([enable])
8
AM_INIT_AUTOMAKE([foreign tar-ustar])
9
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11
AC_PREREQ([2.62], [], [AC_SUBST([localedir], ['$(datadir)/locale'])])
12
13
14
15
16
17
18
19
20
21
22
# Upstream's pkg.m4 (since 0.27) offers this now, but define our own
# compatible version in case the local version of pkgconfig isn't new enough.
# https://bugs.freedesktop.org/show_bug.cgi?id=48743
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR],
[AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir],
[install directory for openconnect.pc pkg-config file])],
[],[with_pkgconfigdir='$(libdir)/pkgconfig'])
AC_SUBST([pkgconfigdir], [${with_pkgconfigdir}])])
23
use_openbsd_libtool=
24
25
symver_time=
symver_getline=
26
27
symver_asprintf=
symver_vasprintf=
28
symver_win32_strerror=
29
30
case $host_os in
31
*linux* | *gnu* | *nacl*)
32
AC_MSG_NOTICE([Applying feature macros for GNU build])
33
AC_DEFINE(_GNU_SOURCE, 1, [_GNU_SOURCE])
34
35
36
;;
*netbsd*)
AC_MSG_NOTICE([Applying feature macros for NetBSD build])
37
38
AC_DEFINE(_POSIX_C_SOURCE, 200112L, [_POSIX_C_SOURCE])
AC_DEFINE(_NETBSD_SOURCE, 1, [_NETBSD_SOURCE])
39
;;
40
41
42
43
*openbsd*)
AC_MSG_NOTICE([Applying feature macros for OpenBSD build])
use_openbsd_libtool=true
;;
44
45
*solaris*|*sunos*)
AC_MSG_NOTICE([Applying workaround for broken SunOS time() function])
46
AC_DEFINE(HAVE_SUNOS_BROKEN_TIME, 1, [On SunOS time() can go backwards])
47
48
symver_time="openconnect__time;"
;;
49
*mingw32*|*mingw64*|*msys*)
50
AC_MSG_NOTICE([Applying feature macros for MinGW/Windows build])
51
# For GetVolumeInformationByHandleW() which is Vista+
52
AC_DEFINE(_WIN32_WINNT, 0x600, [Windows API version])
53
have_win=yes
54
55
# For asprintf()
AC_DEFINE(_GNU_SOURCE, 1, [_GNU_SOURCE])
56
symver_win32_strerror="openconnect__win32_strerror;"
57
# Win32 does have the SCard API
58
59
system_pcsc_libs="-lwinscard"
system_pcsc_cflags=
60
;;
61
*darwin*)
62
63
system_pcsc_libs="-Wl,-framework -Wl,PCSC"
system_pcsc_cflags=
64
;;
65
66
67
68
69
70
71
*)
# On FreeBSD the only way to get vsyslog() visible is to define
# *nothing*, which makes absolutely everything visible.
# On Darwin enabling _POSIX_C_SOURCE breaks <sys/mount.h> because
# u_long and other types don't get defined. OpenBSD is similar.
;;
esac
72
AM_CONDITIONAL(OPENCONNECT_WIN32, [ test "$have_win" = "yes" ])
73
74
75
76
77
78
AC_ARG_WITH([vpnc-script],
[AS_HELP_STRING([--with-vpnc-script],
[default location of vpnc-script helper])])
if test "$with_vpnc_script" = "yes" || test "$with_vpnc_script" = ""; then
79
80
81
82
83
84
if test "$have_win" = "yes"; then
with_vpnc_script=vpnc-script-win.js
else
with_vpnc_script=/etc/vpnc/vpnc-script
if ! test -x "$with_vpnc_script"; then
AC_MSG_ERROR([${with_vpnc_script} does not seem to be executable.]
85
86
87
88
89
90
91
92
93
94
95
96
97
[OpenConnect will not function correctly without a vpnc-script.]
[See http://www.infradead.org/openconnect/vpnc-script.html for more details.]
[]
[If you are building a distribution package, please ensure that your]
[packaging is correct, and that a vpnc-script will be installed when the]
[user installs your package. You should provide a --with-vpnc-script=]
[argument to this configure script, giving the full path where the script]
[will be installed.]
[]
[The standard location is ${with_vpnc_script}. To bypass this error and]
[build OpenConnect to use the script from this location, even though it is]
[not present at the time you are building OpenConnect, pass the argument]
["--with-vpnc-script=${with_vpnc_script}"])
98
99
fi
fi
100
101
102
103
elif test "$with_vpnc_script" = "no"; then
AC_ERROR([You cannot disable vpnc-script.]
[OpenConnect will not function correctly without it.]
[See http://www.infradead.org/openconnect/vpnc-script.html])
104
105
106
107
elif test "$have_win" = "yes"; then
# Oh Windows how we hate thee. If user specifies a vpnc-script and it contains
# backslashes, double them all up to survive escaping.
with_vpnc_script="$(echo "${with_vpnc_script}" | sed s/\\\\/\\\\\\\\/g)"
108
109
fi
110
AC_DEFINE_UNQUOTED(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}", [Default vpnc-script locatin])
111
112
AC_SUBST(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}")
113
AC_CHECK_FUNC(fdevname_r, [AC_DEFINE(HAVE_FDEVNAME_R, 1, [Have fdevname_r() function])], [])
114
AC_CHECK_FUNC(statfs, [AC_DEFINE(HAVE_STATFS, 1, [Have statfs() function])], [])
115
116
117
AC_CHECK_FUNC(getline, [AC_DEFINE(HAVE_GETLINE, 1, [Have getline() function])],
[symver_getline="openconnect__getline;"])
AC_CHECK_FUNC(strcasestr, [AC_DEFINE(HAVE_STRCASESTR, 1, [Have strcasestr() function])], [])
118
AC_CHECK_FUNC(strndup, [AC_DEFINE(HAVE_STRNDUP, 1, [Have strndup() function])], [])
119
120
121
122
123
124
AC_CHECK_FUNC(asprintf, [AC_DEFINE(HAVE_ASPRINTF, 1, [Have asprintf() function])],
[symver_asprintf="openconnect__asprintf;"])
AC_CHECK_FUNC(vasprintf, [AC_DEFINE(HAVE_VASPRINTF, 1, [Have vasprintf() function])],
[symver_vasprintf="openconnect__vasprintf;"])
if test -n "$symver_vasprintf"; then
125
126
127
128
129
130
131
AC_MSG_CHECKING([for va_copy])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stdarg.h>
va_list a;],[
va_list b;
va_copy(b,a);
va_end(b);])],
132
[AC_DEFINE(HAVE_VA_COPY, 1, [Have va_copy()])
133
134
135
136
137
138
139
AC_MSG_RESULT(va_copy)],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stdarg.h>
va_list a;],[
va_list b;
__va_copy(b,a);
va_end(b);])],
140
[AC_DEFINE(HAVE___VA_COPY, 1, [Have __va_copy()])
141
142
AC_MSG_RESULT(__va_copy)],
[AC_MSG_RESULT(no)
143
AC_MSG_ERROR([Your system lacks vasprintf() and va_copy()])])
144
145
])
fi
146
147
AC_SUBST(SYMVER_TIME, $symver_time)
AC_SUBST(SYMVER_GETLINE, $symver_getline)
148
149
AC_SUBST(SYMVER_ASPRINTF, $symver_asprintf)
AC_SUBST(SYMVER_VASPRINTF, $symver_vasprintf)
150
AC_SUBST(SYMVER_WIN32_STRERROR, $symver_win32_strerror)
151
152
AS_COMPILER_FLAGS(WFLAGS,
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
"-Wall
-Wextra
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
-Werror=pointer-to-int-cast
-Wdeclaration-after-statement
-Werror-implicit-function-declaration
-Wformat-nonliteral
-Wformat-security
-Winit-self
-Wmissing-declarations
-Wmissing-include-dirs
-Wnested-externs
-Wpointer-arith
-Wwrite-strings")
169
AC_SUBST(WFLAGS, [$WFLAGS])
170
171
172
if test "$have_win" = yes; then
# Checking "properly" for __attribute__((dllimport,stdcall)) functions is non-trivial
173
LIBS="$LIBS -lws2_32 -lshlwapi -lsecur32 -liphlpapi"
174
175
176
else
AC_CHECK_FUNC(socket, [], AC_CHECK_LIB(socket, socket, [], AC_ERROR(Cannot find socket() function)))
fi
177
178
179
180
have_inet_aton=yes
AC_CHECK_FUNC(inet_aton, [], AC_CHECK_LIB(nsl, inet_aton, [], have_inet_aton=no))
if test "$have_inet_aton" = "yes"; then
181
AC_DEFINE(HAVE_INET_ATON, 1, [Have inet_aton()])
182
183
fi
184
185
186
187
188
189
190
191
192
193
AC_MSG_CHECKING([for IPV6_PATHMTU socket option])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>],[
int foo = IPV6_PATHMTU; (void)foo;])],
[AC_DEFINE(HAVE_IPV6_PATHMTU, 1, [Have IPV6_PATHMTU socket option])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
194
AC_CHECK_FUNC(__android_log_vprint, [], AC_CHECK_LIB(log, __android_log_vprint, [], []))
195
196
197
198
AC_ENABLE_SHARED
AC_DISABLE_STATIC
199
200
201
AC_CHECK_FUNC(nl_langinfo, [AC_DEFINE(HAVE_NL_LANGINFO, 1, [Have nl_langinfo() function])], [])
if test "$ac_cv_func_nl_langinfo" = "yes"; then
202
203
204
205
206
AM_ICONV
if test "$am_cv_func_iconv" = "yes"; then
AC_SUBST(ICONV_LIBS, [$LTLIBICONV])
AC_SUBST(ICONV_CFLAGS, [$INCICONV])
AC_DEFINE(HAVE_ICONV, 1, [Have iconv() function])
207
fi
208
fi
209
AM_CONDITIONAL(OPENCONNECT_ICONV, [test "$am_cv_func_iconv" = "yes"])
210
211
AC_ARG_ENABLE([nls],
212
AS_HELP_STRING([--disable-nls], [Do not use Native Language Support]),
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[USE_NLS=$enableval], [USE_NLS=yes])
LIBINTL=
if test "$USE_NLS" = "yes"; then
AC_PATH_PROG(MSGFMT, msgfmt)
if test "$MSGFMT" = ""; then
AC_ERROR([msgfmt could not be found. Try configuring with --disable-nls])
fi
fi
LIBINTL=
if test "$USE_NLS" = "yes"; then
AC_MSG_CHECKING([for functional NLS support])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <locale.h>
#include <libintl.h>],[
setlocale(LC_ALL, "");
bindtextdomain("openconnect", "/tmp");
(void)dgettext("openconnect", "foo");])],
[AC_MSG_RESULT(yes)],
231
232
233
234
235
[AC_LIB_LINKFLAGS_BODY([intl])
oldLIBS="$LIBS"
LIBS="$LIBS $LIBINTL"
oldCFLAGS="$LIBS"
CFLAGS="$CFLAGS $INCINTL"
236
237
238
239
240
241
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <locale.h>
#include <libintl.h>],[
setlocale(LC_ALL, "");
bindtextdomain("openconnect", "/tmp");
(void)dgettext("openconnect", "foo");])],
242
243
244
245
[AC_MSG_RESULT(yes (with $INCINTL $LIBINTL))],
[AC_MSG_RESULT(no)
USE_NLS=no])
LIBS="$oldLIBS"])
246
247
248
fi
if test "$USE_NLS" = "yes"; then
249
250
AC_SUBST(INTL_LIBS, [$LTLIBINTL])
AC_SUBST(INTL_CFLAGS, [$INCINTL])
251
AC_DEFINE(ENABLE_NLS, 1, [Enable NLS support])
252
253
254
fi
AM_CONDITIONAL(USE_NLS, [test "$USE_NLS" = "yes"])
255
256
257
258
AC_ARG_WITH([system-cafile],
AS_HELP_STRING([--with-system-cafile],
[Location of the default system CA certificate file for old (<3.0.20) GnuTLS versions]))
259
260
261
# We will use GnuTLS by default if it's present. We used to suppport
# using GnuTLS for the TLS connections and OpenSSL for DTLS, but none
# of the reasons for that make sense any more.
262
263
AC_ARG_WITH([gnutls],
264
AS_HELP_STRING([--without-gnutls], [Do not attempt to use GnuTLS; use OpenSSL instead]))
265
AC_ARG_WITH([openssl],
266
267
AS_HELP_STRING([--with-openssl], [Location of OpenSSL build dir]))
268
ssl_library=
269
esp=
270
dtls=
271
272
273
274
275
276
277
278
279
280
if test "$with_openssl" != "" -a "$with_openssl" != "no"; then
if test "$with_gnutls" = ""; then
with_gnutls=no
elif test "$with_gnutls" = "yes"; then
AC_MSG_ERROR([You cannot choose both GnuTLS and OpenSSL.])
fi
fi
# First, check if GnuTLS exists and is usable
281
if test "$with_gnutls" = "yes" || test "$with_gnutls" = ""; then
282
283
284
PKG_CHECK_MODULES(GNUTLS, gnutls,
[if ! $PKG_CONFIG --atleast-version=3.2.10 gnutls; then
AC_MSG_WARN([Your GnuTLS is too old. At least v3.2.10 is required])
285
else
286
287
288
289
ssl_library=GnuTLS
fi], [:])
elif test "$with_gnutls" != "no"; then
AC_ERROR([Values other than 'yes' or 'no' for --with-gnutls are not supported])
290
291
fi
292
293
294
295
296
# Do we need to look for OpenSSL?
if test "$ssl_library" = ""; then
if test "$with_gnutls" = "yes" -o "$with_openssl" = "no"; then
AC_MSG_ERROR([Suitable GnuTLS required but not found])
elif test "$with_openssl" = "yes" -o "$with_openssl" = ""; then
297
PKG_CHECK_MODULES(OPENSSL, openssl, [AC_SUBST(SSL_PC, [openssl])],
298
299
300
301
[oldLIBS="$LIBS"
LIBS="$LIBS -lssl -lcrypto"
AC_MSG_CHECKING([for OpenSSL without pkg-config])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
302
303
304
305
306
307
#include <openssl/ssl.h>
#include <openssl/err.h>],[
SSL_library_init();
ERR_clear_error();
SSL_load_error_strings();
OpenSSL_add_all_algorithms();])],
308
309
[AC_MSG_RESULT(yes)
AC_SUBST([OPENSSL_LIBS], ["-lssl -lcrypto"])
310
311
AC_SUBST([OPENSSL_CFLAGS], [])]
AC_SUBST([openssl_pc_libs], [$OPENSSL_LIBS]),
312
[AC_MSG_RESULT(no)
313
314
315
316
317
318
319
320
321
322
323
AC_ERROR([Could not build against OpenSSL])])
LIBS="$oldLIBS"])
ssl_library=OpenSSL
PKG_CHECK_MODULES(P11KIT, p11-kit-1,
[PKG_CHECK_MODULES(LIBP11, libp11,
[AC_DEFINE(HAVE_LIBP11, 1, [Have libp11 and p11-kit for OpenSSL])
AC_SUBST(P11KIT_PC, ["libp11 p11-kit-1"])
proxy_module="`$PKG_CONFIG --variable=proxy_module p11-kit-1`"
pkcs11_support="libp11"
AC_DEFINE_UNQUOTED([DEFAULT_PKCS11_MODULE], "${proxy_module}", [p11-kit proxy])],
[:])], [:])
324
else
325
326
327
328
329
330
331
332
333
334
335
336
337
338
OPENSSL_CFLAGS="-I${with_openssl}/include ${OPENSSL_CFLAGS}"
if test -r "${with_openssl}/libssl.a" -a -r "${with_openssl}/libcrypto.a"; then
OPENSSL_LIBS="${with_openssl}/libssl.a ${with_openssl}/libcrypto.a -ldl -lz"
elif test -r "${with_openssl}/crypto/.libs/libcrypto.a" -a \
-r "${with_openssl}/ssl/.libs/libssl.a"; then
OPENSSL_LIBS="${with_openssl}/ssl/.libs/libssl.a ${with_openssl}/crypto/.libs/libcrypto.a -ldl -lz"
else
AC_ERROR([Could not found OpenSSL libraries]);
fi
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(OPENSSL_LIBS)
enable_static=yes
enable_shared=no
ssl_library=OpenSSL
339
fi
340
fi
341
342
343
344
345
346
347
348
349
350
351
AC_ARG_WITH([openssl-version-check],
AS_HELP_STRING([--without-openssl-version-check], [Do not check for known-broken OpenSSL versions]))
AC_ARG_WITH([default-gnutls-priority],
AS_HELP_STRING([--with-default-gnutls-priority=STRING],
[Provide a default string as GnuTLS priority string]),
default_gnutls_priority=$withval)
if test -n "$default_gnutls_priority"; then
AC_DEFINE_UNQUOTED([DEFAULT_PRIO], ["$default_gnutls_priority"], [The GnuTLS priority string])
fi
352
case "$ssl_library" in
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
OpenSSL)
oldLIBS="${LIBS}"
oldCFLAGS="${CFLAGS}"
LIBS="${LIBS} ${OPENSSL_LIBS}"
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
# Check for the various known-broken versions of OpenSSL, which includes LibreSSL.
if test "$with_openssl_version_check" != "no"; then
AC_MSG_CHECKING([for known-broken versions of OpenSSL])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <openssl/opensslv.h>],
[#if defined(LIBRESSL_VERSION_NUMBER)
#error Bad OpenSSL
#endif
])],
[],
[AC_MSG_RESULT(yes)
AC_MSG_ERROR([LibreSSL does not support Cisco DTLS.]
[Build with OpenSSL or GnuTLS instead.])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <openssl/opensslv.h>],[#if \
(OPENSSL_VERSION_NUMBER == 0x10002000L || \
(OPENSSL_VERSION_NUMBER >= 0x100000b0L && OPENSSL_VERSION_NUMBER <= 0x100000c0L) || \
(OPENSSL_VERSION_NUMBER >= 0x10001040L && OPENSSL_VERSION_NUMBER <= 0x10001060L))
#error Bad OpenSSL
#endif
])],
[],
[AC_MSG_RESULT(yes)
AC_ERROR([This version of OpenSSL is known to be broken with Cisco DTLS.]
[See http://rt.openssl.org/Ticket/Display.html?id=2984&user=guest&pass=guest]
[Add --without-openssl-version-check to configure args to avoid this check, or]
[perhaps consider building with GnuTLS instead.])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <openssl/opensslv.h>],[#if \
(OPENSSL_VERSION_NUMBER == 0x1000200fL)
#error Bad OpenSSL
#endif
])],
[],
[AC_MSG_RESULT(yes)
AC_ERROR([This version of OpenSSL is known to be broken with Cisco DTLS.]
[See http://rt.openssl.org/Ticket/Display.html?id=3703&user=guest&pass=guest]
[and http://rt.openssl.org/Ticket/Display.html?id=3711&user=guest&pass=guest]
[Add --without-openssl-version-check to configure args to avoid this check, or]
[perhaps consider building with GnuTLS instead.])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <openssl/opensslv.h>],[#if \
((OPENSSL_VERSION_NUMBER >= 0x10001110L && OPENSSL_VERSION_NUMBER <= 0x10001150L) || \
(OPENSSL_VERSION_NUMBER >= 0x10002050L && OPENSSL_VERSION_NUMBER <= 0x10002090L))
#error Bad OpenSSL
#endif
])],
[],
[AC_MSG_RESULT(yes)
AC_ERROR([This version of OpenSSL is known to be broken with Cisco DTLS.]
[See http://rt.openssl.org/Ticket/Display.html?id=4631&user=guest&pass=guest]
[Add --without-openssl-version-check to configure args to avoid this check, or]
[perhaps consider building with GnuTLS instead.])])
AC_MSG_RESULT(no)
409
fi
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
AC_MSG_CHECKING([for ENGINE_by_id() in OpenSSL])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/engine.h>],
[ENGINE_by_id("foo");])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ENGINE, [1], [OpenSSL has ENGINE support])],
[AC_MSG_RESULT(no)
AC_MSG_NOTICE([Building without OpenSSL TPM ENGINE support])])
AC_MSG_CHECKING([for dtls1_stop_timer() in OpenSSL])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>
#include <stdlib.h>
extern void dtls1_stop_timer(SSL *);],
[dtls1_stop_timer(NULL);])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function])],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for DTLSv1_2_client_method() in OpenSSL])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>],
[DTLSv1_2_client_method();])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DTLS12, [1], [OpenSSL has DTLSv1_2_client_method() function])],
[AC_MSG_RESULT(no)])
AC_CHECK_FUNC(HMAC_CTX_copy,
436
437
[esp=yes],
[AC_MSG_WARN([ESP support will be disabled])])
438
439
440
441
LIBS="${oldLIBS}"
CFLAGS="${oldCFLAGS}"
442
dtls=yes
443
AC_DEFINE(OPENCONNECT_OPENSSL, 1, [Using OpenSSL])
444
445
446
AC_SUBST(SSL_LIBS, ['$(OPENSSL_LIBS)'])
AC_SUBST(SSL_CFLAGS, ['$(OPENSSL_CFLAGS)'])
;;
447
448
449
450
451
452
GnuTLS)
oldlibs="$LIBS"
oldcflags="$CFLAGS"
LIBS="$LIBS $GNUTLS_LIBS"
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
453
454
esp=yes
dtls=yes
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
AC_CHECK_FUNC(gnutls_certificate_set_key,
[AC_DEFINE(HAVE_GNUTLS_CERTIFICATE_SET_KEY, 1, [From GnuTLS 3.0.4])], [])
AC_CHECK_FUNC(gnutls_pk_to_sign,
[AC_DEFINE(HAVE_GNUTLS_PK_TO_SIGN, 1, [From GnuTLS 3.1.0])], [])
AC_CHECK_FUNC(gnutls_pubkey_export2,
[AC_DEFINE(HAVE_GNUTLS_PUBKEY_EXPORT2, 1, [From GnuTLS 3.1.3])], [])
AC_CHECK_FUNC(gnutls_x509_crt_set_pin_function,
[AC_DEFINE(HAVE_GNUTLS_X509_CRT_SET_PIN_FUNCTION, 1, [From GnuTLS 3.1.0])], [])
AC_CHECK_FUNC(gnutls_url_is_supported,
[AC_DEFINE(HAVE_GNUTLS_URL_IS_SUPPORTED, 1, [From GnuTLS 3.1.0])], [])
AC_CHECK_FUNC(gnutls_system_key_add_x509,
[AC_DEFINE(HAVE_GNUTLS_SYSTEM_KEYS, 1, [From GnuTLS 3.4.0])], [])
AC_CHECK_FUNC(gnutls_pkcs11_add_provider,
[PKG_CHECK_MODULES(P11KIT, p11-kit-1,
[AC_DEFINE(HAVE_P11KIT, 1, [Have. P11. Kit.])
pkcs11_support=GnuTLS
AC_SUBST(P11KIT_PC, p11-kit-1)],
[:])], [])
LIBS="$oldlibs -ltspi"
AC_MSG_CHECKING([for tss library])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <trousers/tss.h>
#include <trousers/trousers.h>],[
int err = Tspi_Context_Create((void *)0);
Trspi_Error_String(err);])],
[AC_MSG_RESULT(yes)
AC_SUBST([TSS_LIBS], [-ltspi])
AC_SUBST([TSS_CFLAGS], [])
AC_DEFINE(HAVE_TROUSERS, 1, [Have Trousers TSS library])],
[AC_MSG_RESULT(no)])
LIBS="$oldlibs"
CFLAGS="$oldcflags"
488
AC_DEFINE(OPENCONNECT_GNUTLS, 1, [Using GnuTLS])
489
AC_SUBST(SSL_PC, [gnutls])
490
491
AC_SUBST(SSL_LIBS, ['$(GNUTLS_LIBS)'])
AC_SUBST(SSL_CFLAGS, ['$(GNUTLS_CFLAGS)'])
492
;;
493
494
*)
495
496
# This should never happen
AC_MSG_ERROR([No SSL library selected])
497
498
;;
esac
499
500
test_pkcs11=
501
502
503
if test "$pkcs11_support" != ""; then
AC_CHECK_PROG(test_pkcs11, softhsm2-util, yes)
fi
504
AM_CONDITIONAL(TEST_PKCS11, [ test "$test_pkcs11" = "yes" ])
505
506
# The test is OpenSSL-only for now.
507
AM_CONDITIONAL(CHECK_DTLS, [ test "$ssl_library" = "OpenSSL" ])
508
509
510
511
AC_ARG_ENABLE([dtls-xfail],
AS_HELP_STRING([--enable-dtls-xfail], [Only for gitlab CI. Do not use]))
AM_CONDITIONAL(DTLS_XFAIL, [test "$enable_dtls_xfail" = "yes" ])
512
513
514
515
516
517
AC_ARG_ENABLE([dsa-tests],
AS_HELP_STRING([--disable-dsa-tests], [Disable DSA keys in self-test]),
[], [enable_dsa_tests=yes])
AM_CONDITIONAL(TEST_DSA, [test "$enable_dsa_tests" = "yes"])
518
519
AM_CONDITIONAL(OPENCONNECT_GNUTLS, [ test "$ssl_library" = "GnuTLS" ])
AM_CONDITIONAL(OPENCONNECT_OPENSSL, [ test "$ssl_library" = "OpenSSL" ])
520
AM_CONDITIONAL(OPENCONNECT_ESP, [ test "$esp" != "" ])
521
AM_CONDITIONAL(OPENCONNECT_DTLS, [ test "$dtls" != "" ])
522
523
524
if test "$esp" != ""; then
AC_DEFINE(HAVE_ESP, 1, [Build with ESP support])
525
fi
526
527
528
if test "$dtls" != ""; then
AC_DEFINE(HAVE_DTLS, 1, [Build with DTLS support])
fi
529
530
531
532
533
534
AC_ARG_WITH(lz4,
AS_HELP_STRING([--without-lz4], [disable support for LZ4 compression]),
test_for_lz4=$withval,
test_for_lz4=yes)
535
lz4_pkg=no
536
if test "$test_for_lz4" = yes; then
537
PKG_CHECK_MODULES([LIBLZ4], [liblz4], [
538
539
AC_SUBST(LIBLZ4_PC, liblz4)
AC_DEFINE([HAVE_LZ4], [], [LZ4 was found])
540
lz4_pkg=yes
541
542
543
544
545
546
547
548
549
550
551
552
553
554
oldLIBS="$LIBS"
LIBS="$LIBS $LIBLZ4_LIBS"
oldCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LIBLZ4_CFLAGS"
AC_MSG_CHECKING([for LZ4_compress_default()])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <lz4.h>],[
LZ4_compress_default("", (char *)0, 0, 0);])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_LZ4_COMPRESS_DEFAULT], [], [From LZ4 r129])
],
[AC_MSG_RESULT(no)])
LIBS="$oldLIBS"
CFLAGS="$oldCFLAGS"
555
556
557
558
559
560
561
562
563
],
[
AC_MSG_WARN([[
***
*** lz4 not found.
*** ]])
])
fi
564
565
566
567
568
# For some bizarre reason now that we use AM_ICONV, the mingw32 build doesn't
# manage to set EGREP properly in the created ./libtool script. Make sure it's
# found.
AC_PROG_EGREP
569
570
# Needs to happen after we default to static/shared libraries based on OpenSSL
AC_PROG_LIBTOOL
571
572
573
574
if test "$use_openbsd_libtool" = "true" && test -x /usr/bin/libtool; then
echo using OpenBSD libtool
LIBTOOL=/usr/bin/libtool
fi
575
576
AM_CONDITIONAL(OPENBSD_LIBTOOL, [ test "$use_openbsd_libtool" = "true" ])
577
AX_CHECK_VSCRIPT
578
579
PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
580
581
PKG_CHECK_MODULES(ZLIB, zlib, [AC_SUBST(ZLIB_PC, [zlib])],
582
583
584
585
586
587
588
589
590
591
592
593
[oldLIBS="$LIBS"
LIBS="$LIBS -lz"
AC_MSG_CHECKING([for zlib without pkg-config])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <zlib.h>],[
z_stream zs;
deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
-12, 9, Z_DEFAULT_STRATEGY);])],
[AC_MSG_RESULT(yes)
AC_SUBST([ZLIB_LIBS], [-lz])
AC_SUBST([ZLIB_CFLAGS], [])],
[AC_MSG_RESULT(no)
594
595
AC_ERROR([Could not build against zlib])])
LIBS="$oldLIBS"])
596
597
598
599
600
601
602
AC_ARG_WITH([libproxy],
AS_HELP_STRING([--without-libproxy],
[Build without libproxy library [default=auto]]))
AS_IF([test "x$with_libproxy" != "xno"], [
PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0,
[AC_SUBST(LIBPROXY_PC, libproxy-1.0)
603
AC_DEFINE([LIBPROXY_HDR], ["proxy.h"], [libproxy header file])
604
605
606
607
libproxy_pkg=yes],
libproxy_pkg=no)
], [libproxy_pkg=disabled])
608
609
610
dnl Libproxy *can* exist without a .pc file, and its header may be called
dnl libproxy.h in that case.
if (test "$libproxy_pkg" = "no"); then
611
612
613
614
615
616
617
AC_MSG_CHECKING([for libproxy])
oldLIBS="$LIBS"
LIBS="$LIBS -lproxy"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libproxy.h>],
[(void)px_proxy_factory_new();])],
[AC_MSG_RESULT(yes (with libproxy.h))
AC_DEFINE([LIBPROXY_HDR], ["libproxy.h"])
618
619
AC_SUBST([LIBPROXY_LIBS], [-lproxy])
libproxy_pkg=yes],
620
621
622
623
[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <proxy.h>],
[(void)px_proxy_factory_new();])],
[AC_MSG_RESULT(yes (with proxy.h))
AC_DEFINE([LIBPROXY_HDR], ["proxy.h"])
624
625
AC_SUBST([LIBPROXY_LIBS], [-lproxy])
libproxy_pkg=yes],
626
627
[AC_MSG_RESULT(no)])])
LIBS="$oldLIBS"
628
629
fi
630
631
632
633
634
635
AC_ARG_WITH([stoken],
AS_HELP_STRING([--without-stoken],
[Build without libstoken library [default=auto]]))
AS_IF([test "x$with_stoken" != "xno"], [
PKG_CHECK_MODULES(LIBSTOKEN, stoken,
[AC_SUBST(LIBSTOKEN_PC, stoken)
636
AC_DEFINE([HAVE_LIBSTOKEN], 1, [Have libstoken])
637
638
639
libstoken_pkg=yes],
libstoken_pkg=no)
], [libstoken_pkg=disabled])
640
AM_CONDITIONAL(OPENCONNECT_STOKEN, [test "$libstoken_pkg" = "yes"])
641
642
643
644
645
AC_ARG_WITH([libpcsclite],
AS_HELP_STRING([--without-libpcsclite],
[Build without libpcsclite library (for Yubikey support) [default=auto]]))
AS_IF([test "x$with_libpcsclite" != "xno"], [
646
647
648
649
650
651
652
if test "$system_pcsc_libs" != ""; then
AC_SUBST(LIBPCSCLITE_LIBS, "$system_pcsc_libs")
AC_SUBST(LIBPCSCLITE_CFLAGS, "$system_pcsc_cflags")
AC_SUBST(system_pcsc_libs)
libpcsclite_pkg=yes
else
PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite,
653
654
[AC_SUBST(LIBPCSCLITE_PC, libpcsclite)
libpcsclite_pkg=yes],
655
656
libpcsclite_pkg=no)
fi
657
], [libpcsclite_pkg=disabled])
658
659
660
if test "$libpcsclite_pkg" = "yes"; then
AC_DEFINE([HAVE_LIBPCSCLITE], 1, [Have libpcsclite])
fi
661
662
AM_CONDITIONAL(OPENCONNECT_LIBPCSCLITE, [test "$libpcsclite_pkg" = "yes"])
663
664
665
666
667
AC_ARG_WITH([libpskc],
AS_HELP_STRING([--without-libpskc],
[Build without libpskc library [default=auto]]))
AS_IF([test "x$with_libpskc" != "xno"], [
PKG_CHECK_MODULES(LIBPSKC, [libpskc >= 2.2.0],
668
669
670
[AC_SUBST(LIBPSKC_PC, libpskc)
AC_DEFINE([HAVE_LIBPSKC], 1, [Have libpskc])
libpskc_pkg=yes],
671
libpskc_pkg=no)])
672
673
linked_gssapi=no
674
675
676
AC_ARG_WITH([gssapi],
AS_HELP_STRING([--without-gssapi],
[Build without GSSAPI support [default=auto]]))
677
678
679
680
681
682
AC_DEFUN([GSSAPI_CHECK_BUILD],[
gss_old_libs="$LIBS"
LIBS="$LIBS ${GSSAPI_LIBS}"
AC_MSG_CHECKING([GSSAPI compilation with "${GSSAPI_LIBS}"])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
683
#include <stdlib.h>
684
685
686
687
688
689
690
691
692
693
694
695
696
697
#include GSSAPI_HDR],[
OM_uint32 major, minor;
gss_buffer_desc b = GSS_C_EMPTY_BUFFER;
gss_ctx_id_t ctx = GSS_C_NO_CONTEXT;
gss_init_sec_context(&minor, GSS_C_NO_CREDENTIAL, &ctx, GSS_C_NO_NAME, GSS_C_NO_OID,
GSS_C_MUTUAL_FLAG, GSS_C_INDEFINITE, GSS_C_NO_CHANNEL_BINDINGS, NULL, NULL,
NULL, NULL, NULL);])],
[linked_gssapi=yes
AC_MSG_RESULT(yes)],
[linked_gssapi=no
AC_MSG_RESULT(no)])
LIBS="$gss_old_libs"
])
698
699
700
701
702
# Attempt to work out how to build with GSSAPI. Mostly, krb5-config will
# exist and work. Tested on FreeBSD 9, OpenBSD 5.5, NetBSD 6.1.4. Solaris
# has krb5-config but it doesn't do GSSAPI so hard-code the results there.
# Older OpenBSD (I tested 5.2) lacks krb5-config so leave that as an example.
if test "$with_gssapi" != "no"; then
703
704
705
706
found_gssapi=no
if test "${with_gssapi}" != "yes" -a "${with_gssapi}" != "" ; then
gssapi_root="${with_gssapi}"
707
else
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
gssapi_root=""
fi
# First: if they specify GSSAPI_LIBS and/or GSSAPI_CFLAGS then use them.
if test "$GSSAPI_LIBS$GSSAPI_CFLAGS" != ""; then
found_gssapi=yes
fi
# Second: try finding a viable krb5-config that supports gssapi
if test "$found_gssapi" = "no"; then
if test -n "${gssapi_root}"; then
krb5path="${gssapi_root}/bin:$PATH"
else
krb5path="/usr/kerberos/bin:$PATH"
fi
if test -n "$host_alias"; then
AC_PATH_PROG(KRB5_CONFIG, [${host_alias}-krb5-config], [], [$krb5path])
fi
if test "$KRB5_CONFIG" = ""; then
AC_PATH_PROG(KRB5_CONFIG, [krb5-config], [], [$krb5path])
fi
729
if test "$KRB5_CONFIG" != ""; then
730
731
732
733
734
735
AC_MSG_CHECKING([whether $KRB5_CONFIG supports gssapi])
if "${KRB5_CONFIG}" --cflags gssapi > /dev/null 2>/dev/null; then
AC_MSG_RESULT(yes)
found_gssapi=yes
GSSAPI_LIBS="`"${KRB5_CONFIG}" --libs gssapi`"
GSSAPI_CFLAGS="`"${KRB5_CONFIG}" --cflags gssapi`"
736
else
737
738
739
740
741
742
743
744
745
746
747
AC_MSG_RESULT(no)
fi
fi
fi
# Third: look for <gssapi.h> or <gssapi/gssapi.h> in some likely places,
# and we'll worry about how to *link* it in a moment...
if test "$found_gssapi" = "no"; then
if test -n "${gssapi_root}"; then
if test -r "${with_gssapi}/include/gssapi.h" -o \
-r "${with_gssapi}/include/gssapi/gssapi.h"; then
GSSAPI_CFLAGS="-I\"${with_gssapi}/include\""
748
fi
749
else
750
751
752
753
754
755
756
757
758
759
760
if test -r /usr/kerberos/include/gssapi.h -o \
-r /usr/kerberos/include/gssapi/gssapi.h; then
GSSAPI_CFLAGS=-I/usr/kerberos/include
elif test -r /usr/include/kerberosV/gssapi.h -o \
-r /usr/include/kerberosV/gssapi/gssapi.h; then
# OpenBSD 5.2 puts it here
GSSAPI_CFLAGS=-I/usr/include/kerberosV
else
# Maybe it'll Just Work
GSSAPI_CFLAGS=
fi
761
762
763
fi
fi
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
oldcflags="$CFLAGS"
CFLAGS="$CFLAGS ${GSSAPI_CFLAGS}"
# OK, now see if we've correctly managed to find gssapi.h at least...
gssapi_hdr=
AC_CHECK_HEADER([gssapi/gssapi.h],
[gssapi_hdr="<gssapi/gssapi.h>"],
[AC_CHECK_HEADER([gssapi.h],
[gssapi_hdr="<gssapi.h>"],
[AC_MSG_WARN([Cannot find <gssapi/gssapi.h> or <gssapi.h>])])])
# Finally, unless we've already failed, see if we can link it.
linked_gssapi=no
if test -n "${gssapi_hdr}"; then
AC_DEFINE_UNQUOTED(GSSAPI_HDR, $gssapi_hdr, [GSSAPI header])
if test "$found_gssapi" = "yes"; then
# We think we have GSSAPI_LIBS already so try it...
GSSAPI_CHECK_BUILD
else
LFLAG=
if test -n "$gssapi_root"; then
LFLAG="-L\"${gssapi_root}/lib$libsuff\""
fi
# Solaris, HPUX, etc.
GSSAPI_LIBS="$LFLAG -lgss"
GSSAPI_CHECK_BUILD
if test "$linked_gssapi" = "no"; then
GSSAPI_LIBS="$LFLAG -lgssapi"
GSSAPI_CHECK_BUILD
fi
if test "$linked_gssapi" = "no"; then
GSSAPI_LIBS="$LFLAG -lgssapi_krb5"
GSSAPI_CHECK_BUILD
fi
if test "$linked_gssapi" = "no"; then
# OpenBSD 5.2 at least
GSSAPI_LIBS="$LFLAG -lgssapi -lkrb5 -lcrypto"
GSSAPI_CHECK_BUILD
fi
if test "$linked_gssapi" = "no"; then
# MIT
GSSAPI_LIBS="$LFLAG -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
GSSAPI_CHECK_BUILD
fi
if test "$linked_gssapi" = "no"; then
# Heimdal
GSSAPI_LIBS="$LFLAG -lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi"
GSSAPI_CHECK_BUILD
fi
if test "$linked_gssapi" = "no"; then
AC_MSG_WARN([Cannot find GSSAPI. Try setting GSSAPI_LIBS and GSSAPI_CFLAGS manually])
fi
816
817
818
fi
fi
819
820
821
CFLAGS="$oldcflags"
if test "$linked_gssapi" = "yes"; then
822
AC_DEFINE([HAVE_GSSAPI], 1, [Have GSSAPI support])
823
824
825
826
827
828
829
830
831
832
AC_SUBST(GSSAPI_CFLAGS)
AC_SUBST(GSSAPI_LIBS)
elif test "$with_gssapi" = ""; then
AC_MSG_WARN([Building without GSSAPI support]);
unset GSSAPI_CFLAGS
unset GSSAPI_LIBS
else
AC_MSG_ERROR([GSSAPI support requested but not found. Try setting GSSAPI_LIBS/GSSAPI_CFLAGS])
fi
fi
833
AM_CONDITIONAL(OPENCONNECT_GSSAPI, [test "$linked_gssapi" = "yes"])
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
AC_ARG_WITH([java],
AS_HELP_STRING([--with-java(=DIR)],
[Build JNI bindings using jni.h from DIR [default=no]]),
[], [with_java=no])
if test "$with_java" = "yes"; then
AX_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do
JNI_CFLAGS="$JNI_CFLAGS -I$JNI_INCLUDE_DIR"
done
elif test "$with_java" = "no"; then
JNI_CFLAGS=""
else
JNI_CFLAGS="-I$with_java"
fi
if test "x$JNI_CFLAGS" != "x"; then
oldCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $JNI_CFLAGS"
AC_MSG_CHECKING([jni.h usability])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <jni.h>],
[jint foo = 0; (void)foo;])],
AC_MSG_RESULT([yes]),
[AC_MSG_RESULT([no])
AC_MSG_ERROR([unable to compile JNI test program])])
CFLAGS="$oldCFLAGS"
AC_SUBST(JNI_CFLAGS, [$JNI_CFLAGS])
fi
AM_CONDITIONAL(OPENCONNECT_JNI, [test "$JNI_CFLAGS" != ""])
AC_ARG_ENABLE([jni-standalone],
AS_HELP_STRING([--enable-jni-standalone],
[build JNI stubs directly into libopenconnect.so [default=no]]),
[jni_standalone=$enableval],
[jni_standalone=no])
AM_CONDITIONAL(JNI_STANDALONE, [test $jni_standalone = yes])
873
874
875
876
877
878
879
symver_java=
if test "$jni_standalone" = "yes" ; then
symver_java=$(sed -n '/JNIEXPORT/{s/^JNIEXPORT.*\(Java_.*\) *(/\1;/ p}' ${srcdir}/jni.c)
# Remove the newlines between each item.
symver_java=$(echo $symver_java)
fi
AC_SUBST(SYMVER_JAVA, $symver_java)
880
881
AC_CHECK_HEADER([if_tun.h],
882
[AC_DEFINE([IF_TUN_HDR], ["if_tun.h"], [if_tun.h include path])],
883
884
885
886
887
888
889
[AC_CHECK_HEADER([linux/if_tun.h],
[AC_DEFINE([IF_TUN_HDR], ["linux/if_tun.h"])],
[AC_CHECK_HEADER([net/if_tun.h],
[AC_DEFINE([IF_TUN_HDR], ["net/if_tun.h"])],
[AC_CHECK_HEADER([net/tun/if_tun.h],
[AC_DEFINE([IF_TUN_HDR], ["net/tun/if_tun.h"])])])])])
890
AC_CHECK_HEADER([net/if_utun.h], AC_DEFINE([HAVE_NET_UTUN_H], 1, [Have net/utun.h]))
891
AC_CHECK_HEADER([alloca.h], AC_DEFINE([HAVE_ALLOCA_H], 1, [Have alloca.h]))
892
893
894
895
896
897
898
899
AC_CHECK_HEADER([endian.h],
[AC_DEFINE([ENDIAN_HDR], [<endian.h>], [endian header include path])],
[AC_CHECK_HEADER([sys/endian.h],
[AC_DEFINE([ENDIAN_HDR], [<sys/endian.h>])],
[AC_CHECK_HEADER([sys/isa_defs.h],
[AC_DEFINE([ENDIAN_HDR], [<sys/isa_defs.h>])])])])
900
build_www=yes
901
AC_PATH_PROGS(PYTHON, [python2 python], [], $PATH:/bin:/usr/bin)
902
if (test -n "${ac_cv_path_PYTHON}"); then
903
AC_MSG_CHECKING([that python is version 2.x])
904
if $PYTHON --version 2>&1 | grep "Python 2\." > /dev/null; then
905
906
907
908
909
910
911
AC_MSG_RESULT([yes])
AC_SUBST(PYTHON, ${ac_cv_path_PYTHON})
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Python is not v2.x; not building HTML pages])
build_www=no
fi
912
913
else
AC_MSG_NOTICE([Python not found; not building HTML pages])
914
build_www=no
915
fi
916
917
if test "${build_www}" = "yes"; then
AC_MSG_CHECKING([if groff can create UTF-8 XHTML])
918
919
920
921
AC_PATH_PROGS_FEATURE_CHECK([GROFF], [groff],
[$ac_path_GROFF -t -K UTF-8 -mandoc -Txhtml /dev/null > /dev/null 2>&1 &&
ac_cv_path_GROFF=$ac_path_GROFF])
if test -n "$ac_cv_path_GROFF"; then
922
AC_MSG_RESULT(yes)
923
AC_SUBST(GROFF, ${ac_cv_path_GROFF})
924
925
926
927
928
929
else
AC_MSG_RESULT([no. Not building HTML pages])
build_www=no
fi
fi
AM_CONDITIONAL(BUILD_WWW, [test "${build_www}" = "yes"])
930
931
932
933
934
# Checks for tests
PKG_CHECK_MODULES([CWRAP], [uid_wrapper, socket_wrapper], have_cwrap=yes, have_cwrap=no)
AM_CONDITIONAL(HAVE_CWRAP, test "x$have_cwrap" != xno)
935
936
937
938
939
940
941
942
943
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
['$(top_srcdir)/po/LINGUAS \
$(top_srcdir)/openconnect.h \
$(top_srcdir)/libopenconnect.map.in \
$(top_srcdir)/openconnect.8.in \
$(top_srcdir)/tests/softhsm2.conf.in \
$(top_srcdir)/tests/configs/test-user-cert.config.in \
$(top_srcdir)/tests/configs/test-user-pass.config.in'])
944
945
946
947
948
RAWLINGUAS=`sed -e "/^#/d" -e "s/#.*//" "${srcdir}/po/LINGUAS"`
# Remove newlines
LINGUAS=`echo $RAWLINGUAS`
AC_SUBST(LINGUAS)
949
950
APIMAJOR="`sed -n 's/^#define OPENCONNECT_API_VERSION_MAJOR \(.*\)/\1/p' ${srcdir}/openconnect.h`"
APIMINOR="`sed -n 's/^#define OPENCONNECT_API_VERSION_MINOR \(.*\)/\1/p' ${srcdir}/openconnect.h`"
951
952
953
AC_SUBST(APIMAJOR)
AC_SUBST(APIMINOR)
954
955
956
957
958
# We want version.c to depend on the files that would affect the
# output of version.sh. But we cannot assume that they'll exist,
# and we cannot use $(wildcard) in a non-GNU makefile. So we just
# depend on the files which happen to exist at configure time.
GITVERSIONDEPS=
959
960
for a in ${srcdir}/.git/index ${srcdir}/.git/packed-refs \
${srcdir}/.git/refs/tags ${srcdir}/.git/HEAD; do
961
962
963
964
965
966
if test -r $a ; then
GITVERSIONDEPS="$GITVERSIONDEPS $a"
fi
done
AC_SUBST(GITVERSIONDEPS)
967
968
969
AC_SUBST(OCSERV_USER, $(whoami))
AC_SUBST(OCSERV_GROUP, $(groups|cut -f 1 -d ' '))
970
971
AC_CONFIG_FILES(Makefile openconnect.pc po/Makefile www/Makefile \
libopenconnect.map openconnect.8 www/styles/Makefile \
972
www/inc/Makefile www/images/Makefile tests/Makefile \
973
974
tests/softhsm2.conf tests/configs/test-user-cert.config \
tests/configs/test-user-pass.config)
975
AC_OUTPUT
976
977
978
AC_DEFUN([SUMMARY],
[pretty="$2"
979
if test "$pretty" = "openssl"; then
980
pretty=OpenSSL
981
elif test "$pretty" = "gnutls" -o "$pretty" = "both"; then
982
983
984
985
986
987
988
989
pretty=GnuTLS
elif test "$pretty" = ""; then
pretty=no
fi
echo "AS_HELP_STRING([$1:],[$pretty])"])
echo "BUILD OPTIONS:"
SUMMARY([SSL library], [$ssl_library])
990
SUMMARY([[PKCS#11 support]], [$pkcs11_support])
991
SUMMARY([DTLS support], [$dtls])
992
993
994
995
996
SUMMARY([ESP support], [$esp])
SUMMARY([libproxy support], [$libproxy_pkg])
SUMMARY([RSA SecurID support], [$libstoken_pkg])
SUMMARY([PSKC OATH file support], [$libpskc_pkg])
SUMMARY([GSSAPI support], [$linked_gssapi])
997
SUMMARY([Yubikey support], [$libpcsclite_pkg])
998
999
1000
SUMMARY([LZ4 compression], [$lz4_pkg])
SUMMARY([Java bindings], [$with_java])
SUMMARY([Build docs], [$build_www])