build: Install headers to $(includedir)/tss2, prefixed with tss2_
This commit updates our source layout so that all headers that are
installed on the platform are in $(srcdir)/include/tss2. When installed
these will end up at $(includedir)/tss2.
This change requires a number of updates to the source tree to fixup
paths and filenames used in 'include' statements. This was an
opportunity to impose some discipline on our use of the include
statement in general. All statements that were updated follow these
conventions
- When including headers that are installed use the quoted form of
`include` and do not include the `tss2` path prefix.
- When including headers that are in the source tree use the quoted form
of `include` and use the path to the header relative to $(srcdir).
These conventions make it less likely that an implementation file will
include an installed header instead of the copy in the source tree.
Additionally they allow us to simplify the use of CFLAGS in the automake
files which was getting a bit out of control. This simplification
removed 50 redundant lines from Makefile-test.am
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
diff --git a/tcti/sockets.h b/tcti/sockets.h
index 1c43875..22ba0eb 100644
--- a/tcti/sockets.h
+++ b/tcti/sockets.h
@@ -4,7 +4,7 @@
#include <sys/socket.h>
#include <sys/un.h>
-#include "sapi/tpm20.h"
+#include "tpm20.h"
#define SOCKET int
diff --git a/tcti/tcti-mssim.c b/tcti/tcti-mssim.c
index 06ca593..8de08b6 100644
--- a/tcti/tcti-mssim.c
+++ b/tcti/tcti-mssim.c
@@ -35,9 +35,9 @@
#include <uriparser/Uri.h>
-#include "sapi/tss2_mu.h"
+#include "tss2_mu.h"
#include "sockets.h"
-#include "tcti/tcti_mssim.h"
+#include "tss2_tcti_mssim.h"
#include "tcti.h"
#define LOGMODULE tcti
#include "log/log.h"
diff --git a/tcti/tcti.c b/tcti/tcti.c
index 0f28423..96e2d4d 100644
--- a/tcti/tcti.c
+++ b/tcti/tcti.c
@@ -30,7 +30,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include "sapi/tpm20.h"
+#include "tpm20.h"
#include "tcti.h"
#define LOGMODULE tcti
#include "log/log.h"
diff --git a/tcti/tcti.h b/tcti/tcti.h
index 0466fba..0195f73 100644
--- a/tcti/tcti.h
+++ b/tcti/tcti.h
@@ -41,7 +41,6 @@
#define TSS2_TCTI_UTIL_H
#include <errno.h>
-#include <sapi/tpm20.h>
#include <stdbool.h>
#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
@@ -49,6 +48,8 @@
#define SOCKET int
#endif
+#include "tpm20.h"
+
#define TCTI_MAGIC 0x7e18e9defa8bc9e2ULL
#define TCTI_VERSION 0x2
diff --git a/tcti/tcti_device.c b/tcti/tcti_device.c
index 856528c..a220fa3 100644
--- a/tcti/tcti_device.c
+++ b/tcti/tcti_device.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include "tcti.h"
-#include "tcti/tcti_device.h"
+#include "tss2_tcti_device.h"
#define LOGMODULE tcti
#include "log/log.h"