openpower-debug-collector: Rework to use native sdk for errorlog

Fixed
1) openpower-debug-collector: Removed manual copying of error yamls files
2) openpower-debug-collector: extend recipe for native processing
3) Removed dependency on phosphor-logging-error-logs-native recipe

Resolves openbmc/openbmc#1772

Change-Id: I2c0ced34e9a684bd9df34513b4800716cf93cffb
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector.bb b/common/recipes-phosphor/debug/openpower-debug-collector.bb
index 41c6e2e..be84209 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector.bb
+++ b/common/recipes-phosphor/debug/openpower-debug-collector.bb
@@ -6,7 +6,8 @@
 inherit autotools \
         pkgconfig \
         obmc-phosphor-systemd \
-        pythonnative
+        pythonnative \
+        phosphor-dbus-yaml
 
 require ${PN}.inc
 
@@ -42,3 +43,29 @@
 
 SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_CHECKSTOP_FMT', 'OBMC_HOST_INSTANCES')}"
 SYSTEMD_LINK_${PN} += "${@compose_list(d, 'TIMEOUT_WDOG_FMT', 'OBMC_HOST_INSTANCES')}"
+
+# Do not depend on phosphor-logging for native build
+DEPENDS_remove_class-native = "phosphor-logging"
+
+# Do not depend on phosphor-logging for native SDK build
+DEPENDS_remove_class-nativesdk = "phosphor-logging"
+
+# Provide a means to enable/disable install_error_yaml feature
+PACKAGECONFIG ??= "install_error_yaml"
+PACKAGECONFIG[install_error_yaml] = " \
+        --enable-install_error_yaml, \
+        --disable-install_error_yaml, ,\
+        "
+
+# Enable install_error_yaml during native and native SDK build
+PACKAGECONFIG_add_class-native = "install_error_yaml"
+PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
+
+# Disable install_error_yaml during target build
+PACKAGECONFIG_remove_class-target = "install_error_yaml"
+
+# Disable generating elog error header file during bitbake. Applications
+# should be using the elog header generated by phosphor-logging recipe
+EXTRA_OECONF += "--disable-gen_errors"
+
+BBCLASSEXTEND += "native nativesdk"