File: configure.in

package info (click to toggle)
opencryptoki 2.2.8%2Bdfsg-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,588 kB
  • ctags: 7,069
  • sloc: ansic: 97,330; sh: 10,650; makefile: 501
file content (353 lines) | stat: -rw-r--r-- 10,487 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(openCryptoki, 2.2.6, opencryptoki-tech@lists.sourceforge.net,)

dnl Backup CFLAGS so that once the auto tools set it to "-g -O2",
dnl (which we want to avoid), we can restore them to whatever the
dnl user might have wanted below.
cmdline_CFLAGS="$CFLAGS"

# Compute $target
AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE([foreign 1.6])

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h syslog.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd])

# Used in the init scripts
AC_SUBST(ID, /usr/bin/id)
AC_SUBST(USERMOD, /usr/sbin/usermod)
AC_SUBST(GROUPADD, /usr/sbin/groupadd)

dnl i.e., /usr/local or /usr
if test "x$prefix" = xNONE; then
  prefix=$ac_default_prefix
fi
if test "x$exec_prefix" = xNONE; then
  exec_prefix='${prefix}'
fi

CFLAGS="$cmdline_CFLAGS"

s390=0

# Arch specific stuff
case $target in
	*64*)
		lib="lib64"
		AM_CONDITIONAL(S390, false) ;;
	*s390x*)
		s390=1
		lib="lib64"
		AM_CONDITIONAL(S390, true) ;;
	*s390*)
		s390=1
		lib="lib"
		AM_CONDITIONAL(S390, true) ;;
        *)
		lib="lib"
		AM_CONDITIONAL(S390, false) ;;
esac

if test "x$prefix" == x/usr; then
        AC_SUBST(CONFIG_PATH, /var/lib/opencryptoki)
	AC_SUBST(CONFIG_PATH_ETC, /etc)
        AC_SUBST(SBIN_PATH, /usr/sbin)
        AC_SUBST(DB_PATH, /var/lib/opencryptoki)
else
        AC_SUBST(CONFIG_PATH, $prefix/var/lib/opencryptoki)
	AC_SUBST(CONFIG_PATH_ETC, $prefix/etc)
        AC_SUBST(SBIN_PATH, $prefix/sbin)
        AC_SUBST(DB_PATH, $prefix/var/lib/opencryptoki)
fi

AC_SUBST(LIB_PATH, $prefix/$lib/opencryptoki)
AC_SUBST(STDLL_PATH, $LIB_PATH/stdll)
AC_SUBST(CONFIG_FILE, pk_config_data)
AC_SUBST(METHOD_PATH, $prefix/sbin)
AC_SUBST(HEADER_PATH, $prefix/include)

# Debugging support
AC_ARG_ENABLE(debug, [  --enable-debug          turn on all openCryptoki debugging flags],
                     [ enable_debug="yes"],)

if test "x$enable_debug" = xyes; then
	CFLAGS="$CFLAGS -g -O0 -DDEBUG -DDEBUGON"
	AC_MSG_RESULT([*** Enabling debugging at user request ***])
else
	CFLAGS="$CFLAGS -O2"
fi

# Support for OpenSSL path specification
AC_ARG_WITH(openssl,
        [  --with-openssl[[=DIR]]    build with OpenSSL support [[/usr/local/ssl]]],
        [openssl_prefix=$withval], 
        [openssl_prefix=]
)
if test "x$openssl_prefix" != x; then
	AC_MSG_RESULT([*** Using OpenSSL directory $openssl_prefix ***])
	LDFLAGS="-L$openssl_prefix/lib $LDFLAGS"
	CFLAGS="-I$openssl_prefix/include $CFLAGS"
fi

# Check if building daemon
AC_ARG_ENABLE(daemon, [  --disable-daemon        don't build pkcsslotd [default=enabled]],
              [AM_CONDITIONAL(DAEMON, false)],
              [AM_CONDITIONAL(DAEMON, true)])

# Check if building library
AC_ARG_ENABLE(library, [  --disable-library       don't build libopencryptoki [default=enabled]],
              [AM_CONDITIONAL(LIBRARY, false)],
              [AM_CONDITIONAL(LIBRARY, true)])

#
# s390 tokens
#

# The ica token is enabled by default on s390
if [[ $s390 -eq 1 ]]; then

AM_CONDITIONAL(ICA, false)
AC_ARG_ENABLE(ica390tok,
              [  --disable-ica390tok     s390 only: don't build the ICA token [default=enabled]],
              [AM_CONDITIONAL(DEFAULT_DLL, false)],
              [enable_ica390tok="yes"])

if test "x$enable_ica390tok" = xyes; then
        AM_CONDITIONAL(DEFAULT_DLL, true)
else
        AC_MSG_RESULT([*** Disabling the default ICA token at user request ***])
fi

else
#
# non s390 tokens
#

# The software token is enabled by default on non-s390 platforms
AC_ARG_ENABLE(swtok,
              [  --disable-swtok         don't build the software token [default=enabled (except s390)]],
              [AM_CONDITIONAL(DEFAULT_DLL, false)],
              [enable_swtok="yes"])

if test "x$enable_swtok" = xyes; then
        AC_CHECK_LIB(crypto, AES_encrypt,
             [AM_CONDITIONAL(DEFAULT_DLL, true)],
             [AM_CONDITIONAL(DEFAULT_DLL, false)])
else
        AC_MSG_RESULT([*** Disabling the default software token at user request ***])
fi

# Support for the IBM Crypto Accelerator (PCICA) token
AC_ARG_ENABLE(icatok,
              [  --enable-icatok         build the IBM Crypto Accelerator (PCICA) token [default=disabled]],
              [enable_icatok="yes"],
              [enable_icatok="no"])

if test "x$enable_icatok" = xyes; then
	AC_CHECK_HEADER(ica_api.h,
			AC_CHECK_LIB(ica, icaOpenAdapter,
				[AM_CONDITIONAL(ICA, true)],
				[AM_CONDITIONAL(ICA, false)]),
			[AM_CONDITIONAL(ICA, false)],,)
else 
	AM_CONDITIONAL(ICA, false)
fi

fi

# TPM support for the TPM token
AC_ARG_ENABLE(tpmtok,
              [  --enable-tpmtok         build the TPM token [default=disabled]],
              [enable_tpmtok="yes"],
              [enable_tpmtok="no"])

if test "x$enable_tpmtok" = xyes; then
	AC_CHECK_HEADER(tss/platform.h,
	AC_CHECK_LIB(crypto, AES_encrypt,
			AC_CHECK_LIB(tspi, Tspi_Context_Create,
				     [AM_CONDITIONAL(TPM, true)],
                                     [AM_CONDITIONAL(TPM, false)], 
                                     -lcrypto),
			[AM_CONDITIONAL(TPM, false)]),
		[AM_CONDITIONAL(TPM, false)])
else
	AM_CONDITIONAL(TPM, false)
fi

# Support for the IBM 4758 (PCICC) token
AC_ARG_ENABLE(icctok,
              [  --enable-icctok         build the IBM 4758 (PCICC) token [default=disabled]],
              [enable_icctok="yes"],
              [enable_icctok="no"])

if test "x$enable_icctok" = xyes; then
	AC_CHECK_HEADER(scc_host.h,
			AC_CHECK_LIB(scc, sccOpenAdapter,
				[AM_CONDITIONAL(ICC, true)],
				[AM_CONDITIONAL(ICC, false)]),
			[AM_CONDITIONAL(ICC, false)],,)
else
	AM_CONDITIONAL(ICC, false)
fi

# Support for the secure-key (CCA api) token
AC_ARG_ENABLE(ccatok,
              [  --enable-ccatok         build the IBM CCA Secure-Key token [default=disabled]],
              [enable_ccatok="yes"],
              [enable_ccatok="no"])

if test "x$enable_ccatok" = xyes; then
	AM_CONDITIONAL(CCA, true)
else
	AM_CONDITIONAL(CCA, false)
fi

# Support for the AEP Crypto Accelerator
AC_ARG_ENABLE(aeptok,
              [  --enable-aeptok         build the AEP Crypto Accelerator token [default=disabled]],
              [enable_aeptok="no"],
              [enable_aeptok="yes"])

if test "x$enable_aeptok" = xyes; then
        AC_CHECK_LIB(aep, AEP_Initialize,
             [AM_CONDITIONAL(AEP, true)],
             [AM_CONDITIONAL(AEP, false)])
else
        AM_CONDITIONAL(AEP, false)
fi

# Support for the Broadcom Crypto Accelerator
AC_ARG_ENABLE(bcomtok,
              [  --enable-bcomtok        build the Broadcom Crypto Accelerator token [default=disabled]],
              [enable_bcomtok="no"],
              [enable_bcomtok="yes"])

if test "x$enable_bcomtok" = xyes; then
	AC_CHECK_HEADER(ubsec.h,
			AC_CHECK_LIB(ubsec, ubsec_open,
				[AM_CONDITIONAL(BCOM, true)],
				[AM_CONDITIONAL(BCOM, false)]),
			[AM_CONDITIONAL(BCOM, false)],,)
else
	AM_CONDITIONAL(BCOM, false)
fi

# Support for the Corrent Crypto Accelerator
AC_ARG_ENABLE(crtok,
              [  --enable-crtok          build the Corrent Crypto Accelerator token [default=disabled]],
              [enable_crtok="no"],
              [enable_crtok="yes"])

if test "x$enable_crtok" = xyes; then
	AC_CHECK_HEADER(typhoon.h,
			AC_CHECK_LIB(socketarmor, CR_init_lib,
				[AM_CONDITIONAL(CR, true)],
				[AM_CONDITIONAL(CR, false)], -ldl),
			[AM_CONDITIONAL(CR, false)],,)
else
        AM_CONDITIONAL(CR, false)
fi

# Check if building tests
AC_ARG_ENABLE(testcases,
              [  --enable-testcases      build the test cases [default=disabled]],
              [AM_CONDITIONAL(TESTS, true)],
              [AM_CONDITIONAL(TESTS, false)])


CFLAGS="$CFLAGS -DPKCS64			\
	-DCONFIG_PATH=\\\"$CONFIG_PATH\\\"	\
	-DSBIN_PATH=\\\"$SBIN_PATH\\\"		\
	-DLIB_PATH=\\\"$LIB_PATH\\\"		\
	-D_XOPEN_SOURCE=500"

# At this point, CFLAGS is set to something sensible
AC_PROG_CC

AC_OUTPUT([Makefile usr/Makefile \
          usr/include/Makefile \
          usr/include/pkcs11/Makefile \
          usr/lib/Makefile \
          usr/lib/pkcs11/Makefile \
          usr/lib/pkcs11/api/Makefile \
          usr/lib/pkcs11/api/shrd_mem.c \
          usr/lib/pkcs11/ica_stdll/Makefile \
          usr/lib/pkcs11/ica_stdll/tok_struct.h \
          usr/lib/pkcs11/ica_s390_stdll/Makefile \
          usr/lib/pkcs11/ica_s390_stdll/tok_struct.h \
          usr/sbin/Makefile \
          usr/sbin/pkcsslotd/Makefile \
          usr/sbin/pkcs11_startup/Makefile \
          usr/sbin/pkcs11_startup/pkcs11_startup \
          usr/sbin/pkcs_slot/Makefile \
          usr/sbin/pkcs_slot/pkcs_slot \
          usr/sbin/pkcsconf/Makefile \
          usr/sbin/pkcscca_migrate/Makefile \
          usr/lib/pkcs11/methods/Makefile \
          usr/lib/pkcs11/leeds_stdll/Makefile \
          usr/lib/pkcs11/soft_stdll/Makefile \
          usr/lib/pkcs11/soft_stdll/tok_struct.h \
          usr/lib/pkcs11/bcom_stdll/Makefile \
          usr/lib/pkcs11/bcom_stdll/tok_struct.h \
          usr/lib/pkcs11/cr_stdll/Makefile \
          usr/lib/pkcs11/cr_stdll/tok_struct.h \
          usr/lib/pkcs11/aep_stdll/Makefile \
          usr/lib/pkcs11/aep_stdll/tok_struct.h \
          usr/lib/pkcs11/tpm_stdll/Makefile \
          usr/lib/pkcs11/tpm_stdll/tok_struct.h \
          usr/lib/pkcs11/cca_stdll/Makefile \
          usr/lib/pkcs11/cca_stdll/tok_struct.h \
          usr/lib/pkcs11/methods/4758_status/Makefile \
          misc/Makefile \
          misc/pkcsslotd \
	  testcases/Makefile \
	  testcases/common/Makefile \
	  testcases/driver/Makefile \
	  testcases/init_tok/Makefile \
	  testcases/mkobj/Makefile \
	  testcases/oc-digest/Makefile \
	  testcases/rsa_keygen/Makefile \
	  testcases/rsa_test/Makefile \
	  testcases/speed/Makefile \
	  testcases/test_crypto/Makefile \
	  testcases/threadmkobj/Makefile \
	  testcases/tok_obj/Makefile \
	  testcases/v2.11/Makefile \
	  testcases/login/Makefile \
	  man/Makefile \
	  man/man1/Makefile \
	  man/man1/pkcsconf.1 \
	  man/man1/pkcs11_startup.1 \
	  man/man5/Makefile \
	  man/man5/pk_config_data.5 \
	  man/man7/Makefile \
	  man/man7/opencryptoki.7 \
	  man/man8/Makefile \
	  man/man8/pkcsslotd.8])

echo
echo "CLFAGS=$CFLAGS"
echo