libpldm: Fix header use

The headers need to work whether we're building libpldm in the repo or
we're building another project depending on the headers in the system
include directory.

Tidy up the paths involved and switch to defining the public headers as
system headers for the purpose of the build.

Change-Id: I49413988c94d393ea5761bc4684edcd2c2482a98
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/base.c b/src/base.c
index 4322ef2..eec7626 100644
--- a/src/base.c
+++ b/src/base.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "base.h"
-#include "pldm_types.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm_types.h>
+
 #include <endian.h>
 #include <stdint.h>
 #include <string.h>
diff --git a/src/bios.c b/src/bios.c
index 83c6dc9..00abf7f 100644
--- a/src/bios.c
+++ b/src/bios.c
@@ -1,7 +1,8 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "bios.h"
-#include "base.h"
-#include "utils.h"
+#include <libpldm/base.h>
+#include <libpldm/bios.h>
+#include <libpldm/utils.h>
+
 #include <endian.h>
 #include <string.h>
 
diff --git a/src/bios_table.c b/src/bios_table.c
index 228bff4..10b2495 100644
--- a/src/bios_table.c
+++ b/src/bios_table.c
@@ -1,9 +1,11 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 #include "array.h"
-#include "bios_table.h"
-#include "base.h"
-#include "bios.h"
-#include "utils.h"
+
+#include <libpldm/base.h>
+#include <libpldm/bios.h>
+#include <libpldm/bios_table.h>
+#include <libpldm/utils.h>
+
 #include <assert.h>
 #include <endian.h>
 #include <limits.h>
diff --git a/src/firmware_update.c b/src/firmware_update.c
index 22b4387..0788d4b 100644
--- a/src/firmware_update.c
+++ b/src/firmware_update.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "firmware_update.h"
-#include "utils.h"
+#include <libpldm/firmware_update.h>
+#include <libpldm/utils.h>
+
 #include <endian.h>
 #include <stdbool.h>
 #include <string.h>
diff --git a/src/fru.c b/src/fru.c
index 024a34f..fd6120e 100644
--- a/src/fru.c
+++ b/src/fru.c
@@ -1,14 +1,14 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
+#include <libpldm/base.h>
+#include <libpldm/fru.h>
+#include <libpldm/utils.h>
+
 #include <assert.h>
 #include <endian.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 
-#include "base.h"
-#include "fru.h"
-#include "utils.h"
-
 LIBPLDM_ABI_STABLE
 int encode_get_fru_record_table_metadata_req(uint8_t instance_id,
 					     struct pldm_msg *msg,
diff --git a/src/msgbuf.h b/src/msgbuf.h
index 4c0e61c..c9527e1 100644
--- a/src/msgbuf.h
+++ b/src/msgbuf.h
@@ -13,8 +13,8 @@
 extern "C" {
 #endif
 
-#include "base.h"
-#include "pldm_types.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm_types.h>
 
 #include <assert.h>
 #include <endian.h>
diff --git a/src/oem/ibm/file_io.c b/src/oem/ibm/file_io.c
index ba0111a..1303bf6 100644
--- a/src/oem/ibm/file_io.c
+++ b/src/oem/ibm/file_io.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "libpldm/file_io.h"
-#include "base.h"
+#include <libpldm/base.h>
+#include <libpldm/oem/ibm/libpldm/file_io.h>
+
 #include <endian.h>
 #include <string.h>
 
diff --git a/src/oem/ibm/host.c b/src/oem/ibm/host.c
index c94ee49..6a79ac9 100644
--- a/src/oem/ibm/host.c
+++ b/src/oem/ibm/host.c
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "base.h"
+#include <libpldm/base.h>
+#include <libpldm/oem/ibm/libpldm/host.h>
+
 #include <endian.h>
 #include <stdint.h>
 #include <string.h>
 
-#include "libpldm/host.h"
-
 LIBPLDM_ABI_STABLE
 int encode_get_alert_status_req(uint8_t instance_id, uint8_t version_id,
 				struct pldm_msg *msg, size_t payload_length)
diff --git a/src/oem/ibm/platform.c b/src/oem/ibm/platform.c
index 3a8b2f8..042044f 100644
--- a/src/oem/ibm/platform.c
+++ b/src/oem/ibm/platform.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "libpldm/platform.h"
-#include "libpldm/platform_oem_ibm.h"
+#include <libpldm/platform.h>
+#include <libpldm/oem/ibm/libpldm/platform_oem_ibm.h>
+
 #include <string.h>
 
 LIBPLDM_ABI_STABLE
diff --git a/src/pdr.c b/src/pdr.c
index ee699c7..9a9c11a 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "pdr.h"
-#include "platform.h"
+#include <libpldm/pdr.h>
+#include <libpldm/platform.h>
+
 #include <assert.h>
 #include <endian.h>
 #include <stdlib.h>
diff --git a/src/platform.c b/src/platform.c
index a24cd30..9364da3 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -1,9 +1,11 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "msgbuf/platform.h"
-#include "base.h"
 #include "msgbuf.h"
-#include "platform.h"
-#include "pldm_types.h"
+#include "msgbuf/platform.h"
+
+#include <libpldm/base.h>
+#include <libpldm/platform.h>
+#include <libpldm/pldm_types.h>
+
 #include <endian.h>
 #include <stdint.h>
 #include <stdlib.h>
diff --git a/src/requester/instance-id.c b/src/requester/instance-id.c
index 108e451..aaeca3e 100644
--- a/src/requester/instance-id.c
+++ b/src/requester/instance-id.c
@@ -1,8 +1,9 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 // NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
 #define _GNU_SOURCE
-#include "libpldm/instance-id.h"
-#include "libpldm/pldm.h"
+#include <libpldm/instance-id.h>
+#include <libpldm/requester/pldm.h>
+
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
diff --git a/src/requester/pldm.c b/src/requester/pldm.c
index 9e6801a..c771091 100644
--- a/src/requester/pldm.c
+++ b/src/requester/pldm.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "libpldm/requester/pldm.h"
-#include "base.h"
-#include "libpldm/transport.h"
+#include <libpldm/base.h>
+#include <libpldm/requester/pldm.h>
+#include <libpldm/transport.h>
 
 #include <bits/types/struct_iovec.h>
 #include <fcntl.h>
diff --git a/src/transport/af-mctp.c b/src/transport/af-mctp.c
index bf024b8..ea79863 100644
--- a/src/transport/af-mctp.c
+++ b/src/transport/af-mctp.c
@@ -1,14 +1,15 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "mctp-defines.h"
-#include "base.h"
 #include "container-of.h"
-#include "libpldm/pldm.h"
-#include "libpldm/transport.h"
-#include "libpldm/transport/af-mctp.h"
+#include "mctp-defines.h"
 #include "responder.h"
 #include "socket.h"
 #include "transport.h"
 
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
+#include <libpldm/transport.h>
+#include <libpldm/transport/af-mctp.h>
+
 #include <errno.h>
 #include <limits.h>
 #include <linux/mctp.h>
diff --git a/src/transport/mctp-demux.c b/src/transport/mctp-demux.c
index a874cef..0ea1cf6 100644
--- a/src/transport/mctp-demux.c
+++ b/src/transport/mctp-demux.c
@@ -1,13 +1,14 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "mctp-defines.h"
-#include "base.h"
 #include "container-of.h"
-#include "libpldm/pldm.h"
-#include "libpldm/transport.h"
-#include "libpldm/transport/mctp-demux.h"
+#include "mctp-defines.h"
 #include "socket.h"
 #include "transport.h"
 
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
+#include <libpldm/transport.h>
+#include <libpldm/transport/mctp-demux.h>
+
 #include <errno.h>
 #include <limits.h>
 #include <poll.h>
diff --git a/src/utils.c b/src/utils.c
index 0e24da5..a22c472 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "utils.h"
-#include "base.h"
+#include <libpldm/base.h>
+#include <libpldm/utils.h>
+
 #include <limits.h>
 #include <stdio.h>