build: Add meson build
Changes to note,
- `with_systemdsystemunitdir` and `with_tmpfilesdir` is removed since it
is not being documented nor used in OpenBMC.
- Removed the Code coverage feature with `-DDHAVE_GCOV`, since it is not
used and meson covers it.
- Removed `--enable-oe-sdk` for using the OpenBMC SDK. It should work
directly with no change required.
Tested:
```
Jan 01 00:01:54 ipmid[709]: Try loading blob from persistent data
Jan 01 00:01:54 ipmid[709]: Stale blob data, resetting internals...
Jan 01 00:01:56 ipmid[709]: config loaded: /flash/bios
Jan 01 00:01:56 ipmid[709]: config loaded: /flash/image
Jan 01 00:01:56 ipmid[709]: config loaded: /flash/dummy
...
```
```
$ ls /usr/lib/blob-ipmid/
libfirmwareblob.so
libfirmwarecleanupblob.so libversionblob.so
```
Testing the service,
```
$ echo "hello" > /tmp/test.txt
$ burn_my_bmc -command update -layout dummy -image /tmp/test.txt
Sending over the firmware image.
Opening the verification file
Committing to /flash/verify to trigger service
Calling stat on /flash/verify session to check status
running
success
Returned success
succeeded
```
On the BMC.
```
/run/initramfs$ cat dummy
hello
```
Change-Id: I21c7c33bd62c0ee40681cb40da90125c125bea2f
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..826d04c
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,42 @@
+tools_inc = include_directories('.')
+
+updater_pre = [
+ dependency('ipmiblob'),
+ dependency('pciaccess', fallback: ['pciaccess', 'dep_pciaccess']),
+ dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
+ blobs_dep,
+ sys_dep]
+
+updater_lib = static_library(
+ 'updater_lib',
+ 'updater.cpp',
+ 'handler.cpp',
+ 'helper.cpp',
+ 'bt.cpp',
+ 'lpc.cpp',
+ 'io.cpp',
+ 'net.cpp',
+ 'pci.cpp',
+ 'pciaccess.cpp',
+ 'p2a.cpp',
+ 'progress.cpp',
+ dependencies: updater_pre,
+ include_directories: root_inc)
+
+updater_dep = declare_dependency(
+ dependencies: updater_pre,
+ include_directories: root_inc,
+ link_with: updater_lib)
+
+executable(
+ 'burn_my_bmc',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: updater_dep,
+ include_directories: root_inc,
+ install: true,
+ install_dir: get_option('bindir'))
+
+if not get_option('tests').disabled()
+ subdir('test')
+endif