Make PLDM an optional feature for host dump offload

Host dumps are dumps which created and stored in the host
but offloaded through BMC.
With this change if the host dump needs to de downloaded
the transport mechanism also needs to be provided
    --with-host-dump-offload-transport=<transport>
for eg:
    --with-host-dump-offload-transport=pldm
If no options provided the phosphor-dump-manager will be built
with no host dump offload support and an exception will be thrown
if someone tried to call the host dump offload function.

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I27311427d8ca8b06b9f33ff5f42bdc7ca87fdcd1
diff --git a/configure.ac b/configure.ac
index 5a3eb3a..6051460 100755
--- a/configure.ac
+++ b/configure.ac
@@ -12,12 +12,23 @@
 AC_PROG_MKDIR_P
 AC_CHECK_PROG([DIRNAME], dirname, dirname)
 
+AC_ARG_WITH([host-dump-offload-transport],
+	[
+AS_HELP_STRING([--with-host-dump-offload-transport],
+		[To specify the host dump transport protocol])])
+
 # Check for libraries
 PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221])
 PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
 PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
 PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
-PKG_CHECK_MODULES([LIBPLDM], [libpldm])
+
+AM_CONDITIONAL([DEFAULT_HOST_OFFLOAD], [test "x$with_host_dump_offload_transport" == "x"])
+AM_CONDITIONAL([ENABLE_PLDM_OFFLOAD], [test "$with_host_dump_offload_transport" == "pldm"])
+
+AS_IF([test "$with_host_dump_offload_transport" == "pldm"],
+    [AX_PKG_CHECK_MODULES([LIBPLDM], [libpldm])]
+)
 
 # Check for sdbus++
 AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])