forked from OpenSC/pkcs11-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
635 lines (576 loc) · 17.3 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
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
409
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
#
# Copyright (c) 2005-2018 Alon Bar-Lev <[email protected]>
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
# General Public License (GPL) Version 2, or the BSD license.
#
# GNU General Public License (GPL) Version 2
# ===========================================
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (see the file COPYING.GPL included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# BSD License
# ============
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# o Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# o Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# o Neither the name of the Alon Bar-Lev nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
AC_PREREQ([2.60])
define([PACKAGE_VERSION_MAJOR], [1])
define([PACKAGE_VERSION_MINOR], [31])
define([PACKAGE_VERSION_FIX], [0])
define([PACKAGE_SUFFIX], [_master])
AC_INIT([pkcs11-helper],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([lib/common.h])
AM_INIT_AUTOMAKE
PKCS11H_VERSION_MAJOR="PACKAGE_VERSION_MAJOR"
PKCS11H_VERSION_MINOR="$(echo PACKAGE_VERSION_MINOR | sed 's/^0*//')"
PKCS11H_VERSION_FIX="PACKAGE_VERSION_FIX"
AC_SUBST([PKCS11H_VERSION_MAJOR])
AC_SUBST([PKCS11H_VERSION_MINOR])
AC_SUBST([PKCS11H_VERSION_FIX])
LIBPKCS11_HELPER_LT_CURRENT="1"
LIBPKCS11_HELPER_LT_OLDEST="1"
LIBPKCS11_HELPER_LT_REVISION="0"
LIBPKCS11_HELPER_LT_AGE="$((${LIBPKCS11_HELPER_LT_CURRENT}-${LIBPKCS11_HELPER_LT_OLDEST}))"
AC_CANONICAL_HOST
AC_ARG_WITH(
[cygwin-native],
[AS_HELP_STRING([--with-cygwin-native],[compile native win32])],
,
[with_cygwin_native="no"]
)
test -z "${WIN32}" && WIN32="no"
test -z "${CYGWIN}" && CYGWIN="no"
case "${host}" in
*-mingw*|*-winnt*)
WIN32="yes"
WIN_LIBPREFIX="lib"
;;
*-cygwin*)
AC_MSG_CHECKING([cygwin mode to use])
CYGWIN="yes"
if test "${with_cygwin_native}" = "yes"; then
AC_MSG_RESULT([Using native win32])
CFLAGS="${CFLAGS} -mno-cygwin"
WIN32="yes"
else
AC_MSG_RESULT([Using cygwin])
WIN_LIBPREFIX="cyg"
AC_DEFINE([PKCS11H_USE_CYGWIN], [1], [Define if you are on Cygwin])
fi
;;
*)
;;
esac
AC_ARG_ENABLE(
[doc],
[AS_HELP_STRING([--enable-doc],[enable documentation])],
,
[enable_doc="no"]
)
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING([--disable-debug],[disable debug support])],
,
[enable_debug="yes"]
)
AC_ARG_ENABLE(
[threading],
[AS_HELP_STRING([--disable-threading],[disable threading])],
,
[enable_threading="yes"]
)
AC_ARG_ENABLE(
[token],
[AS_HELP_STRING([--disable-token],[disable token support])],
,
[enable_token="yes"]
)
AC_ARG_ENABLE(
[data],
[AS_HELP_STRING([--disable-data],[disable data objects support])],
,
[enable_data="yes"]
)
AC_ARG_ENABLE(
[certificate],
[AS_HELP_STRING([--disable-certificate],[disable certificate support])],
,
[enable_certificate="yes"]
)
AC_ARG_ENABLE(
[slotevent],
[AS_HELP_STRING([--disable-slotevent],[disable slotevent support])],
,
[enable_slotevent="yes"]
)
AC_ARG_ENABLE(
[openssl],
[AS_HELP_STRING([--disable-openssl],[disable openssl interface])],
,
[enable_openssl="yes"]
)
AC_ARG_ENABLE(
[strict],
[AS_HELP_STRING([--enable-strict],[enable strict compiler warnings])],
,
[enable_strict="no"]
)
AC_ARG_ENABLE(
[pedantic],
[AS_HELP_STRING([--enable-pedantic],[enable pedantic compiler warnings])],
,
[enable_pedantic="no"]
)
AC_ARG_ENABLE(
[crypto-engine-openssl],
[AS_HELP_STRING([--disable-crypto-engine-openssl],[disable OpenSSL crypto engine)])],
,
[enable_crypto_engine_openssl="yes"]
)
AC_ARG_ENABLE(
[crypto-engine-gnutls],
[AS_HELP_STRING([--disable-crypto-engine-gnutls],[disable GnuTLS crypto engine])],
,
[enable_crypto_engine_gnutls="yes"]
)
AC_ARG_ENABLE(
[crypto-engine-nss],
[AS_HELP_STRING([--disable-crypto-engine-nss],[disable NSS crypto engine])],
,
[enable_crypto_engine_nss="yes"]
)
AC_ARG_ENABLE(
[crypto-engine-polarssl],
[AS_HELP_STRING([--disable-crypto-engine-polarssl],[disable mbed TLS crypto engine])],
,
[enable_crypto_engine_polarssl="yes"]
)
AC_ARG_ENABLE(
[crypto-engine-mbedtls],
[AS_HELP_STRING([--disable-crypto-engine-mbedtls],[disable mbed TLS crypto engine])],
,
[enable_crypto_engine_mbedtls="${enable_crypto_engine_polarssl}"]
)
AC_ARG_ENABLE(
[crypto-engine-cryptoapi],
[AS_HELP_STRING([--disable-crypto-engine-cryptoapi],[disable cryptoapi native crypto engine on windows systems])],
,
[enable_crypto_engine_cryptoapi="yes"]
)
AC_ARG_ENABLE(
[tests],
[AS_HELP_STRING([--enable-tests],[enable tests])],
,
[enable_tests="no"]
)
AC_ARG_WITH(
[apidocdir],
[AS_HELP_STRING([--with-apidocdir],[put API documents at this directory, default HTMLDIR/api])],
[apidocdir="${with_apidocdir}"],
[apidocdir="\$(htmldir)/api"]
)
AC_ARG_WITH(
[test-provider],
[AS_HELP_STRING([--with-test-provider=lib],[specify providers for test phase])],
[AC_DEFINE_UNQUOTED([TEST_PROVIDER], ["${withval}"], [Test provider])],
[AC_DEFINE_UNQUOTED([TEST_PROVIDER], ["/usr/lib/pkcs11/provider.so"], [Test provider])]
)
AC_ARG_WITH(
[test-log-level],
[AS_HELP_STRING([--with-test-log-level=level],[specify log level for test phase])],
[AC_DEFINE_UNQUOTED([TEST_LOG_LEVEL], [${withval}], [Test log level])],
[AC_DEFINE_UNQUOTED([TEST_LOG_LEVEL], [3], [Test log level])]
)
AC_PROG_EGREP
AC_PROG_CC
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
AC_ARG_VAR([M4], [m4 utility])
AC_CHECK_PROGS([M4], [m4])
ifdef(
[LT_INIT],
[
LT_INIT([win32-dll])
LT_LANG([Windows Resource])
],
[
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_RC
AC_PROG_LIBTOOL
]
)
if test "${enable_doc}" = "yes"; then
AC_ARG_VAR([DOXYGEN], [doxygen utility])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
test -z "${DOXYGEN}" && AC_MSG_ERROR([doxygen is required for docs])
fi
if test "${WIN32}" = "yes"; then
AC_ARG_VAR([MAN2HTML], [man2html utility])
AC_CHECK_PROGS([MAN2HTML], [man2html])
test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
fi
AC_FUNC_MKTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([ \
gettimeofday memmove memset socket strchr strdup strerror strrchr \
snprintf \
])
# Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])
if test "${enable_threading}" = "yes" -a "${WIN32}" != "yes"; then
AC_CHECK_LIB([pthread], [pthread_create])
fi
PKG_CHECK_MODULES([OPENSSL], [libcrypto >= 0.9.7], [have_openssl="yes"], [have_openssl="no"])
if test "${have_openssl}" = "no"; then
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.7], [have_openssl="yes"], [have_openssl="no"])
fi
if test "${have_openssl}" = "yes"; then
old_CFLAGS="${CFLAGS}"
old_LIBS="${LIBS}"
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
LIBS="${LIBS} ${OPENSSL_LIBS}"
AC_CHECK_FUNCS([ \
RSA_meth_dup RSA_meth_free \
RSA_meth_set_priv_enc RSA_meth_set_priv_dec \
RSA_meth_set1_name RSA_meth_set_flags \
DSA_meth_dup DSA_meth_free \
DSA_meth_set_sign DSA_meth_set1_name DSA_SIG_set0 ECDSA_SIG_set0 \
EC_KEY_METHOD_get_sign EC_KEY_METHOD_set_sign \
X509_get0_notBefore X509_get0_notAfter \
])
AC_CHECK_FUNC(
[EC_KEY_METHOD_new],
[
openssl_ec="yes"
AC_DEFINE([ENABLE_PKCS11H_OPENSSL_EC], [1], [Enable openssl EC])
],
[AC_CHECK_FUNC(
[ECDSA_METHOD_new],
[
openssl_ec="yes"
AC_DEFINE([ENABLE_PKCS11H_OPENSSL_EC], [1], [Enable openssl EC])
],
[
openssl_ec="hack"
old_CFLAGS="${CFLAGS}"
old_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I."
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
AC_CHECK_HEADER(
[ecs_locl.h],
[
AC_DEFINE([ENABLE_PKCS11H_OPENSSL_EC], [1], [Enable openssl EC])
AC_DEFINE([ENABLE_PKCS11H_OPENSSL_EC_HACK], [1], [Enable openssl EC])
],
[openssl_ec="none"]
)
CPPFLAGS="${old_CPPFLAGS}"
CFLAGS="${old_CFLAGS}"
],
)]
)
AC_MSG_CHECKING([for OpenSSL ec support])
AC_MSG_RESULT([${openssl_ec}])
# https://github.com/OpenSC/pkcs11-helper/pull/55
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <openssl/dsa.h>]],
[[
int foo() {
DSA_METHOD *meth = NULL;
sizeof(meth->name);
}
]]
)],
[AC_DEFINE([HAVE_DSA_METHOD_NAME], [1], [Have DSA_METHOD->name])]
)
CFLAGS="${old_CFLAGS}"
LIBS="${old_LIBS}"
fi
PKG_CHECK_MODULES([GNUTLS], [gnutls >= 1.4], [have_gnutls="yes"], [have_gnutls="no"])
PKG_CHECK_MODULES([NSS], [nss >= 3.11], [have_nss="yes"], [have_nss="no"])
AC_ARG_VAR([MBEDTLS_CFLAGS], [C compiler flags for mbed TLS])
AC_ARG_VAR([MBEDTLS_LIBS], [linker flags for mbed TLS])
if test -z "${MBEDTLS_LIBS}"; then
AC_CHECK_LIB(
[mbedtls],
[mbedtls_x509_crt_init],
[
AC_CHECK_HEADERS(
[mbedtls/x509_crt.h],
,
[AC_MSG_ERROR([Cannot find mbed TLS headers])]
)
MBEDTLS_LIBS="-lmbedtls -lmbedx509 -lmbedcrypto"
have_mbedtls="yes"
],
[AC_CHECK_LIB(
[polarssl],
[x509_crt_parse],
[
AC_CHECK_HEADERS(
[polarssl/x509_crt.h],
,
[AC_MSG_ERROR([Cannot find PolarSSL headers])]
)
MBEDTLS_LIBS="-lpolarssl"
have_mbedtls="yes"
],
[have_mbedtls="no"]
)],
[-lmbedx509 -lmbedcrypto]
)
else
have_mbedtls="yes"
fi
if test -n "${MBEDTLS_CFLAGS}" -a "${have_mbedtls}" = "yes"; then
old_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${MBEDTLS_CFLAGS}"
AC_CHECK_HEADERS([mbedtls/x509_crt.h])
AC_CHECK_HEADERS([polarssl/x509_crt.h])
CFLAGS="${old_CFLAGS}"
fi
if test "${enable_pedantic}" = "yes"; then
enable_strict="yes"
CFLAGS="${CFLAGS} -ansi -pedantic -D__STRICT_ANSI__ -D_ISOC99_SOURCE -D_DEFAULT_SOURCE"
fi
if test "${enable_strict}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wpointer-arith -Wsign-compare -Wno-unused-parameter -Wno-unused-function -Wno-variadic-macros -Wno-long-long"
fi
AX_CPP_VARARG_MACRO_ISO
AX_CPP_VARARG_MACRO_GCC
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AX_SIZE_T_PRINTF
AC_CHECK_INCLUDES_DEFAULT
AC_CHECK_HEADERS([ \
stdio.h \
stdlib.h \
stdargs.h \
malloc.h \
ctype.h \
string.h \
errno.h \
assert.h \
time.h \
])
if test "${WIN32}" != "yes"; then
AC_CHECK_HEADERS([ \
signal.h \
dlfcn.h \
unistd.h \
sys/time.h \
pthread.h \
])
fi
PKCS11H_FEATURES=" key_prompt"
AC_MSG_CHECKING([OpenSSL interface])
if test "${enable_openssl}" = "yes"; then
if test "${have_openssl}" != "yes"; then
AC_MSG_ERROR([OpenSSL enabled but cannot be found])
fi
AC_MSG_RESULT([yes])
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
LIBS="${LIBS} ${OPENSSL_LIBS}"
AC_DEFINE([ENABLE_PKCS11H_OPENSSL], [1], [Enable openssl interface])
PKCS11H_FEATURES="${PKCS11H_FEATURES} openssl"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([Win32 crypto engine])
if test "${WIN32}" = "yes" -a "${enable_crypto_engine_cryptoapi}" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_PKCS11H_ENGINE_CRYPTOAPI], [1], [Enable cryptoapi crypto engine])
crypto_engine=1
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto_cryptoapi"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([OpenSSL crypto engine])
if test "${enable_crypto_engine_openssl}" = "yes"; then
if test "${have_openssl}" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_PKCS11H_ENGINE_OPENSSL], [1], [Enable OpenSSL crypto engine])
# don't add this twice
if test "${enable_openssl}" != "yes"; then
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
LIBS="${LIBS} ${OPENSSL_LIBS}"
fi
crypto_engine=1
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto_openssl"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([GnuTLS crypto engine])
if test "${enable_crypto_engine_gnutls}" = "yes"; then
if test "${have_gnutls}" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_PKCS11H_ENGINE_GNUTLS], [1], [Enable GnuTLS crypto engine])
CFLAGS="${CFLAGS} ${GNUTLS_CFLAGS}"
LIBS="${LIBS} ${GNUTLS_LIBS}"
crypto_engine=1
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto_gnutls"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([NSS crypto engine])
if test "${enable_crypto_engine_nss}" = "yes"; then
if test "${have_nss}" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_PKCS11H_ENGINE_NSS], [1], [Enable NSS crypto engine])
CFLAGS="${CFLAGS} ${NSS_CFLAGS}"
LIBS="${LIBS} ${NSS_LIBS}"
crypto_engine=1
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto_nss"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([mbed TLS crypto engine])
if test "${enable_crypto_engine_mbedtls}" = "yes"; then
if test "${have_mbedtls}" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_PKCS11H_ENGINE_MBEDTLS], [1], [Enable mbed TLS crypto engine])
CFLAGS="${CFLAGS} ${MBEDTLS_CFLAGS}"
LIBS="${LIBS} ${MBEDTLS_LIBS}"
crypto_engine=1
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto_mbedtls"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
if test "${enable_threading}" != "yes" -a "${enable_slotevent}" = "yes"; then
AC_MSG_ERROR([Threading must be enabled for slotevent to be enabled])
fi
if test "${enable_openssl}" = "yes" -a "${enable_certificate}" != "yes"; then
AC_MSG_ERROR([OpenSSL interface requires certificate interface])
fi
if test "${enable_debug}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_DEBUG], [1], [Enable debug support])
PKCS11H_FEATURES="${PKCS11H_FEATURES} debug"
fi
if test "${enable_threading}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_THREADING], [1], [Enable threading])
PKCS11H_FEATURES="${PKCS11H_FEATURES} threading"
fi
if test "${enable_token}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_TOKEN], [1], [Enable token interface])
PKCS11H_FEATURES="${PKCS11H_FEATURES} token"
fi
if test "${enable_data}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_DATA], [1], [Enable data interface])
PKCS11H_FEATURES="${PKCS11H_FEATURES} data"
fi
if test "${enable_certificate}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_CERTIFICATE], [1], [Enable certificate interface])
PKCS11H_FEATURES="${PKCS11H_FEATURES} certificate"
fi
if test "${enable_slotevent}" = "yes"; then
AC_DEFINE([ENABLE_PKCS11H_SLOTEVENT], [1], [Enable slotevent interface])
PKCS11H_FEATURES="${PKCS11H_FEATURES} slotevent"
fi
if test -n "${crypto_engine}"; then
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto"
fi
PKCS11H_FEATURES="${PKCS11H_FEATURES} " # add trailing space
pkgconfigdir="\$(libdir)/pkgconfig"
m4dir="\$(datadir)/aclocal"
pkcs11hincludedir="\$(includedir)/pkcs11-helper-1.0"
AC_SUBST([apidocdir])
AC_SUBST([pkgconfigdir])
AC_SUBST([m4dir])
AC_SUBST([pkcs11hincludedir])
AC_SUBST([LIBPKCS11_HELPER_LT_CURRENT])
AC_SUBST([LIBPKCS11_HELPER_LT_REVISION])
AC_SUBST([LIBPKCS11_HELPER_LT_AGE])
AC_SUBST([LIBPKCS11_HELPER_LT_OLDEST])
AC_SUBST([WIN_LIBPREFIX])
AC_SUBST([PKCS11H_FEATURES])
AM_CONDITIONAL([ENABLE_SHARED], [test "${enable_shared}" = "yes" ])
AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"])
AM_CONDITIONAL([ENABLE_PKCS11H_TOKEN], [test "${enable_token}" = "yes"])
AM_CONDITIONAL([ENABLE_PKCS11H_DATA], [test "${enable_data}" = "yes"])
AM_CONDITIONAL([ENABLE_PKCS11H_CERTIFICATE], [test "${enable_certificate}" = "yes"])
AM_CONDITIONAL([ENABLE_PKCS11H_SLOTEVENT], [test "${enable_slotevent}" = "yes"])
AM_CONDITIONAL([ENABLE_PKCS11H_OPENSSL], [test "${enable_openssl}" = "yes"])
AM_CONDITIONAL([ENABLE_TESTS], [test "${enable_tests}" = "yes"])
AC_CONFIG_FILES([
Makefile
config-w32-vc.h
include/Makefile
include/pkcs11-helper-1.0/Makefile
include/pkcs11-helper-1.0/pkcs11h-version.h
man/Makefile
doc/Makefile
doc/api/Makefile
doc/api/Doxyfile
lib/Makefile
lib/libpkcs11-helper-1.pc
lib/versioninfo.rc
m4dir/Makefile
distro/Makefile
distro/rpm/Makefile
distro/rpm/pkcs11-helper.spec
distro/debian/Makefile
tests/Makefile
tests/test-basic/Makefile
tests/test-certificate/Makefile
tests/test-fork/Makefile
tests/test-openssl/Makefile
tests/test-slotevent/Makefile
])
AC_OUTPUT