meson: Fix for OEM header collision issue

It needs to be possible to build libpldm with any number of oem features
enabled simultaneously. If the header files are same then the earlier
implementation will not work.

Install the header file in a way that doesn't break any oem portions.
Also the symlinks are generated to the older location until we migrate
the applications using the files to new location.

Tested: The headers are installed in the new location
and symlinks are generated.

Change-Id: I1455d52ff4b0c7f74b49d136bf582182537592d1
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/meson.build b/src/meson.build
index 5b9dd2f..77fd629 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,4 @@
-libpldm_sources += files(
+libpldm_sources = files(
   'base.c',
   'bios.c',
   'platform.c',
@@ -16,3 +16,26 @@
 if get_option('oem-ibm').allowed()
    subdir('oem/ibm')
 endif
+
+libpldm = library(
+  'pldm',
+   libpldm_sources,
+   implicit_include_directories: false,
+   include_directories: [
+     libpldm_include_dir,
+     include_directories('.')
+   ],
+   version: meson.project_version(),
+   gnu_symbol_visibility: 'hidden',
+   install: true
+   )
+
+libpldm_dep = declare_dependency(
+  include_directories: libpldm_include_dir,
+  link_with: libpldm)
+
+import('pkgconfig').generate(
+  name: 'libpldm',
+  description: 'PLDM protocol encode/decode C lib',
+  version: meson.project_version(),
+  libraries: libpldm)
diff --git a/src/oem/ibm/file_io.c b/src/oem/ibm/file_io.c
index 1303bf6..71acf72 100644
--- a/src/oem/ibm/file_io.c
+++ b/src/oem/ibm/file_io.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 #include <libpldm/base.h>
-#include <libpldm/oem/ibm/libpldm/file_io.h>
+#include <libpldm/oem/ibm/file_io.h>
 
 #include <endian.h>
 #include <string.h>
diff --git a/src/oem/ibm/host.c b/src/oem/ibm/host.c
index 6a79ac9..69e9193 100644
--- a/src/oem/ibm/host.c
+++ b/src/oem/ibm/host.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 #include <libpldm/base.h>
-#include <libpldm/oem/ibm/libpldm/host.h>
+#include <libpldm/oem/ibm/host.h>
 
 #include <endian.h>
 #include <stdint.h>
diff --git a/src/oem/ibm/platform.c b/src/oem/ibm/platform.c
index 042044f..2c3741d 100644
--- a/src/oem/ibm/platform.c
+++ b/src/oem/ibm/platform.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 #include <libpldm/platform.h>
-#include <libpldm/oem/ibm/libpldm/platform_oem_ibm.h>
+#include <libpldm/oem/ibm/platform.h>
 
 #include <string.h>