]> git.proxmox.com Git - swtpm.git/blame - configure.ac
swtpm_setup: Add missing --print-capabilities to help screen
[swtpm.git] / configure.ac
CommitLineData
f163b202
SB
1#
2# configure.ac
3#
4# The Initial Developer of the Original Code is International
5# Business Machines Corporation. Portions created by IBM
6# Corporation are Copyright (C) 2014 International Business
7# Machines Corporation. All Rights Reserved.
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the Common Public License as published by
11# IBM Corporation; either version 1 of the License, or (at your option)
12# any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# Common Public License for more details.
18#
19# You should have received a copy of the Common Public License
20# along with this program; if not, a copy can be viewed at
21# http://www.opensource.org/licenses/cpl1.0.php.
22#
23# This file is derived from tpm-tool's configure.in.
24#
25
3bf8f462 26AC_INIT(swtpm, 0.5.0)
f163b202
SB
27AC_PREREQ(2.12)
28AC_CONFIG_SRCDIR(Makefile.am)
29AC_CONFIG_HEADER(config.h)
30
31SWTPM_VER_MAJOR=`echo $PACKAGE_VERSION | cut -d "." -f1`
32SWTPM_VER_MINOR=`echo $PACKAGE_VERSION | cut -d "." -f2`
33SWTPM_VER_MICRO=`echo $PACKAGE_VERSION | cut -d "." -f3`
34
35AC_SUBST([SWTPM_VER_MAJOR])
36AC_SUBST([SWTPM_VER_MINOR])
37AC_SUBST([SWTPM_VER_MICRO])
38
39dnl Check for programs
40AC_PROG_CC
41AC_PROG_INSTALL
42AC_PROG_LN_S
908afaf5 43LT_INIT
f163b202 44
f163b202
SB
45AC_CONFIG_MACRO_DIR([m4])
46AC_CANONICAL_TARGET
c3fdf688 47AC_CANONICAL_HOST
f163b202 48AM_INIT_AUTOMAKE([foreign 1.6])
13cb26d8 49AM_SILENT_RULES([yes])
f163b202
SB
50
51DEBUG=""
52AC_MSG_CHECKING([for debug-enabled build])
53AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [create a debug build]),
54 [if test "$enableval" = "yes"; then
55 DEBUG="yes"
56 AC_MSG_RESULT([yes])
57 else
58 DEBUG="no"
59 AC_MSG_RESULT([no])
60 fi],
61 [DEBUG="no",
62 AC_MSG_RESULT([no])])
63
64# If the user has not set CFLAGS, do something appropriate
65test_CFLAGS=${CFLAGS+set}
66if test "$test_CFLAGS" != set; then
33be7be2 67 if test "$DEBUG" = "yes"; then
f163b202
SB
68 CFLAGS="-O0 -g -DDEBUG"
69 else
70 CFLAGS="-g -O2"
71 fi
33be7be2 72elif test "$DEBUG" = "yes"; then
f163b202
SB
73 CFLAGS="$CFLAGS -O0 -g -DDEBUG"
74fi
75
e46a2b66
SB
76AC_HEADER_STDC
77AC_C_CONST
78AC_C_INLINE
79
80AC_TYPE_SIZE_T
81AC_TYPE_SIGNAL
82
baecda40
SB
83AC_PROG_CC
84AC_PROG_INSTALL
3cb54a5d 85AC_PROG_MKDIR_P
e46a2b66 86
ec37bb56
SB
87AC_ARG_WITH([selinux],
88 AS_HELP_STRING([--with-selinux],
89 [add SELinux policy extensions @<:@default=check@:>@]))
90m4_divert_text([DEFAULTS], [with_selinux=check])
91
92dnl Check for SELinux policy support
93
94if test "$with_selinux" != "no"; then
95 if test "$with_selinux" = "check" || test "$with_selinux" = "yes"; then
96 if ! test -f /usr/share/selinux/devel/Makefile; then
97 if test "$with_selinux" = "yes"; then
98 AC_MSG_ERROR("Is selinux-policy-devel installed?")
99 else
100 with_selinux="no"
101 fi
102 fi
103 AC_PATH_PROG([SEMODULE], semodule)
33be7be2 104 if test "x$SEMODULE" = "x"; then
ec37bb56
SB
105 if test "$with_selinux" = "yes"; then
106 AC_MSG_ERROR("Is selinux-policy-devel installed?")
107 else
108 with_selinux="no"
109 fi
110 fi
111 if test "$with_selinux" = "check"; then
112 with_selinux="yes"
113 fi
114 fi
115fi
33be7be2 116AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"])
ec37bb56 117
b096be26
SB
118if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc'; then
119 sysconfdir="/etc"
120fi
121if test "$prefix" = "" && test "$datarootdir" = '${prefix}/share'; then
122 datarootdir="/usr/share"
123fi
d16b86b7
SB
124if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var'; then
125 localstatedir="/var"
126fi
5d35321e
SB
127if test "x$prefix" = "xNONE"; then
128 prefix="/usr/local"
129fi
0432b653
SB
130SYSCONFDIR=`eval echo $sysconfdir`
131DATAROOTDIR=`eval echo $datarootdir`
d16b86b7 132LOCALSTATEDIR=`eval echo $localstatedir`
0432b653
SB
133AC_SUBST([SYSCONFDIR])
134AC_SUBST([DATAROOTDIR])
d16b86b7 135AC_SUBST([LOCALSTATEDIR])
b096be26 136
7849b6c6 137cryptolib=openssl
3bbdd7bc
SB
138
139AC_ARG_WITH([openssl],
7849b6c6
SB
140 [AS_HELP_STRING([--with-openssl],
141 [build with openssl library])],
142 [],
143 [])
3bbdd7bc
SB
144
145case "$cryptolib" in
3bbdd7bc 146openssl)
7849b6c6
SB
147 AC_CHECK_LIB(crypto,
148 [AES_set_encrypt_key],
b78b6af2 149 [true],
7849b6c6
SB
150 AC_MSG_ERROR(Faulty openssl crypto library))
151 AC_CHECK_HEADERS([openssl/aes.h],[],
152 AC_MSG_ERROR(Is openssl-devel/libssl-dev installed?))
153 AC_MSG_RESULT([Building with openssl crypto library])
0371b63b
SB
154 LIBCRYPTO_LIBS=$(pkg-config --libs libcrypto)
155 AC_SUBST([LIBCRYPTO_LIBS])
7849b6c6 156 ;;
3bbdd7bc 157esac
833a5416 158
baecda40
SB
159LIBTASN1_LIBS=$(pkg-config --libs libtasn1)
160if test $? -ne 0; then
161 AC_MSG_ERROR("Is libtasn1-devel installed? -- could not get libs for libtasn1")
162fi
163AC_SUBST([LIBTASN1_LIBS])
f163b202 164
3b33116d
SB
165PKG_CHECK_MODULES(
166 [LIBTPMS],
167 [libtpms],
168 ,
169 AC_MSG_ERROR("no libtpms.pc found; please set PKG_CONFIG_PATH to the directory where libtpms.pc is located")
170)
8d086ee9 171LDFLAGS="$LDFLAGS $LIBTPMS_LIBS"
b4374c33 172CFLAGS="$CFLAGS $LIBTPMS_CFLAGS"
fbc596ab 173AC_CHECK_LIB(tpms,
b78b6af2 174 TPMLIB_ChooseTPMVersion,[true],
fbc596ab
SB
175 AC_MSG_ERROR("libtpms 0.6 or later is required")
176)
baecda40 177AC_SUBST([LIBTPMS_LIBS])
f163b202 178
5478de0a
SB
179AC_CHECK_LIB(c, clock_gettime, LIBRT_LIBS="", LIBRT_LIBS="-lrt")
180AC_SUBST([LIBRT_LIBS])
181
cc410ca9
SB
182AC_PATH_PROG([TCSD], tcsd)
183if test "x$TCSD" = "x"; then
64faf455 184 have_tcsd=no
cc410ca9 185 AC_MSG_WARN([tcsd could not be found; typically need it for tss user account and tests])
ef606d4a
SB
186else
187 have_tcsd=yes
188fi
64faf455 189AM_CONDITIONAL([HAVE_TCSD], test "$have_tcsd" != "no")
e46a2b66 190
5cd844d0
SB
191dnl If we have the tcsd package, we can build swtpm_setup, but need netstat also
192AC_PATH_PROG([NETSTAT], [netstat])
193case $host_os in
194linux-*)
609dfd87 195 if test "x$NETSTAT" = "x" && test "$have_tcsd" != "no"; then
64faf455 196 AC_MSG_ERROR([netstat tool is missing for tests: net-tools package])
5cd844d0
SB
197 fi
198 ;;
199esac
200
09d1a532
SB
201AC_MSG_CHECKING([for whether to build with CUSE interface])
202AC_ARG_WITH([cuse],
203 AC_HELP_STRING([--with-cuse],
204 [build with CUSE interface]),
205 [],
206 [with_cuse=check]
207)
f163b202 208
09d1a532
SB
209if test "$with_cuse" != "no"; then
210 LIBFUSE_CFLAGS=$(pkg-config fuse --cflags 2>/dev/null)
211 if test $? -ne 0; then
212 if test "$with_cuse" = "yes"; then
213 AC_MSG_ERROR("Is fuse-devel installed? -- could not get cflags for libfuse")
214 else
215 with_cuse=no
216 fi
217 else
218 with_cuse=yes
219 fi
498433f7 220fi
09d1a532
SB
221
222dnl with_cuse is now yes or no
223if test "$with_cuse" != "no"; then
224 LIBFUSE_LIBS=$(pkg-config fuse --libs)
225 if test $? -ne 0; then
226 AC_MSG_ERROR("Is fuse-devel installed? -- could not get libs for libfuse")
227 fi
228 AC_SUBST([LIBFUSE_CFLAGS])
229 AC_SUBST([LIBFUSE_LIBS])
230 AC_DEFINE_UNQUOTED([WITH_CUSE], 1,
231 [whether to build with CUSE interface])
ebf1557d
SB
232
233 GLIB_CFLAGS=$(pkg-config --cflags glib-2.0)
234 if test $? -ne 0; then
235 AC_MSG_ERROR("Is glib-2.0 installed? -- could not get cflags")
236 fi
237 AC_SUBST([GLIB_CFLAGS])
238
239 GLIB_LIBS=$(pkg-config --libs glib-2.0)
240 if test $? -ne 0; then
241 AC_MSG_ERROR("Is glib-2.0 installed? -- could not get libs")
242 fi
243 AC_SUBST([GLIB_LIBS])
244
245 GTHREAD_LIBS=$(pkg-config --libs gthread-2.0)
246 if test $? -ne 0; then
247 AC_MSG_ERROR("Is glib-2.0 installed? -- could not get libs for gthread-2.0")
248 fi
249 AC_SUBST([GTHREAD_LIBS])
baecda40 250fi
09d1a532
SB
251AM_CONDITIONAL([WITH_CUSE],[test "$with_cuse" = "yes"])
252AC_MSG_RESULT($with_cuse)
f163b202 253
498433f7
SB
254AC_MSG_CHECKING([for whether to build with chardev interface])
255case $host_os in
256linux-*)
257 with_chardev=yes
258 AC_DEFINE_UNQUOTED([WITH_CHARDEV], 1,
259 [whether to build with chardev interface])
260 ;;
261*)
262 with_chardev=no
263esac
264AM_CONDITIONAL([WITH_CHARDEV],[test "$with_chardev" = "yes"])
265AC_MSG_RESULT($with_cuse)
266
10002933
SB
267AC_ARG_WITH([gnutls],
268 AC_HELP_STRING([--with-gnutls],
269 [build with gnutls library]),
270 [],
271 [with_gnutls=check]
272)
273
e46a2b66
SB
274if test "x$with_gnutls" != "xno"; then
275 GNUTLS_LDFLAGS=$(pkg-config --libs gnutls)
276 if test $? -ne 0; then
33be7be2 277 if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
278 AC_MSG_ERROR("Is gnutls installed? -- could not get libs for gnutls")
279 else
280 with_gnutls=no
281 fi
282 fi
283fi
f163b202 284
1828edee
SB
285if test "x$with_gnutls" != "xno"; then
286 AC_PATH_PROG([GNUTLS_CERTTOOL], certtool)
33be7be2
SB
287 if test "x$GNUTLS_CERTTOOL" = "x"; then
288 if test "x$with_gnutls" = "xyes"; then
1828edee
SB
289 AC_MSG_ERROR("Could not find certtool. Is gnutls-utils/gnutls-bin installed?")
290 else
291 with_gnutls=no
292 fi
293 fi
294fi
295
e46a2b66 296if test "x$with_gnutls" != "xno"; then
571a8eed 297 ORIG_CFLAGS="$CFLAGS"
baecda40 298 GNUTLS_CFLAGS=$(pkg-config gnutls --cflags)
571a8eed 299 CFLAGS="$CFLAGS $GNUTLS_CFLAGS $GNUTLS_LDFLAGS"
10002933 300 AC_CHECK_LIB([gnutls], [gnutls_load_file], [
baecda40
SB
301 GNUTLS_LIBS=-lgnutls
302 ],
33be7be2 303 [if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
304 AC_MSG_ERROR([GNUTLS >= 3.1.0 library not found: libgnutls.so])
305 else
306 with_gnutls="no"
307 fi])
571a8eed 308 CFLAGS="$ORIG_CFLAGS"
e46a2b66
SB
309fi
310
311if test "x$with_gnutls" != "xno"; then
571a8eed
SB
312 ORIG_CFLAGS="$CFLAGS"
313 CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
e46a2b66 314 AC_CHECK_HEADER(gnutls/abstract.h, [], \
33be7be2 315 [if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
316 AC_MSG_ERROR([GNUTLS >= 3.1.0 library header not found: gnutls/abstract.h])
317 else
318 with_gnutls="no"
319 fi])
571a8eed 320 CFLAGS="$ORIG_CFLAGS"
e46a2b66
SB
321fi
322
323if test "x$with_gnutls" != "xno"; then
324 with_gnutls="yes"
325fi
33be7be2 326AM_CONDITIONAL([WITH_GNUTLS], [test "x$with_gnutls" = "xyes"])
baecda40 327AC_SUBST([GNUTLS_LIBS])
f163b202 328
48abfbb1 329AC_PATH_PROG([EXPECT], expect)
33be7be2 330if test "x$EXPECT" = "x"; then
48abfbb1
SB
331 AC_MSG_ERROR([expect is required: expect package])
332fi
333
b080afb5 334AC_PATH_PROG([GAWK], gawk)
33be7be2 335if test "x$GAWK" = "x"; then
b080afb5
SB
336 AC_MSG_ERROR([gawk is required: gawk package])
337fi
338
8cb126e4 339AC_PATH_PROG([SOCAT], socat)
33be7be2 340if test "x$SOCAT" = "x"; then
8cb126e4
SB
341 AC_MSG_ERROR([socat is required: socat package])
342fi
343
cc410ca9
SB
344AC_PATH_PROG([BASE64], base64)
345if test "x$BASE64" = "x"; then
346 AC_MSG_ERROR([base64 is required: base64 package])
dbb399de
SB
347fi
348
cc410ca9
SB
349AC_PATH_PROG([CP], cp)
350if test "x$CP" = "x"; then
351 AC_MSG_ERROR([cp is required])
352fi
353
354AM_PATH_PYTHON([3.3])
355
356AC_PATH_PROG([PIP3], pip3)
357if test "x$PIP3" = "x"; then
358 AC_PATH_PROG([PIP3], pip)
359 if test "x$PIP3" = "x"; then
fdaa6f1f 360 AC_MSG_WARN([pip3 is required to uninstall the built package])
cc410ca9
SB
361 else
362 AC_MSG_WARN([Using pip as pip3 tool])
363 fi
364fi
365
366AC_MSG_CHECKING([for python setuptools package])
367$PYTHON -c "import setuptools"
368AS_IF([ test $? = 0 ],
369 [AC_MSG_RESULT([yes])],
370 [AC_MSG_ERROR([python setuptools is required])])
371
372AC_MSG_CHECKING([for python cryptography package])
373$PYTHON -c "import cryptography"
374AS_IF([ test $? = 0 ],
375 [AC_MSG_RESULT([yes])],
376 [AC_MSG_ERROR([python setuptools is required])])
377
3dafa38e
JW
378AC_ARG_ENABLE([python-installation],
379 AS_HELP_STRING([--disable-python-installation], [Disable running setup.py install for swtpm_setup]))
380AM_CONDITIONAL([PYTHON_INSTALLATION], [test "x$enable_python_installation" != "xno"])
381
5eeea357
SB
382AC_ARG_ENABLE([hardening],
383 AS_HELP_STRING([--disable-hardening], [Disable hardening flags]))
a76b4eeb 384
5eeea357
SB
385if test "x$enable_hardening" != "xno"; then
386 TMP="$($CC -fstack-protector-strong $srcdir/include/swtpm/tpm_ioctl.h 2>&1)"
387 if echo $TMP | $GREP 'unrecognized command line option' >/dev/null; then
388 HARDENING_CFLAGS="-fstack-protector -Wstack-protector "
389 else
390 HARDENING_CFLAGS="-fstack-protector-strong -Wstack-protector "
391 fi
392
393 dnl Must not have -O0 but must have a -O for -D_FORTIFY_SOURCE=2
394 TMP1="$(echo $CFLAGS | sed -n 's/.*\(-O0\).*/\1/p')"
395 TMP2="$(echo $CFLAGS | sed -n 's/.*\(-O\).*/\1/p')"
396 if test -z "$TMP1" && test -n "$TPM2"; then
397 HARDENING_CFLAGS="$HARDENING_CFLAGS -D_FORTIFY_SOURCE=2 "
398 fi
b381e1eb
SB
399 dnl Check linker for 'relro' and 'now'
400 save_CFLAGS="$CFLAGS"
401 CFLAGS="-Wl,-z,relro -Werror"
402 AC_MSG_CHECKING([whether linker supports -Wl,-z,relro])
2ba23cee 403 AC_LINK_IFELSE(
b381e1eb 404 [AC_LANG_SOURCE([[int main() { return 0; }]])],
0586d2f5 405 [HARDENING_LDFLAGS="$HARDENING_LDFLAGS -Wl,-z,relro"
b381e1eb
SB
406 AC_MSG_RESULT(yes)],
407 [AC_MSG_RESULT(no)]
408 )
409 CFLAGS="-Wl,-z,now -Werror"
410 AC_MSG_CHECKING([whether linker supports -Wl,-z,now])
2ba23cee 411 AC_LINK_IFELSE(
b381e1eb 412 [AC_LANG_SOURCE([[int main() { return 0; }]])],
0586d2f5 413 [HARDENING_LDFLAGS="$HARDENING_LDFLAGS -Wl,-z,now"
b381e1eb
SB
414 AC_MSG_RESULT(yes)],
415 [AC_MSG_RESULT(no)]
416 )
417 CFLAGS="$save_CFLAGS"
5eeea357 418 AC_SUBST([HARDENING_CFLAGS])
0586d2f5 419 AC_SUBST([HARDENING_LDFLAGS])
a76b4eeb 420fi
e6085e96 421
b8421f3d
SB
422AC_ARG_ENABLE([test-coverage],
423 AS_HELP_STRING([--enable-test-coverage], [Enable test coverage flags]))
424
425if test "x$enable_test_coverage" = "xyes"; then
426 COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
427 COVERAGE_LDFLAGS="-fprofile-arcs"
428fi
429
c4ac0a11
SB
430AC_ARG_WITH([tss-user],
431 AC_HELP_STRING([--with-tss-user=TSS_USER],
432 [The tss user to use]),
433 [TSS_USER="$withval"],
434 [TSS_USER="tss"]
435)
436
437AC_ARG_WITH([tss-group],
438 AC_HELP_STRING([--with-tss-group=TSS_GROUP],
439 [The tss group to use]),
440 [TSS_GROUP="$withval"],
441 [TSS_GROUP="tss"]
442)
aa88eebe
SB
443
444case $have_tcsd in
445yes)
446 AC_MSG_CHECKING([whether TSS_USER $TSS_USER is available])
447 if ! test $(id -u $TSS_USER); then
448 AC_MSG_ERROR(["$TSS_USER is not available"])
449 else
450 AC_MSG_RESULT([yes])
451 fi
452 AC_MSG_CHECKING([whether TSS_GROUP $TSS_GROUP is available])
453 if ! test $(id -g $TSS_GROUP); then
454 AC_MSG_ERROR(["$TSS_GROUP is not available"])
455 else
456 AC_MSG_RESULT([yes])
457 fi
458 ;;
459esac
460
c4ac0a11
SB
461AC_SUBST([TSS_USER])
462AC_SUBST([TSS_GROUP])
463
f163b202
SB
464CFLAGS="$CFLAGS -Wreturn-type -Wsign-compare -Wswitch-enum"
465CFLAGS="$CFLAGS -Wmissing-prototypes -Wall -Werror"
e6085e96 466CFLAGS="$CFLAGS -Wformat -Wformat-security"
b8421f3d
SB
467CFLAGS="$CFLAGS $GNUTLS_CFLAGS $COVERAGE_CFLAGS"
468
469LDFLAGS="$LDFLAGS $COVERAGE_LDFLAGS"
f163b202 470
f2458ef7
SB
471dnl Simulate the following for systems with pkg-config < 0.28:
472dnl PKG_CHECK_VAR([libtpms_cryptolib], [libtpms], [cryptolib],
473dnl [], AC_MSG_ERROR([Could not determine libtpms crypto library.]))
474PKG_PROG_PKG_CONFIG
475
476AC_MSG_CHECKING([Checking the crypto library libtpms is linked to])
477libtpms_cryptolib=`$PKG_CONFIG --variable cryptolib libtpms`
33be7be2 478if test "x$libtpms_cryptolib" = "x"; then
b4374c33
JB
479 AC_MSG_WARN([Could not determine the crypto library libtpms is using, assuming ${cryptolib}])
480 libtpms_cryptolib=${cryptolib}
f2458ef7
SB
481fi
482AC_MSG_RESULT($libtpms_cryptolib)
86cc4527
SB
483
484if test "$libtpms_cryptolib" != "$cryptolib"; then
485 echo "libtpms is using $libtpms_cryptolib; we have to use the same"
33be7be2 486 if test "$cryptolib" = "openssl"; then
86cc4527
SB
487 AC_MSG_ERROR([do not use --with-openssl])
488 else
489 AC_MSG_ERROR([use --with-openssl])
490 fi
491fi
492
c751e32e
SB
493with_vtpm_proxy=no
494case $host_os in
f071d820 495linux-*)
c751e32e
SB
496 with_vtpm_proxy=yes
497 AC_DEFINE_UNQUOTED([WITH_VTPM_PROXY], 1,
498 [whether to build in vTPM proxy support (Linux only)])
499esac
500
6286beac
SB
501case $host_os in
502cygwin)
503 CFLAGS="$CFLAGS -D__USE_LINUX_IOCTL_DEFS"
504esac
505
761df6cd
SB
506dnl Seccomp profile using -lseccomp (Linux only)
507case $host_os in
508linux-*)
509 with_seccomp_default=yes
510 ;;
511*)
512 with_seccomp_default=no
513 ;;
514esac
515
516AC_MSG_CHECKING([for whether to build with seccomp profile])
517AC_ARG_WITH([seccomp],
518 AC_HELP_STRING([--with-seccomp],
519 [build with seccomp profile]),
0232f78f 520 AC_MSG_RESULT([$with_seccomp]),
761df6cd 521 [with_seccomp=$with_seccomp_default]
0232f78f 522 AC_MSG_RESULT([$with_seccomp])
761df6cd
SB
523)
524
525if test "$with_seccomp" != "no"; then
526 LIBSECCOMP_CFLAGS=$(pkg-config libseccomp --cflags 2>/dev/null)
527 if test $? -ne 0; then
528 AC_MSG_ERROR("Is libseccomp-devel installed? -- could not get cflags for libseccomp")
529 else
530 with_libseccomp=yes
531 fi
532 LIBSECCOMP_LIBS=$(pkg-config --libs libseccomp)
533 AC_SUBST([LIBSECCOMP_LIBS])
534 AC_SUBST([LIBSECCOMP_CFLAGS])
535 AC_DEFINE_UNQUOTED([WITH_SECCOMP], 1,
536 [whether to build in seccomp profile (Linux only)])
537fi
538
44b92d43
SB
539AC_CONFIG_FILES([Makefile \
540 debian/swtpm-tools.postinst \
f163b202 541 dist/swtpm.spec \
e46a2b66 542 etc/Makefile \
0432b653 543 etc/swtpm_setup.conf \
e46a2b66 544 samples/Makefile \
b71da430 545 samples/py_swtpm_localca/swtpm_localca_conf.py \
d16b86b7 546 samples/swtpm-localca.conf \
a12b09b1 547 samples/swtpm-create-user-config-files \
f163b202
SB
548 include/Makefile \
549 include/swtpm/Makefile \
a1fa5d77 550 include/swtpm.h \
f163b202
SB
551 src/Makefile \
552 src/selinux/Makefile \
553 src/swtpm/Makefile \
e46a2b66
SB
554 src/swtpm_bios/Makefile \
555 src/swtpm_cert/Makefile \
556 src/swtpm_ioctl/Makefile \
557 src/swtpm_setup/Makefile \
eee8cb5d 558 src/swtpm_setup/py_swtpm_setup/swtpm_setup_conf.py \
f163b202 559 man/Makefile \
39d0c3de 560 man/man3/Makefile \
f163b202 561 man/man8/Makefile \
e46a2b66 562 tests/Makefile \
c4ac0a11 563 tests/test_config \
10002933 564 ])
0432b653
SB
565AC_CONFIG_FILES([samples/swtpm-localca],
566 [chmod 755 samples/swtpm-localca])
3064a72f
SB
567AC_CONFIG_FILES([src/swtpm_setup/swtpm_setup],
568 [chmod 755 src/swtpm_setup/swtpm_setup])
cc410ca9 569dnl for out-of-tree builds:
3064a72f 570AC_CONFIG_LINKS([src/swtpm_setup/py_swtpm_setup/__init__.py:src/swtpm_setup/py_swtpm_setup/__init__.py \
cc410ca9
SB
571 src/swtpm_setup/py_swtpm_setup/swtpm.py:src/swtpm_setup/py_swtpm_setup/swtpm.py \
572 src/swtpm_setup/py_swtpm_setup/swtpm_utils.py:src/swtpm_setup/py_swtpm_setup/swtpm_utils.py \
573 src/swtpm_setup/py_swtpm_setup/swtpm_setup.py:src/swtpm_setup/py_swtpm_setup/swtpm_setup.py])
b71da430
SB
574AC_CONFIG_LINKS([samples/py_swtpm_localca/__init__.py:samples/py_swtpm_localca/__init__.py \
575 samples/py_swtpm_localca/swtpm_localca.py:samples/py_swtpm_localca/swtpm_localca.py \
576 samples/py_swtpm_localca/swtpm_utils.py:samples/py_swtpm_localca/swtpm_utils.py])
f163b202
SB
577AC_OUTPUT
578
e46a2b66 579echo
c3fdf688 580printf "with_gnutls : %5s (no = swtpm_cert will NOT be built)\n" $with_gnutls
040c7097 581printf "with_selinux : %5s (no = SELinux policy extensions will NOT be built)\n" $with_selinux
c3fdf688 582printf "with_cuse : %5s (no = no CUSE interface)\n" $with_cuse
498433f7 583printf "with_chardev : %5s (no = no chardev interface)\n" $with_chardev
c751e32e 584printf "with_vtpm_proxy : %5s (no = no vtpm proxy support; Linux only)\n" $with_vtpm_proxy
761df6cd 585printf "with_seccomp : %5s (no = no seccomp profile; Linux only)\n" $with_seccomp
e46a2b66 586echo
040c7097
SB
587echo "Version to build : $PACKAGE_VERSION"
588echo "Crypto library : $cryptolib"
10002933 589echo
f163b202 590echo "CFLAGS=$CFLAGS"
a76b4eeb 591echo "HARDENING_CFLAGS=$HARDENING_CFLAGS"
0586d2f5 592echo "HARDENING_LDFLAGS=$HARDENING_LDFLAGS"
f163b202 593echo "LDFLAGS=$LDFLAGS"
761df6cd 594echo "LIBSECCOMP_LIBS=$LIBSECCOMP_LIBS"
c4ac0a11
SB
595echo
596echo "TSS_USER=$TSS_USER"
597echo "TSS_GROUP=$TSS_GROUP"
598echo