forked from opencryptoki/opencryptoki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
668 lines (587 loc) · 18.2 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
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([openCryptoki],[3.15.1],[[email protected]],[],[https://github.com/opencryptoki/opencryptoki])
AC_CONFIG_SRCDIR([testcases/common/common.c])
dnl Needed for $target!
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
dnl Checks for header files.
AC_DISABLE_STATIC
LT_INIT
AC_HEADER_STDC
AC_CHECK_HEADER_STDBOOL
AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h malloc.h \
nl_types.h stddef.h sys/file.h sys/socket.h sys/time.h \
syslog.h termios.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_C_RESTRICT
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([atexit ftruncate gettimeofday localtime_r memchr memmove \
memset mkdir munmap regcomp select socket strchr strcspn \
strdup strerror strncasecmp strrchr strstr strtol strtoul])
dnl Used in various scripts
AC_PATH_PROG([ID], [id], [/us/bin/id])
AC_PATH_PROG([USERMOD], [usermod], [/usr/sbin/usermod])
AC_PATH_PROG([GROUPADD], [groupadd], [/usr/sbin/groupadd])
AC_PATH_PROG([CAT], [cat], [/bin/cat])
AC_PATH_PROG([CHMOD], [chmod], [/bin/chmod])
AC_PATH_PROG([CHGRP], [chgrp], [/bin/chgrp])
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_PROG_LEX
if test "x$LEX" != "xflex"; then
AC_MSG_ERROR(['flex' is missing on your system. Please install 'flex'.])
fi
AC_PROG_YACC
if test "x$YACC" = "xyacc"; then
# AC_PROG_YACC only checks for yacc replacements, not for yacc itself
AC_CHECK_PROG([YACC_FOUND], [yacc], [yes], [no])
if test "x$YACC_FOUND" = "xno"; then
AC_MSG_ERROR(['YACC' program is missing on your system. Please install 'bison'.])
fi
fi
AC_CHECK_LIB([itm], [_ITM_commitTransaction], [itm=yes], [itm=no])
OPENLDAP_LIBS=
AC_CHECK_HEADERS([lber.h ldap.h],
[OPENLDAP_LIBS="-llber -lldap"],
[AC_MSG_ERROR([lber.h and ldap.h are missing. Please install
'openldap-devel'.])])
LIBS="$LIBS $OPENLDAP_LIBS"
AC_SUBST([OPENLDAP_LIBS])
dnl Define custom variables
lockdir=$localstatedir/lock/opencryptoki
AC_SUBST(lockdir)
logdir=$localstatedir/log/opencryptoki
AC_SUBST(logdir)
dnl ---
dnl --- Check all --enable/--disable-features
dnl ---
dnl --- Debugging support
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[enable debugging build @<:@default=no@:>@]),
[],
[enable_debug=no])
dnl --- build testcases
AC_ARG_ENABLE([testcases],
AS_HELP_STRING([--enable-testcases],[build the test cases @<:@default=no@:>@]),
[],
[enable_testcases=no])
dnl --- Check if building daemon
AC_ARG_ENABLE([daemon],
AS_HELP_STRING([--enable-daemon],[build pkcsslotd daemon @<:@default=yes@:>@]),
[],
[enable_daemon=yes])
dnl --- Check if building library
AC_ARG_ENABLE([library],
AS_HELP_STRING([--enable-library],[build opencryptoki libraries @<:@default=yes@:>@]),
[],
[enable_library=yes])
dnl --- Enable/disable tokens
dnl --- those have an additional 'check' state, which essentially means
dnl --- that it will enable it by default it dependencies are met
dnl --- ICA token
AC_ARG_ENABLE([icatok],
AS_HELP_STRING([--enable-icatok],[build ica token @<:@default=enabled if
libica is present@:>@]),
[],
[enable_icatok=check])
dnl --- CCA token
AC_ARG_ENABLE([ccatok],
AS_HELP_STRING([--enable-ccatok],[build cca token (IBM Common Cryptographic
Architecture) @<:@default=enabled@:>@]),
[],
[enable_ccatok=yes])
dnl --- software token
AC_ARG_ENABLE([swtok],
AS_HELP_STRING([--enable-swtok],[build software token @<:@default=enabled@:>@]),
[],
[enable_swtok=yes])
dnl --- EP11 token
AC_ARG_ENABLE([ep11tok],
AS_HELP_STRING([--enable-ep11tok],[build ep11 token @<:@default=enabled
if zcrypt is present@:>@]),
[],
[enable_ep11tok=check])
dnl --- TPM token
AC_ARG_ENABLE([tpmtok],
AS_HELP_STRING([--enable-tpmtok],[build tpm token (Trusted Platform Module)
@<:@default=enabled if TrouSerS is present@:>@]),
[],
[enable_tpmtok=check])
dnl -- icsf token (Integrated Cryptographic Service Facility remote token)
AC_ARG_ENABLE([icsftok],
AS_HELP_STRING([--enable-icsftok],[build icsf token (Integrated
Cryptographic Service Facility) @<:@default=enabled if OpenLDAP library
is present@:>@]),
[],
[enable_icsftok=check])
dnl --- token-specific stuff
dnl --- pkcsep11_migrate
AC_ARG_ENABLE([pkcsep11_migrate],
AS_HELP_STRING([--enable-pkcsep11_migrate],[build pkcsep11_migrate (EP11 token key migration tool) @<:@default=enabled if EP11 library is present@:>@]),
[],
[enable_pkcsep11_migrate=check])
dnl --- pkcsep11_session
AC_ARG_ENABLE([pkcsep11_session],
AS_HELP_STRING([--enable-pkcsep11_session],[build pkcsep11_session (EP11 token session logout tool) @<:@default=enabled if EP11 library is present@:>@]),
[],
[enable_pkcsep11_session=check])
dnl --- locking support
AC_ARG_ENABLE([locks],
AS_HELP_STRING([--disable-locks],[build opencryptoki with transactional memory instead of locks]))
dnl --- p11sak tool
AC_ARG_ENABLE([p11sak],
AS_HELP_STRING([--enable-p11sak],[build p11sak tool @<:@default=enabled@:>@]),
[],
[enable_p11sak=yes])
dnl --- pkcstok_migrate
AC_ARG_ENABLE([pkcstok_migrate],
AS_HELP_STRING([--enable-pkcstok_migrate],[build pkcstok_migrate tool @<:@default=enabled@:>@]),
[],
[enable_pkcstok_migrate=yes])
dnl ---
dnl --- Check for external software
dnl --- Define what to check based on enabled features
dnl --- Openssl development files
AC_ARG_WITH([openssl],
AS_HELP_STRING([--with-openssl@<:@=DIR@:>@],[OpenSSL development files location]),
[],
[with_openssl=check])
dnl --- Libica development files
AC_ARG_WITH([libica],
AS_HELP_STRING([--with-libica@<:@=DIR@:>@],[libica development files location]),
[],
[with_libica=check])
dnl --- zcrypt development files
AC_ARG_WITH([zcrypt],
AS_HELP_STRING([--with-zcrypt@<:@=DIR@:>@],[zcrypt development files location]),
[],
[with_zcrypt=check])
dnl --- TSS (TrouSerS) development files
AC_ARG_WITH([tss],
AS_HELP_STRING([--with-tss@<:@=DIR@:>@],[TrouSerS development files location]),
[],
[with_tss=check])
dnl --- xcryptolinz development files (IBM CCA development files)
AC_ARG_WITH([xcryptolinz],
AS_HELP_STRING([--with-xcryptolinz@<:@=DIR@:>@],[CCA library (xcryptolinz) location]),
[],
[with_xcryptolinz=check])
dnl --- systemd system unit files location
AC_ARG_WITH([systemd],
AS_HELP_STRING([--with-systemd@<:@=DIR@:>@],[systemd system unit files location]),
[],
[with_systemd=no])
dnl ---
dnl ---
dnl --- Now that we have all the options, let's check for a valid build
dnl ---
case $target in
*s390x*)
;;
*s390*)
CFLAGS="$CFLAGS -m31"
;;
*ppc64* | *x86_64*)
;;
*ppc* | i*86*)
CFLAGS="$CFLAGS -m32"
;;
esac
dnl --- enable_debug
if test "x$enable_debug" = "xyes"; then
CFLAGS="$CFLAGS -gdwarf-2 -g3 -O0 -DDEBUG"
fi
dnl --- first, check what external software is present or specified
dnl --- with --with-package=DIR
dnl --- with_openssl
OPENSSL_CFLAGS=
OPENSSL_LIBS=
if test "x$with_openssl" != "xno"; then
if test "x$with_openssl" != "xyes" -a "x$with_openssl" != "xcheck"; then
OPENSSL_CFLAGS="-I$with_openssl"
OPENSSL_LIBS="-L$with_openssl"
fi
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
LIBS="$LIBS $OPENSSL_LIBS"
AC_CHECK_HEADER([openssl/ssl.h], [], [
if test "x$with_openssl" != "xcheck"; then
AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL headers couldn't be found])
fi
with_openssl=no
])
if test "x$with_openssl" != "xno"; then
AC_CHECK_LIB([crypto], [RSA_generate_key], [
OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto"
with_openssl=yes
], [
if test "x$with_openssl" != "xcheck"; then
AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL libraries couldn't be found])
fi
with_openssl=no
])
fi
if test "x$with_openssl" = "xno"; then
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
fi
AC_SUBST([OPENSSL_CFLAGS])
AC_SUBST([OPENSSL_LIBS])
dnl --- with_libica
LIBICA_CFLAGS=
LIBICA_LIBS=
if test "x$with_libica" != "xno"; then
if test "x$with_libica" != "xyes" -a "x$with_libica" != "xcheck"; then
LIBICA_CFLAGS="-I$with_libica"
LIBICA_LIBS="-L$with_libica"
fi
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $LIBICA_CFLAGS"
LIBS="$LIBS $LIBICA_LIBS"
AC_CHECK_HEADER([ica_api.h], [], [
if test "x$with_libica" != "xcheck"; then
AC_MSG_ERROR([Build with Libica requested but Libica headers couldn't be found])
fi
with_libica=no
])
if test "x$with_libica" != "xno"; then
AC_CHECK_LIB([ica], [ica_open_adapter],
[with_libica=yes], [
if test "x$with_libica" != "xcheck"; then
AC_MSG_ERROR([Build with Libica requested but Libica libraries (v 2.x or higher) couldn't be found])
fi
with_libica=no
])
fi
if test "x$with_libica" = "xno"; then
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
fi
AC_SUBST([LIBICA_CFLAGS])
AC_SUBST([LIBICA_LIBS])
dnl --- with_zcrypt
ZCRYPT_CFLAGS=
ZCRYPT_LIBS=
if test "x$with_zcrypt" != "xno"; then
if test "x$with_zcrypt" != "xyes" -a "x$with_zcrypt" != "xcheck"; then
ZCRYPT_CFLAGS="-I$with_zcrypt"
ZCRYPT_LIBS="-L$with_zcrypt"
fi
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $ZCRYPT_CFLAGS"
LIBS="$LIBS $ZCRYPT_LIBS"
AC_CHECK_HEADER([asm/zcrypt.h], [], [
if test "x$with_zcrypt" != "xcheck"; then
AC_MSG_ERROR([Build with zcrypt requested but zcrypt headers couldn't be found])
fi
with_zcrypt=no
])
if test "x$with_zcrypt" != "xno"; then
with_zcrypt=yes
fi
if test "x$with_zcrypt" = "xno"; then
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
fi
AC_SUBST([ZCRYPT_CFLAGS])
AC_SUBST([ZCRYPT_LIBS])
dnl --- with_tss
TSS_CFLAGS=
TSS_LIBS=
if test "x$with_tss" != "xno"; then
if test "x$with_tss" != "xyes" -a "x$with_tss" != "xcheck"; then
TSS_CFLAGS="-I$with_tss"
TSS_LIBS="-L$with_tss"
fi
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $TSS_CFLAGS"
LIBS="$LIBS $TSS_LIBS"
AC_CHECK_HEADER([tss/platform.h], [], [
if test "x$with_tss" != "xcheck"; then
AC_MSG_ERROR([Build with TSS requested but TSS headers couldn't be found])
fi
with_tss=no
])
if test "x$with_tss" != "xno"; then
AC_CHECK_LIB([tspi], [Tspi_Context_Create],
[with_tss=yes], [
if test "x$with_tss" != "xcheck"; then
AC_MSG_ERROR([Build with TSS requested but TSS libraries couldn't be found])
fi
with_tss=no
])
fi
if test "x$with_tss" = "xno"; then
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
fi
AC_SUBST([TSS_CFLAGS])
AC_SUBST([TSS_LIBS])
dnl --- with_xcryptolinz
XCRYPTOLINZ_CFLAGS=
XCRYPTOLINZ_LIBS=
if test "x$with_xcryptolinz" != "xno"; then
if test "x$with_xcryptolinz" != "xyes" -a "x$with_xcryptolinz" != "xcheck"; then
XCRYPTOLINZ_CFLAGS="-I$with_xcryptolinz"
XCRYPTOLINZ_LIBS="-L$with_xcryptolinz"
fi
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $XCRYPTOLINZ_CFLAGS"
LIBS="$LIBS $XCRYPTOLINZ_LIBS"
dnl - The above may not be necessary since opencryptoki brings this header file anyway.
AC_CHECK_HEADER([csulincl.h], [], [
if test "x$with_xcryptolinz" != "xcheck"; then
AC_MSG_ERROR([Build with xcryptolinz requested but xcryptolinz headers couldn't be found])
fi
with_xcryptolinz=no
])
if test "x$with_xcryptolinz" != "xno"; then
AC_CHECK_LIB([csulcca], [CSNBKTC],
[with_xcryptolinz=yes], [
if test "x$with_xcryptolinz" != "xcheck"; then
AC_MSG_ERROR([Build with xcryptolinz requested but xcryptolinz libraries couldn't be found])
fi
with_xcryptolinz=no
])
fi
if test "x$with_xcryptolinz" = "xno"; then
CFLAGS="$old_cflags"
LIBS="$old_libs"
fi
fi
AC_SUBST([XCRYPTOLINZ_CFLAGS])
AC_SUBST([XCRYPTOLINZ_LIBS])
dnl ---
dnl --- Now check enabled features, while making sure every required
dnl --- package is available
dnl ---
dnl --- enable_testcases
if test "x$enable_testcases" = "xyes"; then
AC_CHECK_PROG([HAVE_EXPECT], [expect], [yes], [no])
if test "x$HAVE_EXPECT" = "xno"; then
AC_MSG_ERROR([*** testcases requires 'expect' interpreter, which wasn't found])
enable_testcases=no
fi
fi
AM_CONDITIONAL([ENABLE_TESTCASES], [test "x$enable_testcases" = "xyes"])
dnl --- enable_daemon
AM_CONDITIONAL([ENABLE_DAEMON], [test "x$enable_daemon" = "xyes"])
dnl --- enable_library
AM_CONDITIONAL([ENABLE_LIBRARY], [test "x$enable_library" = "xyes"])
dnl --- enable systemd and set unit dir
if test "x$with_systemd" != "xno"; then
if test "x$with_systemd" != "xyes" -a "x$with_systemd" != "xcheck"; then
unitdir=$with_systemd
enable_systemd=yes
else
if test "x$with_systemd" = "xyes"; then
unitdir=${ac_default_prefix}/lib/systemd/system
enable_systemd=yes
else
enable_systemd=no
fi
fi
else
enable_systemd=no
fi
AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
AC_SUBST(unitdir)
dnl --- enable_icatok
if test "x$enable_icatok" = "xyes"; then
if test "x$with_libica" != "xyes"; then
AC_MSG_ERROR([ica token build requested but libica development files not found])
enable_icatok=no
fi
if test "x$with_openssl" != "xyes"; then
AC_MSG_ERROR([ica token build requested but OpenSSL development files not found])
enable_icatok=no
fi
fi
if test "x$enable_icatok" != "xno" -a "x$with_libica" != "xno" -a "x$with_openssl" != "xno"; then
enable_icatok=yes
else
enable_icatok=no
fi
AM_CONDITIONAL([ENABLE_ICATOK], [test "x$enable_icatok" = "xyes"])
dnl --- enable_ccatok
AM_CONDITIONAL([ENABLE_CCATOK], [test "x$enable_ccatok" = "xyes"])
dnl --- enable_swtok
if test "x$enable_swtok" = "xyes"; then
if test "x$with_openssl" != "xyes"; then
AC_MSG_ERROR([software token build requested but OpenSSL development files not found])
enable_swtok=no
fi
fi
if test "x$enable_swtok" != "xno" -a "x$with_openssl" != "xno"; then
enable_swtok=yes
else
enable_swtok=no
fi
AM_CONDITIONAL([ENABLE_SWTOK], [test "x$enable_swtok" = "xyes"])
dnl --- enable_ep11tok
if test "x$enable_ep11tok" = "xyes"; then
if test "x$with_zcrypt" != "xyes"; then
AC_MSG_ERROR([ep11 token build requested but ep11 development files not found])
enable_ep11=no
fi
AC_CHECK_HEADER([ica_api.h], [], [
AC_MSG_ERROR([ep11 token build requested but Libica headers couldn't be found])
])
fi
if test "x$enable_ep11tok" != "xno" -a "x$with_zcrypt" != "xno"; then
enable_ep11tok=yes
AC_CHECK_HEADER([ica_api.h], [], [
enable_ep11tok=no
])
else
enable_ep11tok=no
fi
AM_CONDITIONAL([ENABLE_EP11TOK], [test "x$enable_ep11tok" = "xyes"])
dnl --- enable_icsftok
if test "x$enable_icsftok" = "xyes"; then
if test "x$with_openssl" != "xyes"; then
AC_MSG_ERROR([ICSF token build requested but OpenSSL development files not found])
enable_icsftok=no
fi
fi
if test "x$enable_icsftok" != "xno" -a "x$with_openssl" != "xno"; then
enable_icsftok=yes
else
enable_icsftok=no
fi
AM_CONDITIONAL([ENABLE_ICSFTOK], [test "x$enable_icsftok" = "xyes"])
dnl --- enable_tpmtok
if test "x$enable_tpmtok" = "xyes"; then
if test "x$with_tss" != "xyes"; then
AC_MSG_ERROR([tpm token build requested but TSS development files not found])
enable_tpmtok=no
fi
fi
if test "x$enable_tpmtok" != "xno" -a "x$with_tss" != "xno"; then
enable_tpmtok=yes
else
enable_tpmtok=no
fi
AM_CONDITIONAL([ENABLE_TPMTOK], [test "x$enable_tpmtok" = "xyes"])
dnl --- enable_pkcsep11_migrate
if test "x$enable_pkcsep11_migrate" = "xyes"; then
if test "x$with_zcrypt" != "xyes"; then
AC_MSG_ERROR([pkcsep11_migrate build requested but no ep11 libraries found])
enable_pkcsep11_migrate=no
fi
fi
if test "x$enable_pkcsep11_migrate" != "xno" -a "x$with_zcrypt" != "xno"; then
enable_pkcsep11_migrate=yes
else
enable_pkcsep11_migrate=no
fi
AM_CONDITIONAL([ENABLE_PKCSEP11_MIGRATE], [test "x$enable_pkcsep11_migrate" = "xyes"])
dnl --- enable_pkcsep11_session
if test "x$enable_pkcsep11_session" = "xyes"; then
if test "x$with_zcrypt" != "xyes"; then
AC_MSG_ERROR([pkcsep11_session build requested but no ep11 libraries found])
enable_pkcsep11_session=no
fi
fi
if test "x$enable_pkcsep11_session" != "xno" -a "x$with_zcrypt" != "xno"; then
enable_pkcsep11_session=yes
else
enable_pkcsep11_session=no
fi
AM_CONDITIONAL([ENABLE_PKCSEP11_SESSION], [test "x$enable_pkcsep11_session" = "xyes"])
dnl --- enable_p11sak
AM_CONDITIONAL([ENABLE_P11SAK], [test "x$enable_p11sak" = "xyes"])
dnl --- enable_pkcstok_migrate
AM_CONDITIONAL([ENABLE_PKCSTOK_MIGRATE], [test "x$enable_pkcstok_migrate" = "xyes"])
dnl --- enable_locks
if test "x$enable_locks" != "xno"; then
enable_locks=yes
CFLAGS="$CFLAGS -DENABLE_LOCKS"
else
enable_locks=no
CFLAGS="$CFLAGS -fgnu-tm"
fi
if test "x$enable_locks" = "xno"; then
if test "x$itm" != "xyes"; then
AC_MSG_ERROR([in order to build opencryptoki with transactional memory,
libitm and gcc>=4.7 is required])
fi
fi
AM_CONDITIONAL([ENABLE_LOCKS], [test "x$enable_locks" = "xyes"])
CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=600 -Wall -Wextra"
CFLAGS+=' -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" -DSBIN_PATH=\"$(sbindir)\" -DLIB_PATH=\"$(libdir)\" -DLOCKDIR_PATH=\"$(lockdir)\" -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\" -DOCK_LOGDIR=\"$(logdir)\"'
# At this point, CFLAGS is set to something sensible
AC_PROG_CC
AC_PROG_CXX
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_FILES([Makefile \
usr/lib/api/shrd_mem.c \
man/man1/pkcsconf.1 \
man/man1/pkcsicsf.1 \
man/man1/pkcscca.1 \
man/man1/p11sak.1 \
man/man1/pkcsep11_migrate.1 \
man/man1/pkcsep11_session.1 \
man/man1/pkcstok_migrate.1 \
man/man5/opencryptoki.conf.5 \
man/man7/opencryptoki.7 \
man/man8/pkcsslotd.8])
AC_OUTPUT
echo "Enabled features:"
echo " Debug build: $enable_debug"
echo " Testcases: $enable_testcases"
echo " Daemon build: $enable_daemon"
echo " Library build: $enable_library"
echo " Systemd service: $enable_systemd"
echo " Build with locks: $enable_locks"
echo " Build p11sak tool: $enable_p11sak"
echo " token migrate tool: $enable_pkcstok_migrate"
echo
echo "Enabled token types:"
echo " ICA token: $enable_icatok"
echo " CCA token: $enable_ccatok"
echo " Software token: $enable_swtok"
echo " EP11 token: $enable_ep11tok"
echo " TPM token: $enable_tpmtok"
echo " ICSF token: $enable_icsftok"
echo
echo "Token-specific features:"
echo " pkcsep11migrate build: $enable_pkcsep11_migrate"
echo " pkcsep11session build: $enable_pkcsep11_session"
echo
echo "CFLAGS=$CFLAGS"
echo