| 1 |
dnl The copyright in this software is being made available under the BSD License, |
| 2 |
dnl included below. This software may be subject to other third party and |
| 3 |
dnl contributor rights, including patent rights, and no such rights are granted |
| 4 |
dnl under this license. |
| 5 |
dnl |
| 6 |
dnl Copyright (c) Intel Corporation |
| 7 |
dnl |
| 8 |
dnl All rights reserved. |
| 9 |
dnl |
| 10 |
dnl BSD License |
| 11 |
dnl |
| 12 |
dnl Redistribution and use in source and binary forms, with or without modification, |
| 13 |
dnl are permitted provided that the following conditions are met: |
| 14 |
dnl |
| 15 |
dnl Redistributions of source code must retain the above copyright notice, this list |
| 16 |
dnl of conditions and the following disclaimer. |
| 17 |
dnl |
| 18 |
dnl Redistributions in binary form must reproduce the above copyright notice, this |
| 19 |
dnl list of conditions and the following disclaimer in the documentation and/or |
| 20 |
dnl other materials provided with the distribution. |
| 21 |
dnl |
| 22 |
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" |
| 23 |
dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 24 |
dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 25 |
dnl DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
| 26 |
dnl ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 27 |
dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 |
dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 29 |
dnl ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 |
dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 31 |
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 |
|
| 33 |
AC_INIT([ms-tpm-20-ref], |
| 34 |
[0.1], |
| 35 |
[https://github.com/microsoft/ms-tpm-20-ref/issues], |
| 36 |
[], |
| 37 |
[https://github.com/microsoft/ms-tpm-20-ref]) |
| 38 |
AC_CONFIG_MACRO_DIR([.]) |
| 39 |
AC_PROG_CC |
| 40 |
AC_PROG_LN_S |
| 41 |
AC_PROG_RANLIB |
| 42 |
AM_INIT_AUTOMAKE([foreign subdir-objects]) |
| 43 |
AC_CONFIG_FILES([Makefile]) |
| 44 |
AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],[$ac_configure_args]) |
| 45 |
|
| 46 |
dnl By enabling this feature tpm simulator gets seeds derived from hardware parameters. |
| 47 |
dnl It is enabled only for linux devices. |
| 48 |
dnl Note that the seeds are not derived from secure hardware source. |
| 49 |
|
| 50 |
AC_ARG_ENABLE(usedeviceid, |
| 51 |
AS_HELP_STRING([--enable-usedeviceid], |
| 52 |
[tpm simulator get seeds derived from hardware parameters. Seeds are not derived from secure hardware source.])) |
| 53 |
|
| 54 |
PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto]) |
| 55 |
AS_IF([test "x$enable_usedeviceid" = "xyes"], [ |
| 56 |
PKG_CHECK_MODULES([LIBUDEV], [libudev]) |
| 57 |
[ADDITIONAL_LIBS="-ludev"] |
| 58 |
]) |
| 59 |
AX_PTHREAD([], [AC_MSG_ERROR([requires pthread])]) |
| 60 |
|
| 61 |
AC_DEFINE([HASH_LIB], [Ossl], [Crypto lib for hash algorithms]) |
| 62 |
AC_DEFINE([SYM_LIB], [Ossl], [Crypto lib for symmetric encryption algorithms]) |
| 63 |
AC_DEFINE([MATH_LIB], [Ossl], [Crypto lib for bignum operations]) |
| 64 |
|
| 65 |
ADD_COMPILER_FLAG([-std=gnu11]) |
| 66 |
ADD_COMPILER_FLAG([-Werror]) |
| 67 |
ADD_COMPILER_FLAG([-Wall]) |
| 68 |
ADD_COMPILER_FLAG([-Wformat-security]) |
| 69 |
ADD_COMPILER_FLAG([-fstack-protector-all]) |
| 70 |
ADD_COMPILER_FLAG([-fPIC]) |
| 71 |
ADD_COMPILER_FLAG([-Wno-error=empty-body]) |
| 72 |
ADD_COMPILER_FLAG([-Wno-error=expansion-to-defined]) |
| 73 |
ADD_COMPILER_FLAG([-Wno-error=parentheses]) |
| 74 |
ADD_COMPILER_FLAG([-Wno-error=pointer-to-int-cast]) |
| 75 |
ADD_COMPILER_FLAG([-Wno-error=missing-braces]) |
| 76 |
ADD_COMPILER_FLAG([-Wno-error=unused-result]) |
| 77 |
|
| 78 |
AS_IF([test "x$enable_usedeviceid" = "xyes"], [ |
| 79 |
ADD_COMPILER_FLAG([-DNDEBUG]) |
| 80 |
ADD_COMPILER_FLAG([-g]) |
| 81 |
ADD_COMPILER_FLAG([-DUSE_PLATFORM_EPS]) |
| 82 |
AC_SUBST(ADDITIONAL_LIBS) |
| 83 |
]) |
| 84 |
ADD_LINK_FLAG([-Wl,--no-undefined]) |
| 85 |
ADD_LINK_FLAG([-Wl,-z,noexecstack]) |
| 86 |
ADD_LINK_FLAG([-Wl,-z,now]) |
| 87 |
ADD_LINK_FLAG([-Wl,-z,relro]) |
| 88 |
|
| 89 |
AC_OUTPUT |