From 1b91bf0d71fcb6fa17e2f0b12a0a1f01e5b5dc09 Mon Sep 17 00:00:00 2001 From: Philip Tricca Date: Mon, 4 Jul 2016 17:56:38 -0700 Subject: [PATCH] configure: Use pkg-config to locate SAPI and TCTI headers / libraries. Signed-off-by: Philip Tricca --- INSTALL | 1 + configure.ac | 24 +++--------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/INSTALL b/INSTALL index c134678dc..e6b7a12c7 100644 --- a/INSTALL +++ b/INSTALL @@ -2,6 +2,7 @@ To build and install the tpm2.0-tools software the following software is require GNU Autoconf GNU Automake GNU Libtool +pkg-config C compiler C++ compiler C Library Development Libraries and Header Files (for pthreads headers) diff --git a/configure.ac b/configure.ac index b90033069..96f462ee6 100644 --- a/configure.ac +++ b/configure.ac @@ -6,21 +6,6 @@ LT_INIT AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_FILES([Makefile]) -AC_CHECK_HEADER([tss2/tpm20.h], - [ - AC_DEFINE([HAVE_TPM20_H], - [1], - [Define if tpm20.h exists.]) - ], - [AC_MSG_ERROR([Missing TSS2 headers.])]) -AC_CHECK_HEADER([tcti/tcti_socket.h], - [ - AC_DEFINE([HAVE_TCTI_SOCKET_H], - [1], - [Define if tcti_socket.h exists.]) - ], - [AC_MSG_ERROR([Missing TCTI socket header.])], - [#include ]) AC_CHECK_HEADER([openssl/sha.h], [ AC_DEFINE([HAVE_OPENSSL_H], @@ -35,10 +20,7 @@ AC_CHECK_HEADER([curl/curl.h], [Define if curl.h exists.]) ], [AC_MSG_ERROR([Missing CURL headers.])]) -AC_CHECK_LIB([tss2], [Tss2_Sys_GetContextSize], [], - [AC_MSG_ERROR([Missing TSS2 library.])], []) -AC_CHECK_LIB([crypto], [SHA256_Init], [], - [AC_MSG_ERROR([Missing CRYPTO library.])], []) -AC_CHECK_LIB([curl], [curl_easy_init], [], - [AC_MSG_ERROR([Missing CURL library.])], []) +PKG_CHECK_MODULES([SAPI],[sapi]) +PKG_CHECK_MODULES([TCTI_SOCK],[tcti-socket]) +PKG_CHECK_MODULES([TCTI_DEV],[tcti-device]) AC_OUTPUT