meson: add alternative build system

Enable meson build for the pldm project (by default). The autotools
support will be eventually removed. This change is aligned with other
OpenBMC repos, and besides for pldm meson seems to be significantly
faster (see times below to build and run tests on an x86 OpenBMC sdk).

time sh -c './bootstrap.sh ; ./configure ${CONFIGURE_FLAGS}
--enable-oe-sdk --enable-oem-ibm ; make ; make check'
real    3m49.495s

time sh -c 'meson -Doe-sdk=enabled -Dtests=enabled -Doem-ibm=enabled
build/ ; ninja -C build test'
real    0m14.940s

With the currently used warning level in the meson config (the highest
level is used), certain warnings had to be fixed in this commit
(warnings are treated as errors).

Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: I9022417c8fa218d3c2c2f786502caa815af2f832
diff --git a/libpldmresponder/base.cpp b/libpldmresponder/base.cpp
index d0c3551..3b480ad 100644
--- a/libpldmresponder/base.cpp
+++ b/libpldmresponder/base.cpp
@@ -47,7 +47,7 @@
 
 } // namespace base
 
-Response getPLDMTypes(const pldm_msg* request, size_t payloadLength)
+Response getPLDMTypes(const pldm_msg* request, size_t /*payloadLength*/)
 {
     // DSP0240 has this as a bitfield8[N], where N = 0 to 7
     std::array<bitfield8_t, 8> types{};
@@ -146,7 +146,7 @@
     return response;
 }
 
-Response getTID(const pldm_msg* request, size_t payloadLength)
+Response getTID(const pldm_msg* request, size_t /*payloadLength*/)
 {
     // assigned 1 to the bmc as the PLDM terminus
     uint8_t tid = 1;
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index 392f58a..c88a25c 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -57,7 +57,7 @@
 
 } // namespace utils
 
-Response getDateTime(const pldm_msg* request, size_t payloadLength)
+Response getDateTime(const pldm_msg* request, size_t /*payloadLength*/)
 {
     uint8_t seconds = 0;
     uint8_t minutes = 0;
@@ -138,8 +138,9 @@
  *  @param[in] instanceID - instance ID to identify the command
  *  @param[in] biosJsonDir - path where the BIOS json files are present
  */
-Response getBIOSStringTable(BIOSTable& BIOSStringTable, uint32_t transferHandle,
-                            uint8_t transferOpFlag, uint8_t instanceID,
+Response getBIOSStringTable(BIOSTable& BIOSStringTable,
+                            uint32_t /*transferHandle*/,
+                            uint8_t /*transferOpFlag*/, uint8_t instanceID,
                             const char* biosJsonDir)
 {
     Response response(sizeof(pldm_msg_hdr) + PLDM_GET_BIOS_TABLE_MIN_RESP_BYTES,
@@ -601,8 +602,9 @@
  */
 Response getBIOSAttributeTable(BIOSTable& BIOSAttributeTable,
                                const BIOSTable& BIOSStringTable,
-                               uint32_t transferHandle, uint8_t transferOpFlag,
-                               uint8_t instanceID, const char* biosJsonDir)
+                               uint32_t /*transferHandle*/,
+                               uint8_t /*transferOpFlag*/, uint8_t instanceID,
+                               const char* biosJsonDir)
 {
     Response response(sizeof(pldm_msg_hdr) + PLDM_GET_BIOS_TABLE_MIN_RESP_BYTES,
                       0);
@@ -667,14 +669,14 @@
  *  @param[in] transferOpFlag - flag to indicate which part of data being
  * transferred
  *  @param[in] instanceID - instance ID to identify the command
- *  @param[in] biosJsonDir -  path where the BIOS json files are present
  */
 Response getBIOSAttributeValueTable(BIOSTable& BIOSAttributeValueTable,
                                     const BIOSTable& BIOSAttributeTable,
                                     const BIOSTable& BIOSStringTable,
-                                    uint32_t& transferHandle,
-                                    uint8_t& transferOpFlag, uint8_t instanceID,
-                                    const char* biosJsonDir)
+                                    uint32_t& /*transferHandle*/,
+                                    uint8_t& /*transferOpFlag*/,
+                                    uint8_t instanceID,
+                                    const char* /*biosJsonDir*/)
 {
     Response response(sizeof(pldm_msg_hdr) + PLDM_GET_BIOS_TABLE_MIN_RESP_BYTES,
                       0);
diff --git a/libpldmresponder/meson.build b/libpldmresponder/meson.build
new file mode 100644
index 0000000..c63685c
--- /dev/null
+++ b/libpldmresponder/meson.build
@@ -0,0 +1,34 @@
+deps = [
+  dependency('phosphor-dbus-interfaces'),
+  dependency('phosphor-logging'),
+  dependency('sdbusplus'),
+  libpldm
+]
+
+sources = [
+  'base.cpp',
+  'bios.cpp',
+  'bios_table.cpp',
+  'bios_parser.cpp',
+  'pdr.cpp',
+  'effecters.cpp',
+  'utils.cpp',
+  '../registration.cpp'
+]
+
+if get_option('oem-ibm').enabled()
+  sources += [
+    '../oem/ibm/libpldmresponder/file_io.cpp',
+    '../oem/ibm/libpldmresponder/file_table.cpp'
+  ]
+endif
+
+libpldmresponder = library(
+  'libpldmresponder',
+  sources,
+  version: meson.project_version(),
+  dependencies: deps,
+  install: true)
+
+libpldmresponder = declare_dependency(
+  link_with: libpldmresponder)
diff --git a/libpldmresponder/pdr.hpp b/libpldmresponder/pdr.hpp
index 71d8aee..c9df51f 100644
--- a/libpldmresponder/pdr.hpp
+++ b/libpldmresponder/pdr.hpp
@@ -47,6 +47,8 @@
 class Repo
 {
   public:
+    virtual ~Repo() = default;
+
     /** @brief Add a new entry to the PDR
      *
      *  @param[in] entry - new PDR entry