watchdog: Collect hostboot dump when watchdog times out

The hostboot dump collection to be initiated by watchdog_timeout
is disabled by default. When watchdog times out, only error
message corresponding to watchdog timeout is logged. To enable
hostboot dump collection whenever watchdog times out, the meson
option 'hostboot-dump-collection' must be enabled.

Testing - with meson option 'hostboot-dump-collection' enabled:
Ran watchdog_timeout:
case-1: CurrentHostState - off, AutoReboot - false
- Verified PEL object was not created
- Verified hostboot dump was not created
- Verified the Host State changed to Quiesce

case-2: CurrentHostState - off, AutoReboot - true
- Verified PEL object was created
- Verified hostboot dump was not created
- Verified the Host State changed to Running

case-3: CurrentHostState - Running, AutoBoot - false
- Verified PEL object was not created
- Verified hostboot dump was not created
- Verified the Host State changed to Quiesce

case-4: CurrentHostState - Running, AutoBoot - true, default timeout = 300s
- Verified PEL object was created
- Verified hostboot dump was created
- Observed Host state moving to either Running or Quiesce

case-5: CurrentHostState - Running, AutoBoot - true, specified timeout = 5s
- Verified PEL object was created
- Verified hostboot dump was created
- Observed Host state moving to either Running or Quiesce

Docker Unit test: passed

Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: Ib92d0c2f282816fb742cf07c1cb876b2cc093c12
diff --git a/meson.build b/meson.build
index 0996878..ae9962f 100644
--- a/meson.build
+++ b/meson.build
@@ -73,10 +73,21 @@
     endforeach
 endforeach
 
+conf_data = configuration_data()
+if get_option('hostboot-dump-collection').enabled()
+    conf_data.set('HOSTBOOT_DUMP_COLLECTION', true)
+    subdir('watchdog')
+else
+    conf_data.set('HOSTBOOT_DUMP_COLLECTION', false)
+    watchdog_lib = []
+endif
+
 executable('watchdog_timeout',
     'watchdog_timeout.cpp',
+    configure_file(output: 'config.h', configuration: conf_data),
     generated_sources,
     dependencies: deps,
+    link_with: watchdog_lib,
     include_directories: include_directories('gen'),
     implicit_include_directories: true,
     install: true