]> git.proxmox.com Git - swtpm.git/blame - configure.ac
configure: Fix typo TPM2 -> TMP2
[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
b295c768
TK
26AC_INIT([swtpm],[0.7.0])
27AC_PREREQ([2.69])
f163b202 28AC_CONFIG_SRCDIR(Makefile.am)
b295c768 29AC_CONFIG_HEADERS([config.h])
f163b202
SB
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])
b295c768 53AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[create a debug build]),
f163b202
SB
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_C_CONST
77AC_C_INLINE
78
79AC_TYPE_SIZE_T
e46a2b66 80
baecda40
SB
81AC_PROG_CC
82AC_PROG_INSTALL
3cb54a5d 83AC_PROG_MKDIR_P
e46a2b66 84
ec37bb56
SB
85AC_ARG_WITH([selinux],
86 AS_HELP_STRING([--with-selinux],
87 [add SELinux policy extensions @<:@default=check@:>@]))
88m4_divert_text([DEFAULTS], [with_selinux=check])
89
90dnl Check for SELinux policy support
91
92if test "$with_selinux" != "no"; then
93 if test "$with_selinux" = "check" || test "$with_selinux" = "yes"; then
94 if ! test -f /usr/share/selinux/devel/Makefile; then
95 if test "$with_selinux" = "yes"; then
96 AC_MSG_ERROR("Is selinux-policy-devel installed?")
97 else
98 with_selinux="no"
99 fi
100 fi
101 AC_PATH_PROG([SEMODULE], semodule)
33be7be2 102 if test "x$SEMODULE" = "x"; then
ec37bb56
SB
103 if test "$with_selinux" = "yes"; then
104 AC_MSG_ERROR("Is selinux-policy-devel installed?")
105 else
106 with_selinux="no"
107 fi
108 fi
109 if test "$with_selinux" = "check"; then
110 with_selinux="yes"
111 fi
112 fi
113fi
33be7be2 114AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"])
ec37bb56 115
b096be26
SB
116if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc'; then
117 sysconfdir="/etc"
118fi
119if test "$prefix" = "" && test "$datarootdir" = '${prefix}/share'; then
120 datarootdir="/usr/share"
121fi
d16b86b7
SB
122if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var'; then
123 localstatedir="/var"
124fi
5d35321e
SB
125if test "x$prefix" = "xNONE"; then
126 prefix="/usr/local"
127fi
0432b653
SB
128SYSCONFDIR=`eval echo $sysconfdir`
129DATAROOTDIR=`eval echo $datarootdir`
d16b86b7 130LOCALSTATEDIR=`eval echo $localstatedir`
0432b653
SB
131AC_SUBST([SYSCONFDIR])
132AC_SUBST([DATAROOTDIR])
d16b86b7 133AC_SUBST([LOCALSTATEDIR])
b096be26 134
7849b6c6 135cryptolib=openssl
3bbdd7bc
SB
136
137AC_ARG_WITH([openssl],
7849b6c6
SB
138 [AS_HELP_STRING([--with-openssl],
139 [build with openssl library])],
140 [],
141 [])
3bbdd7bc
SB
142
143case "$cryptolib" in
3bbdd7bc 144openssl)
7849b6c6
SB
145 AC_CHECK_LIB(crypto,
146 [AES_set_encrypt_key],
b78b6af2 147 [true],
7849b6c6
SB
148 AC_MSG_ERROR(Faulty openssl crypto library))
149 AC_CHECK_HEADERS([openssl/aes.h],[],
150 AC_MSG_ERROR(Is openssl-devel/libssl-dev installed?))
151 AC_MSG_RESULT([Building with openssl crypto library])
0371b63b
SB
152 LIBCRYPTO_LIBS=$(pkg-config --libs libcrypto)
153 AC_SUBST([LIBCRYPTO_LIBS])
7849b6c6 154 ;;
3bbdd7bc 155esac
833a5416 156
baecda40
SB
157LIBTASN1_LIBS=$(pkg-config --libs libtasn1)
158if test $? -ne 0; then
159 AC_MSG_ERROR("Is libtasn1-devel installed? -- could not get libs for libtasn1")
160fi
161AC_SUBST([LIBTASN1_LIBS])
f163b202 162
3b33116d
SB
163PKG_CHECK_MODULES(
164 [LIBTPMS],
165 [libtpms],
166 ,
167 AC_MSG_ERROR("no libtpms.pc found; please set PKG_CONFIG_PATH to the directory where libtpms.pc is located")
168)
8d086ee9 169LDFLAGS="$LDFLAGS $LIBTPMS_LIBS"
b4374c33 170CFLAGS="$CFLAGS $LIBTPMS_CFLAGS"
fbc596ab 171AC_CHECK_LIB(tpms,
b78b6af2 172 TPMLIB_ChooseTPMVersion,[true],
fbc596ab
SB
173 AC_MSG_ERROR("libtpms 0.6 or later is required")
174)
baecda40 175AC_SUBST([LIBTPMS_LIBS])
f163b202 176
5478de0a
SB
177AC_CHECK_LIB(c, clock_gettime, LIBRT_LIBS="", LIBRT_LIBS="-lrt")
178AC_SUBST([LIBRT_LIBS])
179
cc410ca9
SB
180AC_PATH_PROG([TCSD], tcsd)
181if test "x$TCSD" = "x"; then
64faf455 182 have_tcsd=no
cc410ca9 183 AC_MSG_WARN([tcsd could not be found; typically need it for tss user account and tests])
ef606d4a
SB
184else
185 have_tcsd=yes
186fi
64faf455 187AM_CONDITIONAL([HAVE_TCSD], test "$have_tcsd" != "no")
e46a2b66 188
d4c60e44 189dnl We either need netstat (more common across systems) or 'ss' for test cases
5cd844d0 190AC_PATH_PROG([NETSTAT], [netstat])
d4c60e44
SB
191if test "x$NETSTAT" = "x"; then
192 AC_PATH_PROG([SS], [ss])
193 if test "x$SS" = "x"; then
194 AC_MSG_ERROR(['netstat' and 'ss' tools are missing for tests: net-tools OR iproute/iproute2 package])
195 fi
196fi
5cd844d0 197
09d1a532
SB
198AC_MSG_CHECKING([for whether to build with CUSE interface])
199AC_ARG_WITH([cuse],
b295c768 200 AS_HELP_STRING([--with-cuse],[build with CUSE interface]),
09d1a532
SB
201 [],
202 [with_cuse=check]
203)
f163b202 204
09d1a532
SB
205if test "$with_cuse" != "no"; then
206 LIBFUSE_CFLAGS=$(pkg-config fuse --cflags 2>/dev/null)
207 if test $? -ne 0; then
208 if test "$with_cuse" = "yes"; then
209 AC_MSG_ERROR("Is fuse-devel installed? -- could not get cflags for libfuse")
210 else
211 with_cuse=no
212 fi
213 else
214 with_cuse=yes
215 fi
498433f7 216fi
09d1a532 217
c125e34b
SB
218JSON_GLIB_CFLAGS=$(pkg-config --cflags json-glib-1.0)
219if test $? -ne 0; then
220 AC_MSG_ERROR("Is libjson-glib-dev/json-glib-devel installed? -- could not get cflags")
221fi
222AC_SUBST([JSON_GLIB_CFLAGS])
223
224JSON_GLIB_LIBS=$(pkg-config --libs json-glib-1.0)
225if test $? -ne 0; then
226 AC_MSG_ERROR("Is libjson-glib-dev/json-glib-devel installed? -- could not get libs")
227fi
228AC_SUBST([JSON_GLIB_LIBS])
229
230GLIB_CFLAGS=$(pkg-config --cflags glib-2.0)
231if test $? -ne 0; then
232 AC_MSG_ERROR("Is libglib-2.0-dev/glib2-devel installed? -- could not get cflags")
233fi
234AC_SUBST([GLIB_CFLAGS])
235
236GLIB_LIBS=$(pkg-config --libs glib-2.0)
237if test $? -ne 0; then
238 AC_MSG_ERROR("Is libglib-2.0-dev/glib2-devel installed? -- could not get cflags")
239fi
240AC_SUBST([GLIB_LIBS])
241
09d1a532
SB
242dnl with_cuse is now yes or no
243if test "$with_cuse" != "no"; then
244 LIBFUSE_LIBS=$(pkg-config fuse --libs)
245 if test $? -ne 0; then
246 AC_MSG_ERROR("Is fuse-devel installed? -- could not get libs for libfuse")
247 fi
248 AC_SUBST([LIBFUSE_CFLAGS])
249 AC_SUBST([LIBFUSE_LIBS])
250 AC_DEFINE_UNQUOTED([WITH_CUSE], 1,
251 [whether to build with CUSE interface])
ebf1557d 252
ebf1557d
SB
253 GTHREAD_LIBS=$(pkg-config --libs gthread-2.0)
254 if test $? -ne 0; then
255 AC_MSG_ERROR("Is glib-2.0 installed? -- could not get libs for gthread-2.0")
256 fi
257 AC_SUBST([GTHREAD_LIBS])
baecda40 258fi
09d1a532
SB
259AM_CONDITIONAL([WITH_CUSE],[test "$with_cuse" = "yes"])
260AC_MSG_RESULT($with_cuse)
f163b202 261
498433f7
SB
262AC_MSG_CHECKING([for whether to build with chardev interface])
263case $host_os in
264linux-*)
265 with_chardev=yes
266 AC_DEFINE_UNQUOTED([WITH_CHARDEV], 1,
267 [whether to build with chardev interface])
268 ;;
269*)
270 with_chardev=no
271esac
272AM_CONDITIONAL([WITH_CHARDEV],[test "$with_chardev" = "yes"])
273AC_MSG_RESULT($with_cuse)
274
10002933 275AC_ARG_WITH([gnutls],
b295c768 276 AS_HELP_STRING([--with-gnutls],[build with gnutls library]),
10002933
SB
277 [],
278 [with_gnutls=check]
279)
280
e46a2b66
SB
281if test "x$with_gnutls" != "xno"; then
282 GNUTLS_LDFLAGS=$(pkg-config --libs gnutls)
283 if test $? -ne 0; then
33be7be2 284 if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
285 AC_MSG_ERROR("Is gnutls installed? -- could not get libs for gnutls")
286 else
287 with_gnutls=no
288 fi
289 fi
290fi
f163b202 291
1828edee 292if test "x$with_gnutls" != "xno"; then
e9fd0142
SB
293 AC_PATH_PROG([GNUTLS_CERTTOOL], certtool)
294 if test "x$GNUTLS_CERTTOOL" = "x"; then
295 if test "x$with_gnutls" = "xyes"; then
296 AC_MSG_ERROR("Could not find certtool. Is gnutls-utils/gnutls-bin installed?")
297 else
298 with_gnutls=no
299 fi
300 fi
301 dnl certtool changed how it takes private key passwords
302 dnl 3.3.29 is too old (RHEL 7); we need at least gnutls 3.4.0
303 AC_MSG_CHECKING([for gnutls 3.4.0 or later])
304 $(pkg-config gnutls --atleast-version=3.4.0)
305 if test $? -ne 0; then
306 AC_MSG_ERROR([gnutls 3.4.0 is required])
307 fi
308 AC_MSG_RESULT([yes])
1828edee
SB
309fi
310
e46a2b66 311if test "x$with_gnutls" != "xno"; then
571a8eed 312 ORIG_CFLAGS="$CFLAGS"
baecda40 313 GNUTLS_CFLAGS=$(pkg-config gnutls --cflags)
571a8eed 314 CFLAGS="$CFLAGS $GNUTLS_CFLAGS $GNUTLS_LDFLAGS"
10002933 315 AC_CHECK_LIB([gnutls], [gnutls_load_file], [
baecda40
SB
316 GNUTLS_LIBS=-lgnutls
317 ],
33be7be2 318 [if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
319 AC_MSG_ERROR([GNUTLS >= 3.1.0 library not found: libgnutls.so])
320 else
321 with_gnutls="no"
322 fi])
571a8eed 323 CFLAGS="$ORIG_CFLAGS"
e46a2b66
SB
324fi
325
326if test "x$with_gnutls" != "xno"; then
571a8eed
SB
327 ORIG_CFLAGS="$CFLAGS"
328 CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
e46a2b66 329 AC_CHECK_HEADER(gnutls/abstract.h, [], \
33be7be2 330 [if test "x$with_gnutls" = "xyes"; then
e46a2b66
SB
331 AC_MSG_ERROR([GNUTLS >= 3.1.0 library header not found: gnutls/abstract.h])
332 else
333 with_gnutls="no"
334 fi])
571a8eed 335 CFLAGS="$ORIG_CFLAGS"
e46a2b66
SB
336fi
337
338if test "x$with_gnutls" != "xno"; then
339 with_gnutls="yes"
340fi
33be7be2 341AM_CONDITIONAL([WITH_GNUTLS], [test "x$with_gnutls" = "xyes"])
baecda40 342AC_SUBST([GNUTLS_LIBS])
f163b202 343
48abfbb1 344AC_PATH_PROG([EXPECT], expect)
33be7be2 345if test "x$EXPECT" = "x"; then
48abfbb1
SB
346 AC_MSG_ERROR([expect is required: expect package])
347fi
348
b080afb5 349AC_PATH_PROG([GAWK], gawk)
33be7be2 350if test "x$GAWK" = "x"; then
b080afb5
SB
351 AC_MSG_ERROR([gawk is required: gawk package])
352fi
353
8cb126e4 354AC_PATH_PROG([SOCAT], socat)
33be7be2 355if test "x$SOCAT" = "x"; then
8cb126e4
SB
356 AC_MSG_ERROR([socat is required: socat package])
357fi
358
cc410ca9
SB
359AC_PATH_PROG([BASE64], base64)
360if test "x$BASE64" = "x"; then
361 AC_MSG_ERROR([base64 is required: base64 package])
dbb399de
SB
362fi
363
cc410ca9
SB
364AC_PATH_PROG([CP], cp)
365if test "x$CP" = "x"; then
366 AC_MSG_ERROR([cp is required])
367fi
368
369AM_PATH_PYTHON([3.3])
370
371AC_PATH_PROG([PIP3], pip3)
372if test "x$PIP3" = "x"; then
373 AC_PATH_PROG([PIP3], pip)
374 if test "x$PIP3" = "x"; then
fdaa6f1f 375 AC_MSG_WARN([pip3 is required to uninstall the built package])
cc410ca9
SB
376 else
377 AC_MSG_WARN([Using pip as pip3 tool])
378 fi
379fi
380
5eeea357
SB
381AC_ARG_ENABLE([hardening],
382 AS_HELP_STRING([--disable-hardening], [Disable hardening flags]))
a76b4eeb 383
5eeea357
SB
384if test "x$enable_hardening" != "xno"; then
385 TMP="$($CC -fstack-protector-strong $srcdir/include/swtpm/tpm_ioctl.h 2>&1)"
386 if echo $TMP | $GREP 'unrecognized command line option' >/dev/null; then
387 HARDENING_CFLAGS="-fstack-protector -Wstack-protector "
388 else
389 HARDENING_CFLAGS="-fstack-protector-strong -Wstack-protector "
390 fi
391
392 dnl Must not have -O0 but must have a -O for -D_FORTIFY_SOURCE=2
393 TMP1="$(echo $CFLAGS | sed -n 's/.*\(-O0\).*/\1/p')"
394 TMP2="$(echo $CFLAGS | sed -n 's/.*\(-O\).*/\1/p')"
502cb112 395 if test -z "$TMP1" && test -n "$TMP2"; then
5eeea357
SB
396 HARDENING_CFLAGS="$HARDENING_CFLAGS -D_FORTIFY_SOURCE=2 "
397 fi
b381e1eb
SB
398 dnl Check linker for 'relro' and 'now'
399 save_CFLAGS="$CFLAGS"
400 CFLAGS="-Wl,-z,relro -Werror"
401 AC_MSG_CHECKING([whether linker supports -Wl,-z,relro])
2ba23cee 402 AC_LINK_IFELSE(
b381e1eb 403 [AC_LANG_SOURCE([[int main() { return 0; }]])],
0586d2f5 404 [HARDENING_LDFLAGS="$HARDENING_LDFLAGS -Wl,-z,relro"
b381e1eb
SB
405 AC_MSG_RESULT(yes)],
406 [AC_MSG_RESULT(no)]
407 )
408 CFLAGS="-Wl,-z,now -Werror"
409 AC_MSG_CHECKING([whether linker supports -Wl,-z,now])
2ba23cee 410 AC_LINK_IFELSE(
b381e1eb 411 [AC_LANG_SOURCE([[int main() { return 0; }]])],
0586d2f5 412 [HARDENING_LDFLAGS="$HARDENING_LDFLAGS -Wl,-z,now"
b381e1eb
SB
413 AC_MSG_RESULT(yes)],
414 [AC_MSG_RESULT(no)]
415 )
416 CFLAGS="$save_CFLAGS"
5eeea357 417 AC_SUBST([HARDENING_CFLAGS])
0586d2f5 418 AC_SUBST([HARDENING_LDFLAGS])
a76b4eeb 419fi
e6085e96 420
b8421f3d
SB
421AC_ARG_ENABLE([test-coverage],
422 AS_HELP_STRING([--enable-test-coverage], [Enable test coverage flags]))
423
424if test "x$enable_test_coverage" = "xyes"; then
425 COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
426 COVERAGE_LDFLAGS="-fprofile-arcs"
427fi
428
c4ac0a11 429AC_ARG_WITH([tss-user],
b295c768 430 AS_HELP_STRING([--with-tss-user=TSS_USER],[The tss user to use]),
c4ac0a11
SB
431 [TSS_USER="$withval"],
432 [TSS_USER="tss"]
433)
434
435AC_ARG_WITH([tss-group],
b295c768 436 AS_HELP_STRING([--with-tss-group=TSS_GROUP],[The tss group to use]),
c4ac0a11
SB
437 [TSS_GROUP="$withval"],
438 [TSS_GROUP="tss"]
439)
aa88eebe
SB
440
441case $have_tcsd in
442yes)
443 AC_MSG_CHECKING([whether TSS_USER $TSS_USER is available])
444 if ! test $(id -u $TSS_USER); then
445 AC_MSG_ERROR(["$TSS_USER is not available"])
446 else
447 AC_MSG_RESULT([yes])
448 fi
449 AC_MSG_CHECKING([whether TSS_GROUP $TSS_GROUP is available])
450 if ! test $(id -g $TSS_GROUP); then
451 AC_MSG_ERROR(["$TSS_GROUP is not available"])
452 else
453 AC_MSG_RESULT([yes])
454 fi
455 ;;
456esac
457
c4ac0a11
SB
458AC_SUBST([TSS_USER])
459AC_SUBST([TSS_GROUP])
460
f163b202
SB
461CFLAGS="$CFLAGS -Wreturn-type -Wsign-compare -Wswitch-enum"
462CFLAGS="$CFLAGS -Wmissing-prototypes -Wall -Werror"
e6085e96 463CFLAGS="$CFLAGS -Wformat -Wformat-security"
b8421f3d
SB
464CFLAGS="$CFLAGS $GNUTLS_CFLAGS $COVERAGE_CFLAGS"
465
466LDFLAGS="$LDFLAGS $COVERAGE_LDFLAGS"
f163b202 467
f2458ef7
SB
468dnl Simulate the following for systems with pkg-config < 0.28:
469dnl PKG_CHECK_VAR([libtpms_cryptolib], [libtpms], [cryptolib],
470dnl [], AC_MSG_ERROR([Could not determine libtpms crypto library.]))
471PKG_PROG_PKG_CONFIG
472
473AC_MSG_CHECKING([Checking the crypto library libtpms is linked to])
474libtpms_cryptolib=`$PKG_CONFIG --variable cryptolib libtpms`
33be7be2 475if test "x$libtpms_cryptolib" = "x"; then
b4374c33
JB
476 AC_MSG_WARN([Could not determine the crypto library libtpms is using, assuming ${cryptolib}])
477 libtpms_cryptolib=${cryptolib}
f2458ef7
SB
478fi
479AC_MSG_RESULT($libtpms_cryptolib)
86cc4527
SB
480
481if test "$libtpms_cryptolib" != "$cryptolib"; then
482 echo "libtpms is using $libtpms_cryptolib; we have to use the same"
33be7be2 483 if test "$cryptolib" = "openssl"; then
86cc4527
SB
484 AC_MSG_ERROR([do not use --with-openssl])
485 else
486 AC_MSG_ERROR([use --with-openssl])
487 fi
488fi
489
c751e32e
SB
490with_vtpm_proxy=no
491case $host_os in
f071d820 492linux-*)
c751e32e
SB
493 with_vtpm_proxy=yes
494 AC_DEFINE_UNQUOTED([WITH_VTPM_PROXY], 1,
495 [whether to build in vTPM proxy support (Linux only)])
496esac
497
6286beac
SB
498case $host_os in
499cygwin)
500 CFLAGS="$CFLAGS -D__USE_LINUX_IOCTL_DEFS"
501esac
502
761df6cd
SB
503dnl Seccomp profile using -lseccomp (Linux only)
504case $host_os in
505linux-*)
506 with_seccomp_default=yes
507 ;;
508*)
509 with_seccomp_default=no
510 ;;
511esac
512
513AC_MSG_CHECKING([for whether to build with seccomp profile])
514AC_ARG_WITH([seccomp],
b295c768 515 AS_HELP_STRING([--with-seccomp],[build with seccomp profile]),
0232f78f 516 AC_MSG_RESULT([$with_seccomp]),
761df6cd 517 [with_seccomp=$with_seccomp_default]
0232f78f 518 AC_MSG_RESULT([$with_seccomp])
761df6cd
SB
519)
520
521if test "$with_seccomp" != "no"; then
522 LIBSECCOMP_CFLAGS=$(pkg-config libseccomp --cflags 2>/dev/null)
523 if test $? -ne 0; then
524 AC_MSG_ERROR("Is libseccomp-devel installed? -- could not get cflags for libseccomp")
525 else
526 with_libseccomp=yes
527 fi
528 LIBSECCOMP_LIBS=$(pkg-config --libs libseccomp)
529 AC_SUBST([LIBSECCOMP_LIBS])
530 AC_SUBST([LIBSECCOMP_CFLAGS])
531 AC_DEFINE_UNQUOTED([WITH_SECCOMP], 1,
532 [whether to build in seccomp profile (Linux only)])
533fi
534
44b92d43
SB
535AC_CONFIG_FILES([Makefile \
536 debian/swtpm-tools.postinst \
4608cc33 537 swtpm.spec \
e46a2b66 538 etc/Makefile \
0432b653 539 etc/swtpm_setup.conf \
e46a2b66 540 samples/Makefile \
d16b86b7 541 samples/swtpm-localca.conf \
a12b09b1 542 samples/swtpm-create-user-config-files \
e689684c 543 samples/swtpm_localca_conf.h \
f163b202
SB
544 include/Makefile \
545 include/swtpm/Makefile \
a1fa5d77 546 include/swtpm.h \
f163b202
SB
547 src/Makefile \
548 src/selinux/Makefile \
549 src/swtpm/Makefile \
e46a2b66
SB
550 src/swtpm_bios/Makefile \
551 src/swtpm_cert/Makefile \
552 src/swtpm_ioctl/Makefile \
553 src/swtpm_setup/Makefile \
c125e34b
SB
554 src/swtpm_setup/swtpm_setup_conf.h \
555 src/utils/Makefile \
f163b202 556 man/Makefile \
39d0c3de 557 man/man3/Makefile \
f163b202 558 man/man8/Makefile \
e46a2b66 559 tests/Makefile \
c4ac0a11 560 tests/test_config \
10002933 561 ])
f163b202
SB
562AC_OUTPUT
563
e46a2b66 564echo
c3fdf688 565printf "with_gnutls : %5s (no = swtpm_cert will NOT be built)\n" $with_gnutls
040c7097 566printf "with_selinux : %5s (no = SELinux policy extensions will NOT be built)\n" $with_selinux
c3fdf688 567printf "with_cuse : %5s (no = no CUSE interface)\n" $with_cuse
498433f7 568printf "with_chardev : %5s (no = no chardev interface)\n" $with_chardev
c751e32e 569printf "with_vtpm_proxy : %5s (no = no vtpm proxy support; Linux only)\n" $with_vtpm_proxy
761df6cd 570printf "with_seccomp : %5s (no = no seccomp profile; Linux only)\n" $with_seccomp
e46a2b66 571echo
040c7097
SB
572echo "Version to build : $PACKAGE_VERSION"
573echo "Crypto library : $cryptolib"
10002933 574echo
5c5856ea 575echo " CFLAGS = $CFLAGS"
b5701034
SB
576echo " HARDENING_CFLAGS = $HARDENING_CFLAGS"
577echo "HARDENING_LDFLAGS = $HARDENING_LDFLAGS"
5c5856ea 578echo " LDFLAGS = $LDFLAGS"
b5701034
SB
579echo " LIBSECCOMP_LIBS = $LIBSECCOMP_LIBS"
580echo " JSON_GLIB_CFLAGS = $JSON_GLIB_CFLAGS"
581echo " JSON_GLIB_LIBS = $JSON_GLIB_LIBS"
582echo " GLIB_CFLAGS = $GLIB_CFLAGS"
583echo " GLIB_LIBS = $GLIB_LIBS"
c4ac0a11
SB
584echo
585echo "TSS_USER=$TSS_USER"
586echo "TSS_GROUP=$TSS_GROUP"
587echo