Port to meson

Similar to ports done elsewhere, port this repo to meson.

Change-Id: I8be9f36b55eb52d085958919cd6c853b46b93674
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/README.md b/README.md
index 39bd323..2b0448f 100644
--- a/README.md
+++ b/README.md
@@ -3,9 +3,6 @@
 ```
 To build this package, do the following steps:
 
-    1. ./bootstrap.sh
-    2. ./configure ${CONFIGURE_FLAGS}
-    3. make
-
-To full clean the repository again run `./bootstrap.sh clean`.
+    1. meson setup build
+    2. meson compile -C build
 ```
diff --git a/btbridged.c b/btbridged.c
index d51b078..a24d5f8 100644
--- a/btbridged.c
+++ b/btbridged.c
@@ -227,7 +227,7 @@
 			r = r->next;
 
 		if (!r) {
-			MSG_ERR("Didn't find element %p in queue\n", element);
+			MSG_ERR("Didn't find element %p in queue\n", (void*)element);
 			bt_q_free(element);
 			return NULL;
 		}
@@ -559,7 +559,7 @@
 				new->req.seq, new->req.netfn, new->req.lun, new->req.cmd);
 
 		if (verbosity == BT_LOG_DEBUG) {
-			int i;
+			size_t i;
 			for (i = 0; i < new->req.data_len; i++) {
 				if (i % 8 == 0) {
 					if (i)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..3eca793
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,37 @@
+project(
+  'phosphor-ipmi-bt',
+  'c',
+  version : '1.0',
+  meson_version: '>=1.1.1',
+  default_options: [
+    'b_lto_mode=default',
+    'b_lto_threads=0',
+    'b_lto=true',
+    'b_ndebug=if-release',
+    'warning_level=3',
+    'werror=true',
+  ]
+)
+
+systemd = dependency('systemd')
+libsystemd = dependency('libsystemd')
+systemd_system_unit_dir = systemd.get_variable(
+  pkgconfig: 'systemdsystemunitdir'
+)
+
+executable(
+  'btbridged',
+  'btbridged.c',
+  dependencies: [
+    libsystemd,
+  ],
+  install: true,
+)
+
+configure_file(
+  input: 'btbridged.service',
+  output: 'org.openbmc.HostIpmi.service',
+  install: true,
+  install_dir: systemd_system_unit_dir,
+  copy: true,
+)