Philip Tricca | c054cf9 | 2018-11-11 11:06:00 -0800 | [diff] [blame] | 1 | # SPDX-License-Identifier: BSD-2 |
Philip Tricca | 8ffb654 | 2018-03-04 19:51:53 -0800 | [diff] [blame] | 2 | # Copyright (c) 2015 - 2018 Intel Corporation |
| 3 | # Copyright (c) 2018 Fraunhofer SIT sponsored by Infineon Technologies AG |
| 4 | # All rights reserved. |
Philip Tricca | c054cf9 | 2018-11-11 11:06:00 -0800 | [diff] [blame] | 5 | |
Philip Tricca | 1a94dd8 | 2017-08-16 14:32:55 -0700 | [diff] [blame] | 6 | AC_INIT([tpm2-tss], |
Tadeusz Struk | 2e655bb | 2018-09-25 10:37:16 -0700 | [diff] [blame] | 7 | [2.1.0], |
Philip Tricca | dc1f15d | 2018-03-04 19:53:25 -0800 | [diff] [blame] | 8 | [https://github.com/tpm2-software/tpm2-tss/issues], |
Philip Tricca | d97ed64 | 2017-08-25 14:19:27 -0700 | [diff] [blame] | 9 | [], |
Philip Tricca | dc1f15d | 2018-03-04 19:53:25 -0800 | [diff] [blame] | 10 | [https://github.com/tpm2-software/tpm2-tss]) |
Philip Tricca | a509a68 | 2015-09-14 15:34:52 -0700 | [diff] [blame] | 11 | AC_CONFIG_MACRO_DIR([m4]) |
Philip Tricca | 74037d3 | 2018-11-04 16:17:19 -0800 | [diff] [blame] | 12 | : ${CFLAGS=""} |
Philip Tricca | 35ac9cf | 2015-08-05 17:03:52 -0700 | [diff] [blame] | 13 | AC_PROG_CC |
Philip Tricca | ffbd61a | 2015-09-25 00:27:57 -0700 | [diff] [blame] | 14 | LT_INIT() |
Philip Tricca | 71aa985 | 2015-08-25 00:26:22 -0700 | [diff] [blame] | 15 | AM_INIT_AUTOMAKE([foreign |
| 16 | subdir-objects]) |
Andreas Fuchs | 3c965e7 | 2017-11-24 16:16:20 +0100 | [diff] [blame] | 17 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) #Backward compatible setting of "silent-rules" |
| 18 | |
Andreas Fuchs | bc169cb | 2018-04-10 12:02:10 +0200 | [diff] [blame] | 19 | AC_CONFIG_FILES([Makefile Doxyfile]) |
Philip Tricca | 1a94dd8 | 2017-08-16 14:32:55 -0700 | [diff] [blame] | 20 | |
| 21 | # propagate configure arguments to distcheck |
| 22 | AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],[$ac_configure_args]) |
| 23 | |
Safayet N Ahmed | 1354f49 | 2018-11-03 16:02:49 -0400 | [diff] [blame] | 24 | AC_CANONICAL_HOST |
| 25 | |
| 26 | # Check OS and set library and compile flags accordingly |
| 27 | case "${host_os}" in |
| 28 | *nto-qnx*) |
| 29 | ADD_COMPILER_FLAG([-D_QNX_SOURCE]) |
| 30 | LIBDL_LDFLAGS="" |
| 31 | LIBSOCKET_LDFLAGS="-lsocket" |
| 32 | ;; |
| 33 | *) |
| 34 | LIBDL_LDFLAGS="-ldl" |
| 35 | LIBSOCKET_LDFLAGS="" |
| 36 | ;; |
| 37 | esac |
| 38 | AC_SUBST([LIBDL_LDFLAGS]) |
| 39 | AC_SUBST([LIBSOCKET_LDFLAGS]) |
| 40 | |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 41 | AC_ARG_ENABLE([unit], |
| 42 | [AS_HELP_STRING([--enable-unit], |
| 43 | [build cmocka unit tests (default is no)])], |
| 44 | [enable_unit=$enableval], |
| 45 | [enable_unit=no]) |
Philip Tricca | 38db755 | 2018-02-27 07:58:25 -0800 | [diff] [blame] | 46 | m4_define([cmocka_min_version], [1.0]) |
| 47 | m4_define([cmocka_err], [Unit test enabled, but cmocka missing or version requirements not met. cmocka version must be >= cmocka_min_version]) |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 48 | AS_IF([test "x$enable_unit" != xno], |
| 49 | [PKG_CHECK_MODULES([CMOCKA], |
Philip Tricca | 38db755 | 2018-02-27 07:58:25 -0800 | [diff] [blame] | 50 | [cmocka >= cmocka_min_version], |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 51 | [AC_DEFINE([HAVE_CMOCKA], |
Philip Tricca | 38db755 | 2018-02-27 07:58:25 -0800 | [diff] [blame] | 52 | [1])], |
| 53 | [AC_MSG_ERROR([cmocka_err])])]) |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 54 | AM_CONDITIONAL([UNIT], [test "x$enable_unit" != xno]) |
Philip Tricca | 77683c7 | 2017-12-04 16:05:52 -0800 | [diff] [blame] | 55 | |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 56 | AC_ARG_ENABLE([esapi], |
| 57 | [AS_HELP_STRING([--enable-esapi], |
| 58 | [build the esapi layer (default is yes)])], |
| 59 | [enable_esapi=$enableval], |
| 60 | [enable_esapi=yes]) |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 61 | |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 62 | AM_CONDITIONAL(ESAPI, test "x$enable_esapi" = "xyes") |
| 63 | |
Tadeusz Struk | 3f2489b | 2018-08-22 10:01:11 -0700 | [diff] [blame] | 64 | AC_ARG_ENABLE([tcti-device-async], |
| 65 | AS_HELP_STRING([--enable-tcti-device-async], |
| 66 | [Enable asynchronus operation on TCTI device |
| 67 | (note: This needs to be supported by the kernel driver). default is no]), |
| 68 | [enable_tcti_device_async=$enableval], |
| 69 | [enable_tcti_device_async=no]) |
| 70 | AS_IF([test "x$enable_tcti_device_async" = "xyes"], |
| 71 | AC_DEFINE([TCTI_ASYNC],[1])) |
| 72 | |
Tadeusz Struk | fa423ad | 2018-11-27 13:20:38 -0800 | [diff] [blame] | 73 | AC_ARG_ENABLE([tcti-partial-reads], |
| 74 | AS_HELP_STRING([--enable-tcti-partial-reads], |
| 75 | [Enable partial reads for TCTI device |
| 76 | (note: This needs to be supported by the kernel driver). default is no]), |
| 77 | [enable_tcti_partial_reads=$enableval], |
| 78 | [enable_tcti_partial_reads=no]) |
| 79 | AS_IF([test "x$enable_tcti_partial_reads" = "xyes"], |
| 80 | AC_DEFINE([TCTI_PARTIAL_READ],[1])) |
| 81 | |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 82 | AC_ARG_WITH([crypto], |
| 83 | [AS_HELP_STRING([--with-crypto={gcrypt,ossl}], |
Tadeusz Struk | a5ff71a | 2018-10-23 16:04:25 -0700 | [diff] [blame] | 84 | [sets the ESAPI crypto backend (default is OpenSSL)])], |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 85 | [], |
Tadeusz Struk | a5ff71a | 2018-10-23 16:04:25 -0700 | [diff] [blame] | 86 | [with_crypto=ossl]) |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 87 | |
| 88 | AM_CONDITIONAL(ESYS_OSSL, test "x$with_crypto" = "xossl") |
| 89 | AM_CONDITIONAL(ESYS_GCRYPT, test "x$with_crypto" = "xgcrypt") |
| 90 | |
| 91 | AS_IF([test "x$with_crypto" != "xgcrypt"], |
| 92 | AS_IF([test "x$with_crypto" != "xossl"], |
| 93 | AC_MSG_ERROR([Bad value for --with-crypto $with_crypto]))) |
| 94 | |
| 95 | AS_IF([test "x$enable_esapi" != xno -a "x$with_crypto" = "xgcrypt"], |
Philip Tricca | 8eecfd3 | 2018-01-31 06:28:27 -0800 | [diff] [blame] | 96 | [AC_CHECK_HEADER([gcrypt.h], |
| 97 | [], |
| 98 | [AC_MSG_ERROR([Missing required header: gcrypt.h.])])]) |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 99 | |
| 100 | AS_IF([test "x$enable_esapi" != xno -a "x$with_cryptor" = "xgcrypt"], |
Philip Tricca | 8eecfd3 | 2018-01-31 06:28:27 -0800 | [diff] [blame] | 101 | [AC_CHECK_LIB([gcrypt], |
| 102 | [gcry_mac_open], |
| 103 | [], |
| 104 | [AC_MSG_ERROR([Missing required library: gcrypt.])])]) |
Juergen Repp | bebbc7a | 2018-06-22 14:03:12 +0200 | [diff] [blame] | 105 | |
| 106 | AS_IF([test "x$enable_esapi" != xno -a "x$with_crypto" = "xossl"], |
| 107 | [AC_CHECK_HEADER([openssl/ssl.h], |
| 108 | [], |
| 109 | [AC_MSG_ERROR([Missing required header: openssl/ssl.h.])])]) |
| 110 | |
| 111 | AS_IF([test "x$enable_esapi" != xno -a "x$with_crypto" = "xossl"], |
| 112 | AC_CHECK_LIB(ssl, OPENSSL_init_ssl, [FOUND_SSL_LIB="yes"])) |
| 113 | |
| 114 | AS_IF([test "x$enable_esapi" != xno -a "x$with_crypto" = "xossl"], |
| 115 | AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])) |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 116 | |
| 117 | AC_ARG_WITH([tctidefaultmodule], |
| 118 | [AS_HELP_STRING([--with-tctidefaultmodule], |
Andreas Fuchs | 037c878 | 2018-03-21 18:52:38 +0100 | [diff] [blame] | 119 | [The default TCTI module for ESAPI. (Default: libtss2-tcti-default.so])], |
| 120 | [AC_DEFINE_UNQUOTED([ESYS_TCTI_DEFAULT_MODULE], |
Andreas Fuchs | fefb6b0 | 2018-08-29 13:30:35 +0200 | [diff] [blame] | 121 | ["$with_tctidefaultmodule"], |
Andreas Fuchs | 037c878 | 2018-03-21 18:52:38 +0100 | [diff] [blame] | 122 | ["The default TCTI library file"])], |
| 123 | []) |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 124 | |
| 125 | AC_ARG_WITH([tctidefaultconfig], |
| 126 | [AS_HELP_STRING([--with-tctidefaultconfig], |
| 127 | [The default tcti module's configuration.])], |
Andreas Fuchs | 037c878 | 2018-03-21 18:52:38 +0100 | [diff] [blame] | 128 | [AC_DEFINE_UNQUOTED([ESYS_TCTI_DEFAULT_CONFIG], |
Andreas Fuchs | fefb6b0 | 2018-08-29 13:30:35 +0200 | [diff] [blame] | 129 | ["$with_tctidefaultconfig"], |
Andreas Fuchs | 037c878 | 2018-03-21 18:52:38 +0100 | [diff] [blame] | 130 | ["The default TCTIs configuration string"])], |
| 131 | []) |
| 132 | |
Andreas Fuchs | 2b085e9 | 2018-05-02 16:42:47 +0200 | [diff] [blame] | 133 | AC_ARG_ENABLE([tcti-device], |
| 134 | [AS_HELP_STRING([--enable-tcti-device], |
| 135 | [build the tcti-device module (default is yes)])], |
| 136 | [enable_tcti_device=$enableval], |
| 137 | [enable_tcti_device=yes]) |
| 138 | AM_CONDITIONAL([ENABLE_TCTI_DEVICE], [test "x$enable_tcti_device" != xno]) |
| 139 | |
| 140 | AC_ARG_ENABLE([tcti-mssim], |
| 141 | [AS_HELP_STRING([--enable-tcti-mssim], |
| 142 | [build the tcti-mssim module (default is yes)])], |
| 143 | [enable_tcti_mssim=$enableval], |
| 144 | [enable_tcti_mssim=yes]) |
| 145 | AM_CONDITIONAL([ENABLE_TCTI_MSSIM], [test "x$enable_tcti_mssim" != xno]) |
| 146 | |
Philip Tricca | 99d4142 | 2017-06-18 15:11:50 -0700 | [diff] [blame] | 147 | # |
Javier Martinez Canillas | 0075f88 | 2018-04-13 12:49:37 +0200 | [diff] [blame] | 148 | # udev |
| 149 | # |
| 150 | AC_ARG_WITH([udevrulesdir], |
| 151 | [AS_HELP_STRING([--with-udevrulesdir=DIR],[udev rules directory])], |
| 152 | [], |
| 153 | [with_udevrulesdir=${libdir}/udev/rules.d]) |
| 154 | AX_NORMALIZE_PATH([with_udevrulesdir]) |
| 155 | AC_SUBST([udevrulesdir], [$with_udevrulesdir]) |
| 156 | AC_ARG_WITH([udevrulesprefix], |
| 157 | [AS_HELP_STRING([--with-udevrulesprefix=XY],[prefix for udev rules file])], |
| 158 | [AC_SUBST([udevrulesprefix],[$with_udevrulesprefix])]) |
| 159 | AM_CONDITIONAL(WITH_UDEVRULESPREFIX, [test -n "$with_udevrulesprefix"]) |
| 160 | # |
Philip Tricca | 9907543 | 2018-04-25 19:02:05 -0700 | [diff] [blame] | 161 | # enable integration tests and check for simulator binary |
Philip Tricca | 99d4142 | 2017-06-18 15:11:50 -0700 | [diff] [blame] | 162 | # |
Philip Tricca | 9907543 | 2018-04-25 19:02:05 -0700 | [diff] [blame] | 163 | AC_ARG_ENABLE([integration], |
| 164 | [AS_HELP_STRING([--enable-integration], |
| 165 | [build and execute integration tests (default is no)])], |
| 166 | [enable_integration=$enableval], |
| 167 | [enable_integration=no]) |
| 168 | AS_IF([test "x$enable_integration" = "xyes"], |
Philip Tricca | 154b81d | 2018-07-06 12:41:07 -0700 | [diff] [blame] | 169 | [ERROR_IF_NO_PROG([tpm_server]) |
Jonas Witschel | 8b9285d | 2018-12-27 23:53:21 +0100 | [diff] [blame] | 170 | ERROR_IF_NO_PROG([ss]) |
Philip Tricca | 35ab16e | 2018-07-06 13:03:17 -0700 | [diff] [blame] | 171 | ERROR_IF_NO_PROG([ps]) |
| 172 | ERROR_IF_NO_PROG([echo]) |
| 173 | ERROR_IF_NO_PROG([kill]) |
Jonas Witschel | 303412c | 2018-12-27 23:55:55 +0100 | [diff] [blame] | 174 | ERROR_IF_NO_PROG([stdbuf]) |
Philip Tricca | 35ab16e | 2018-07-06 13:03:17 -0700 | [diff] [blame] | 175 | ERROR_IF_NO_PROG([sleep]) |
| 176 | ERROR_IF_NO_PROG([cat]) |
| 177 | ERROR_IF_NO_PROG([realpath]) |
| 178 | ERROR_IF_NO_PROG([dirname]) |
| 179 | ERROR_IF_NO_PROG([basename]) |
| 180 | ERROR_IF_NO_PROG([mktemp]) |
| 181 | ERROR_IF_NO_PROG([od]) |
| 182 | ERROR_IF_NO_PROG([awk]) |
| 183 | ERROR_IF_NO_PROG([expr]) |
| 184 | ERROR_IF_NO_PROG([grep]) |
| 185 | ERROR_IF_NO_PROG([env]) |
| 186 | ERROR_IF_NO_PROG([rm]) |
Philip Tricca | 9907543 | 2018-04-25 19:02:05 -0700 | [diff] [blame] | 187 | PKG_CHECK_MODULES([LIBCRYPTO],[libcrypto]) |
| 188 | AC_CHECK_HEADER(uthash.h, [], [AC_MSG_ERROR([Can not find uthash.h. Please install uthash-dev])]) |
Tadeusz Struk | 91e7bd6 | 2018-07-23 11:30:02 -0700 | [diff] [blame] | 189 | AS_IF([test "x$enable_tcti_mssim" = xno], |
| 190 | AC_MSG_ERROR([Integration tests can not be enabled without the TCTI_MSSIM module])) |
Philip Tricca | 9907543 | 2018-04-25 19:02:05 -0700 | [diff] [blame] | 191 | AC_SUBST([ENABLE_INTEGRATION], [$enable_integration])]) |
| 192 | AM_CONDITIONAL([ENABLE_INTEGRATION],[test "x$enable_integration" = "xyes"]) |
Tadeusz Struk | 1bc0f08 | 2018-04-18 11:53:26 -0700 | [diff] [blame] | 193 | |
David R. Bild | 1e49b4c | 2017-11-28 18:09:42 -0600 | [diff] [blame] | 194 | gl_LD_VERSION_SCRIPT |
| 195 | |
Andreas Fuchs | 80e8485 | 2018-02-27 22:45:09 +0100 | [diff] [blame] | 196 | AC_ARG_WITH([maxloglevel], |
| 197 | [AS_HELP_STRING([--with-maxloglevel={none,error,warning,info,debug,trace}], |
Andreas Fuchs | bc49076 | 2018-01-03 14:36:38 +0100 | [diff] [blame] | 198 | [sets the maximum log level (default is trace)])], |
| 199 | [], |
Andreas Fuchs | 80e8485 | 2018-02-27 22:45:09 +0100 | [diff] [blame] | 200 | [with_maxloglevel=trace]) |
Philip Tricca | feae8b1 | 2018-11-04 19:53:12 -0800 | [diff] [blame] | 201 | AS_CASE(["x$with_maxloglevel"], |
| 202 | ["xnone"], |
| 203 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [0], ["Logging disabled"])], |
| 204 | ["xerror"], |
| 205 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [2], ["Error log level"])], |
| 206 | ["xwarning"], |
| 207 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [3], ["Warning log level"])], |
| 208 | ["xinfo"], |
| 209 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [4], ["Info log level"])], |
| 210 | ["xdebug"], |
| 211 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [5], ["Debug log level"])], |
| 212 | ["xtrace"], |
| 213 | [AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [6], ["Trace log level"])], |
| 214 | [AC_MSG_ERROR([Bad value for --with-maxloglevel])]) |
Andreas Fuchs | bc49076 | 2018-01-03 14:36:38 +0100 | [diff] [blame] | 215 | |
Tadeusz Struk | a3260d8 | 2017-09-11 12:06:13 -0700 | [diff] [blame] | 216 | AC_ARG_ENABLE([debug], |
| 217 | [AS_HELP_STRING([--enable-debug], |
| 218 | [build with debug info (default is no)])], |
| 219 | [enable_debug=$enableval], |
| 220 | [enable_debug=no]) |
Philip Tricca | 6d5985b | 2018-11-04 15:58:19 -0800 | [diff] [blame] | 221 | AS_IF([test "x$enable_debug" = "xyes"], ADD_COMPILER_FLAG([-ggdb3 -Og])) |
Philip Tricca | 085755d | 2018-11-11 12:43:29 -0800 | [diff] [blame] | 222 | AC_ARG_ENABLE([defaultflags], |
Philip Tricca | 6751b3c | 2018-11-20 00:19:13 -0800 | [diff] [blame] | 223 | [AS_HELP_STRING([--disable-defaultflags], |
| 224 | [Disable default preprocessor, compiler, and linker flags.])], |
Philip Tricca | 085755d | 2018-11-11 12:43:29 -0800 | [diff] [blame] | 225 | [enable_defaultflags=$enableval], |
| 226 | [enable_defaultflags=yes]) |
| 227 | AS_IF([test "x$enable_defaultflags" = "xyes"], |
| 228 | [ |
| 229 | ADD_PREPROC_FLAG([-D_DEFAULT_SOURCE]) |
| 230 | ADD_PREPROC_FLAG([-D_BSD_SOURCE]) |
| 231 | ADD_PREPROC_FLAG([-D_POSIX_SOURCE]) |
| 232 | AS_IF([test "x$enable_debug" = "xno"], |
| 233 | [ |
| 234 | ADD_PREPROC_FLAG([-U_FORTIFY_SOURCE]) |
| 235 | ADD_PREPROC_FLAG([-D_FORTIFY_SOURCE=2]) |
| 236 | ADD_COMPILER_FLAG([-g -O2]) |
| 237 | ]) |
| 238 | ADD_COMPILER_FLAG([-std=c99]) |
| 239 | ADD_COMPILER_FLAG([-Wall]) |
| 240 | ADD_COMPILER_FLAG([-Wextra]) |
| 241 | ADD_COMPILER_FLAG([-Wformat-security]) |
| 242 | ADD_COMPILER_FLAG([-Werror]) |
| 243 | ADD_COMPILER_FLAG([-fstack-protector-all]) |
| 244 | ADD_COMPILER_FLAG([-fpic]) |
| 245 | ADD_COMPILER_FLAG([-fPIC]) |
| 246 | # work around GCC bug #53119 |
| 247 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 |
| 248 | ADD_COMPILER_FLAG([-Wno-missing-braces]) |
William Roberts | 2272717 | 2018-12-07 10:34:53 -0800 | [diff] [blame] | 249 | ADD_COMPILER_FLAG([-Wstrict-overflow=5]) |
Philip Tricca | 085755d | 2018-11-11 12:43:29 -0800 | [diff] [blame] | 250 | ADD_LINK_FLAG([-Wl,--no-undefined]) |
| 251 | ADD_LINK_FLAG([-Wl,-z,noexecstack]) |
| 252 | ADD_LINK_FLAG([-Wl,-z,now]) |
| 253 | ADD_LINK_FLAG([-Wl,-z,relro]) |
| 254 | ]) |
Philip Tricca | b43de64 | 2017-03-04 21:29:10 -0800 | [diff] [blame] | 255 | |
Philip Tricca | 9907543 | 2018-04-25 19:02:05 -0700 | [diff] [blame] | 256 | AC_SUBST([PATH]) |
| 257 | |
Philip Tricca | f891580 | 2017-03-14 17:01:50 -0700 | [diff] [blame] | 258 | |
Juergen Repp | ac59836 | 2018-07-17 13:36:38 +0200 | [diff] [blame] | 259 | dnl --------- Physical TPM device ----------------------- |
| 260 | |
| 261 | AC_ARG_WITH([ptpm], |
Tadeusz Struk | c6a4a7d | 2018-08-21 13:21:22 -0700 | [diff] [blame] | 262 | [AS_HELP_STRING([--with-ptpm=<device>],[TPM device])], |
Juergen Repp | ac59836 | 2018-07-17 13:36:38 +0200 | [diff] [blame] | 263 | [AS_IF([test \( -w "$with_ptpm" \) -a \( -r "$with_ptpm" \)], |
| 264 | [AC_MSG_RESULT([success]) |
| 265 | AC_SUBST([PTPM],[$with_ptpm]) |
| 266 | AX_NORMALIZE_PATH([with_ptpm]) |
| 267 | with_ptpm_set=yes], |
| 268 | [AC_MSG_ERROR([TPM device provided does not exist or is not writable])])], |
| 269 | [with_ptpm_set=no]) |
| 270 | AM_CONDITIONAL([PTPM],[test "x$with_ptpm_set" = "xyes"]) |
| 271 | |
| 272 | AC_ARG_WITH([ptpmtests], |
| 273 | [AS_HELP_STRING([--with-ptpmtests=<case>],[Comma-separated values of possible tests: destructive,mandatory,optional] default is mandatory)], |
| 274 | [AS_IF([test "x" == x$(echo $with_ptpmtests | sed 's/destructive//g' | sed 's/mandatory//g' | sed 's/optional//g' | sed 's/,//g') ], |
| 275 | [AC_MSG_RESULT([success]) |
| 276 | with_ptpmtests_set=yes], |
| 277 | [AC_MSG_ERROR([Illegal test type for pTPM tests.])])], |
| 278 | [with_ptpmtests="mandatory"]) |
| 279 | |
| 280 | if echo $with_ptpmtests | grep destructive > /dev/null; then |
| 281 | enable_ptpm_destructive="yes" |
| 282 | fi |
| 283 | AM_CONDITIONAL([PTPMDESTRUCTIVE],[test "x$enable_ptpm_destructive" = "xyes"]) |
| 284 | |
| 285 | if echo $with_ptpmtests | grep optional > /dev/null; then |
| 286 | enable_ptpm_optional="yes" |
| 287 | fi |
| 288 | AM_CONDITIONAL([PTPMOPTIONAL],[test "x$enable_ptpm_optional" = "xyes"]) |
| 289 | |
| 290 | if echo $with_ptpmtests | grep mandatory > /dev/null; then |
| 291 | enable_ptpm_mandatory="yes" |
| 292 | fi |
| 293 | AM_CONDITIONAL([PTPMMANDATORY],[test "x$enable_ptpm_mandatory" = "xyes"]) |
| 294 | |
| 295 | AM_CONDITIONAL([TESTPTPM],[test "x$with_ptpm_set" = "xyes" -a "x$with_ptpm_set" = "xyes"]) |
| 296 | |
Andreas Fuchs | 2968c71 | 2018-02-01 18:22:47 +0100 | [diff] [blame] | 297 | dnl --------- Doxy Gen ----------------------- |
Andreas Fuchs | bc169cb | 2018-04-10 12:02:10 +0200 | [diff] [blame] | 298 | DX_DOXYGEN_FEATURE(ON) |
| 299 | DX_DOT_FEATURE(OFF) |
Andreas Fuchs | 2968c71 | 2018-02-01 18:22:47 +0100 | [diff] [blame] | 300 | DX_HTML_FEATURE(ON) |
| 301 | DX_CHM_FEATURE(OFF) |
| 302 | DX_CHI_FEATURE(OFF) |
| 303 | DX_MAN_FEATURE(ON) |
Jonas Witschel | dd54f33 | 2018-11-14 22:17:34 +0100 | [diff] [blame] | 304 | DX_RTF_FEATURE(ON) |
Andreas Fuchs | 2968c71 | 2018-02-01 18:22:47 +0100 | [diff] [blame] | 305 | DX_XML_FEATURE(OFF) |
| 306 | DX_PDF_FEATURE(OFF) |
| 307 | DX_PS_FEATURE(OFF) |
Jonas Witschel | dd54f33 | 2018-11-14 22:17:34 +0100 | [diff] [blame] | 308 | DX_INIT_DOXYGEN($PACKAGE_NAME, [Doxyfile], [doxygen-doc]) |
Andreas Fuchs | e5273b3 | 2018-04-26 16:16:24 +0200 | [diff] [blame] | 309 | AM_CONDITIONAL(DOXYMAN, [test $DX_FLAG_man -eq 1]) |
Andreas Fuchs | 2968c71 | 2018-02-01 18:22:47 +0100 | [diff] [blame] | 310 | |
Jonas Witschel | dd67236 | 2018-11-17 15:25:41 +0100 | [diff] [blame] | 311 | AS_IF([test "x$enable_doxygen_doc" != xno], |
Tadeusz Struk | 81eacdd | 2018-11-12 11:57:02 -0800 | [diff] [blame] | 312 | [ERROR_IF_NO_PROG([doxygen])]) |
| 313 | |
Andreas Fuchs | 61cb7fb | 2017-11-22 10:23:01 +0100 | [diff] [blame] | 314 | AX_CODE_COVERAGE |
Jonas Witschel | 648fa84 | 2019-01-07 22:15:06 +0100 | [diff] [blame] | 315 | m4_ifdef([_AX_CODE_COVERAGE_RULES], |
| 316 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [true])], |
| 317 | [AM_CONDITIONAL(AUTOCONF_CODE_COVERAGE_2019_01_06, [false])]) |
Joshua Lock | b7b4232 | 2019-01-25 16:10:14 +0000 | [diff] [blame^] | 318 | AX_ADD_AM_MACRO_STATIC([]) |
Andreas Fuchs | 61cb7fb | 2017-11-22 10:23:01 +0100 | [diff] [blame] | 319 | |
Philip Tricca | d1952b4 | 2015-08-05 15:52:10 -0700 | [diff] [blame] | 320 | AC_OUTPUT |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 321 | |
Andreas Fuchs | 2b085e9 | 2018-05-02 16:42:47 +0200 | [diff] [blame] | 322 | AM_COND_IF([ENABLE_TCTI_DEVICE], [], |
| 323 | [AM_COND_IF([ENABLE_TCTI_MSSIM], [], |
| 324 | [AC_MSG_WARN("No build-in TCTI module enabled")])]) |
| 325 | |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 326 | AC_MSG_RESULT([ |
| 327 | $PACKAGE_NAME $VERSION |
| 328 | esapi: $enable_esapi |
| 329 | tctidefaultmodule: $with_tctidefaultmodule |
| 330 | tctidefaultconfig: $with_tctidefaultconfig |
| 331 | unit: $enable_unit |
| 332 | debug: $enable_debug |
Philip Tricca | fb0b72f | 2018-03-04 19:39:24 -0800 | [diff] [blame] | 333 | maxloglevel: $with_maxloglevel |
Andreas Fuchs | 2968c71 | 2018-02-01 18:22:47 +0100 | [diff] [blame] | 334 | doxygen: $DX_FLAG_doc $enable_doxygen_doc |
Tadeusz Struk | 3f2489b | 2018-08-22 10:01:11 -0700 | [diff] [blame] | 335 | tcti-device-async: $enable_tcti_device_async |
Tadeusz Struk | fa423ad | 2018-11-27 13:20:38 -0800 | [diff] [blame] | 336 | tcti-partial-read: $enable_tcti_partial_reads |
Tadeusz Struk | a5ff71a | 2018-10-23 16:04:25 -0700 | [diff] [blame] | 337 | crypto backend: $with_crypto |
Juergen Repp | ff821bd | 2017-12-11 15:21:42 +0100 | [diff] [blame] | 338 | ]) |